Saturday, January 19, 2013

Sharing the application development experience part 2

1. Framework will give you the exception unexpected.
In http://developer.android.com, it mentioned that if you use some APIs, it may throws exception, developer should noticed that catch this exception properly. However, framework will sometimes throw the exception unexpected, developer should also take care about this. In normal use case, you may not meet this problem, but once the system is going to busy and trigger some memory killer event. The best way to avoid such problem, you should look into the source code of APIs that you used in the app. It will make your app more robust and stable.

2. Handle click event carefully.
In your app, you may use different button in the same activity and you know you should handle these click event. But you may not know sometimes, the event is not come one by one. If one click event will make some other click event go into invalid state, you should take care about it. For example, if you want to handle click event one by one, you should have the mechanism to avoid the multiple click event come

simultaneously.


3. Take care of dialog
Dialog needs the context object to show or dismss. If your app may use this dialog in backgorund, you should make sure the context is really existed or not, otherwise user may meet force close issue. Actually, the best way is that you should take care of the dialog by different activity life cycle.

No comments:

Post a Comment

You can leave any question here and I will make a response to you ASAP. :D