- I love testing/debugging directly on my phone rather than using the emulator. BUT I have to remember that there are big differences between a plugged in phone and a disconnected phone. When I debug on my phone, the cable is attached to my USB port and the phone is charging. So it does not dim or go to sleep and so I was missing those test cases. The end result is that when I finally tested release 2 on my disconnected phone, it did not work as well.
- Wake Locks - Wake locks can be used to keep the display from dimming or the CPU from going to sleep. I was loathe to use them but it is just to inconvenient as a user to have to keep turning on the phone to see how much time is left or to look at my task list. Some notes:
- I chose to let the phone dim slightly instead of stay completely bright.
- Wake lock is per activity, so I had to remember to use it on both my home screen and my "running" screen.
- remember to release the wake lock when the activity is paused. I made sure that once the user left my activity, that the wake lock stopped working and the phone would dim/sleep while in other tasks.
- Intents - when a task is finished, i add a notification to the top of the screen. I thought it would be cool to let them see that a task had finished (even though it should be obvious) and then start the app from there. Good news is that it worked, the bad news is that it always started a new instance of my application. I didn't want this, i wanted it to join the running app. This is something I just have to get used to with Android: it controls when an app starts and I just can't expect that the app will still be running. The best I could do was change the activity launch mode to "singleTop" so that Android would try to use the current instance if it is at the top of the task list. I am sure I don't yet understand this correctly but it helped.
Exploits of a .NET (C#) developer trying to learn Android development. I am using Eclipse Helios Service Release 2 and the Android Plug In
Monday, August 8, 2011
Fine Tuning the App
Well, I am now on version 3. Version 2 came maybe four days after the initial release and Version 3 came almost right away. Here are some comments:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment