Thursday, April 23, 2015

Building the Perfect Android App

Most Android SDK environments have a default target, and most often it's way too high. So that is your first constraint, find the lowest SDK version to build against, then update your settings right away.

Often devs will think a feature requires a much higher version than it actually needs. One example is the wearable libraries, which have propagated to as low as 4.4 (SDK 19), so if the feature is only a convenience you can target the lowest possible SDK to increase your audience.

The most important constraint is not to use the NDK unless you have absolutely no other option. Twitter devs need to learn this but they won't listen.

The NDK can bypass everything, even built in libraries that are required for device compatibility. Devices are not identical in avalailability of systems, they have not been since the first Pentium computers were sold.

The NDK is only useful if you are targeting specific systems, like the GPU, in specialized ways that require intense CPU processes. Any other time it is not only useless, it can make an app useless.

Yes, realtime, OpenGL or editing, multimedia is the only valid use for the NDK at this time. Anything that has an Android library should use that library only if you want your app to not suck.

Ensure your manifest is complete and perfect, if your app requires a specific feature then make sure the manifest knows this. Do not overload the widgets, or create simple widgets that display images which store the least frequently updated displays.

An example, if you have three widgets overlapping that are never updated after loading, use a software image, paint it once, then use one widget to display the result. Layered widgets get refreshed any time their parent is, which triggers a refresh of all widgets those overlap.

Again I remind you, keep it simple. Make sure all classes have only the includes they need, even they are not used all include lines are linked, this is the most common and devastating error in any Java language.

The final constraint is to test, test, test. You can never test an app too much, but it's easy to test an app too little.

No comments:

Post a Comment