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. Possible to deserialize java object on Android?

Hi there.

I was looking for information as to whether this is possible or not before I
go down this avenue
of writing sockets.

Essentially, I create a TCP/IP socket connection to a simple server I have
written in
Java that accepts socket connections (Using ServerSocket accept method). On
the android
side, I will want to serialize an object that of a class 'Foo' that
implements 'Serializable' interface.
The server will demarshall this object, make a modification, serialize it
again and send it back
to the android client over the same socket connection. My question is - Will
the android client
be able to demarshall the object? The reason I ask is that someone informed
me that android
does not use the java virtual machine and so and isn't byte-code compatible
at all.

Is HTTP REST a better option for communication between my android client and

Many thanks for your help,
Best Regards


2. Android-Kernel-regarding

Hello, Everyone.

I have a HTC mobile . The mobile description is as follows-
Model Number : HTC Tattoo
Firmware Version: 1.6
Kernel Version: 2.6.29-gf922713
Build Number: 1.67.720.8 CL#74492 release-keys
Software Version: 1.67.720.8

I am a new bee to this android world. I want to do the below things
can any one tell me how can i do such things...

1) I want to make some change to the android kernel .
2) After that that i want to install my whole kernel to the above HTC
3) What are the procedure to do it?
4) what are things should i download and how will i get it?

I am using ubantu 10.04 OS for doing it. The HTC mobile has an
operating system , I want flash it, and to install the customized


3. How to cache Websites

4. ImageView hardcoded into layout referencing drawable resources

5. OOT : Hollywood Stop Edarkan Produksi Filmnya ke Indonesia

6. drawBitmapMesh

7. Android SDK and AVD Manager shows already installed updates as "Available"