Cydia apps = Android apps = caution

Few days ago I gave a deep look at the Cydia store on my iPhone 4 and installed some apps/packages (mostly system tweaks). I had tho charge the phone, so when I went to sleep I left it turned on at 100% battery.

Next morning the battery was at 59%. Without any call, any internet browsing, any action. I was suspicious so I did a huge sweep removing all unused/unwanted Cydia applications. And as I guessed, the problem fade away, now the phone eats 15-20% battery on a normal day receiving or making around 5 calls, browsing RSS and Twitter and answering some emails from the phone.

Why this battery consumption? And why Cydia and not normal iOS apps?

iOS apps have a very restricted execution environment. Memory consumption is handled by the OS, and if the application leaves foreground and eats too much becomes the first candidate to be removed from memory to free space.

Also, any app left in background has to implement a Service, that either performs some small tasks (with an even more limited CPU and memory availability pool) or uses push notifications (either local or remote) to communicate with other services or system components (background state). Or directly does nothing else than pausing everything until resumed (suspended state)...

iOS background application management is quite aggresive: Applications that take more than 5 seconds to enter in background mode will be terminated; Some classes and components auto-dispose data structures if not being in use and displayed when receiving low-memory warnings.

Also, I assume that a few of those theorical Apple "review before approval" tests would be related with memory or resources consumption, to avoid a single app eating too much memory or running sluggish and creating a poor "user experience".

All of this might apply to Cydia apps, or may not. With a jailbroken iPhone, you can download the full iOS SDK .h files and build really low level applications, system components, and almost everything you wish.

But at the same time, nobody forces you to do something the correct way. You can skip memory consumption checks, you can develop system background applications,... But you can also easily introduce memory leaks, CPU intensive tasks only noticied after long activity periods, never-ending background tasks...

When you use Cydia your phone can be used as a Unix device. And coding a Unix OS is not the same as coding iOS.

Why the comparison with Android apps?

Well, I've had for more than a year an Android phone, and while it is great for browsing and a few more tasks, the truth is that the application store sucks. And not only because many applications have a lite version that goes terribly slow (because of the Ads, dumb background images or worse that make the apps take a lot to load), but mainly because Android SDK doesn't performs any decent control on your application behaviour.

I've tried some Android apps that made the phone go really slow (an HTC Magic is ok but far from being the fastest device out there), processes hanging on background ("the process com.xxxx.yyy has stopped responding") or crashed on phone boot and directly never worked. And using task killers is not always a good idea (although I prefer to use them and kill those free apps of unknown code quality).

The Android Market also has no review approval. You can upload anytime your app, and basically they will shut it down if people complain (and not always). No security checks (just OS warnings about what special features of your phone the application is going to use), no quality or speed checks...

Android is much like the now defunct Windows Mobile: It gives you a quite pure multitasking (although needs different code and "Services"), it gives you freedom, but it also has a risk, the risk of uncontrolled bad developers and bad code.

That's why my warning; Take caution with what you install of Cydia (and of the Android Market!). Freedom has also a price and using the non-official SDK means bad code can do bad things to your phone.

There are many interesting applications to tweak your phone, add custom free ringtones and install otherwise impossible applications (like wifi analysers), but also some apps might eat your battery and part of your CPU.

Tags: Mobile Dev

Cydia apps = Android apps = caution article, written by Kartones. Published on