Android - to be continued
In my project I used Fragments to could reuse fragments and to improve performance during switching between screens. Managing fragments it is important to care what is added to which object. Ex. I had problems with hiding and showing fragment because I added it to it self.
Other area explored by me was testing Android application.
- Unit tests - the same as for desktop/j2ee application tests
- UI test - there is a tool called uiautomatentest - I haven't used it yet. It can send to Android application events as touches, finger moves etc.
At the end I collected some best practices to develop in Android:
1) don't execute long process task in UI thread - since Android 3.x some IO tasks will throw an exception then they are used in the same thread as UI.
1) don't execute long process task in UI thread - since Android 3.x some IO tasks will throw an exception then they are used in the same thread as UI.
2) prefer to use a service than an asyncTask. During memory cleaning at first are killed asyncTask and only when there is too little memory services are killed.
3) give your application permission only it needs. Application will be safer.
4) store application and user data on phone, avoid save it on external memory.
Now, all hands to the pumps!
No comments:
Post a Comment