Thursday, July 31, 2014

5 best practices in writing code for mobile applications (Android and iPhone)

1. Write server side javascript code rather than mobile front ends / mobile apps

A couple of years ago I participated into a seminar where software developers from Twitter held presentations. They recommended using as much server side javascript code as possible rather than designing the actual apps. Reason being that, when you create apps, they get deployed on many different mobile platforms with a multitude of configurations and services turned on and off. The other thing you cannot control when you write apps is the behavior of other apps the user may have running on his/her mobile phone.

Writing server side gives you control over the code. When you do that you basically design a mobile ready website rather than designing an app that talks to web services or APIs. And the data collections and processing can be done on the server- which gives you not only reliability but also more computing horse power.

2. On Android test on multiple physical platforms

There are many different Android manufacturers these days. From the Galaxies to the HTCs, from the LGs to the Huaweii and from Google Phone to Motorola, every single company has now its own product line with multiple platforms: that means multiple levels of processing power, different kinds of memory, different kinds of local-on-the-phone storage space and different screen resolutions.

And of course there are all kinds of emulators as well such as the one included in Android's SDK. iPhone is more standard in resources but you still have a number of different hardware configurations and that will increase this fall with the release of iPhone 6.

But there is nothing like the real thing. When you write code for mobile devices you have no choice but to test it on multiple platforms. So beef up on your collection of mobile devices to test on!

3. On location based services check the accuracy of your data

Mobile location based services rely a lot on pre-existing data stored in things like Google Maps or Bing Maps. Their databases are impressive & huge and most of the data is clean. Most of the times what you have to do is to hookup to their web services and pull the data and present it nicely on your on the mobile front ends.

For example we designed an Android app that goes out and queries Google Maps and pulls down data on the closest pizza stores of certain brands. Then in one touch of a button it calls the closest favorite brand pizza store for you to order pizza.

What we learned during designing this app was that, of course, Google Maps is not perfect :) There are Florida based locations where the web services do not return the closest existing store. Or maybe some stores did not registered the right way- when they registered with Google Maps. So we had to write our own code to filter through that.

No matter what you do, you will always have to deal with some noisy data. You just have to test and sort through inconsistencies.

4. Deploy & test twice a day

When it comes to developing mobile apps, it's always a good ides to deploy and test often. Working in small, rapid iterations will allow you to catch defects early and to adjust on-the-fly. Do not wait until de whole product is designed to start testing. Start with a minimum set of features, write and deploy. Twice a day is better than once :)

5. Do everything with the user's experience in mind

Don't forget: the most successful mobile apps are the ones that address a niche market segment (i.e. male population between 18 and 25 years old located in California), are attractive graphically and easy to use and never crash or produce unexpected results.

A recent example of a successful app like that is Tinder- very important app who is currently taking off in the social media space exactly because of these reasons: it's beautiful, it's easy to use and it addresses a specific market need. In this app the visual effect created when browsing through pictures is extremely powerful.

Even business users are interested in clean/crisp/easy-to-use front ends because they have been bombarded with clogged, underrated content for a long time.

So while you may focus on your back-end and data for most of the time, do not forget the front end quality and the users experience.

Make it a great day!

Adrian Corbuleanu
Miami Beach, FL
http://wittywebnow.com