How to make a widget that doesn't drain the battery and updates often

by Chister Nordvik » Sun, 06 Jun 2010 02:38:47 GMT

Sponsored Links
 > Frankly, I don't know why the Genie... service sticks around for the

Neither do I, but it seems "everyone" is taking this approach. I
really really miss guidelines on Android development. Both GUI design
guidelines (toolbars at the bottom anyone?) and design guidelines for
widgets doing more advanced things than updating a clock. It must be
100 different toolbars out there at the moment in various sizes. Why
can't we have a proper toolbar in Android? Sorry, off-topic :-)

I would love to see some better suggestions :-)

No wake-locks. Only using the following code to make the widget change
am.set(AlarmManager.RTC,  System.currentTimeMillis() + 5000,

According to the documentation this should work just brilliant. But my
phone is dead every morning with my widget running. Uninstalled!

Well, people will blame my widget even if I try to tell them that they
have another application that has wake_locks so I must make my widget
behave nicely with the rest of the apps out there.

Well I have made a new service that runs all the time and receives
broadcast events for screen off and on and that works great, so maybe
I'll stick with this. When I have started 10 of my favourite apps I
have a lot of services running so I guess people are used to this.
Seems like services is a bit overused these days so no wonder everyone
complains about battery life with Android...



Other Threads

1. Dynamic insert code into an existing .apk

I would like to know if we can add our own piece of code into any .apk
like we have JavaAssist tool to do that.
does it work in this scenario as well.
kindly suggest.

2. start SMS activity on the same way as making a call via intents


With the following code I can make a call to a specific number with
Androids built-in Phone application:

Intent i = new Intent("android.intent.action.CALL", Uri.parse("tel:" +

Is there anyway I can do the same to start the SMS application? I mean
start the activity where you can write an SMS with the phonenumber
already there.
something like this:

Intent i = new Intent("android.intent.action.START_SMS_APPLICATION",
Uri.parse("tel:" + phonenumber));

thanks in advance

3. Writing file to a shared directory on Android

4. Manipulate 2D View in 3D OpenGL

5. Android browser and file upload...

6. Typing and drawing on the same View

7. Returning Result from onClickListener