Category Archives: Android

Use Android’s Resource-Switching Mechanism For Language Localization & More

To begin with, let’s see what are resources in an Android project. All kinds of static data, such as text strings, layouts and pictures, are considered as resources. And indeed, they are very important, without them any application is useless. But resources may vary based on many situations and the device’s configurations. Luckily, handling resources is quite easy with Android’s resource-switching mechanism, that is, the device automatically sets and loads he appropriate resources depending on the configurations.

exit_sortieFor example, the default language for an app is English and the developer also wants to make the app available in French. Doing the translation for the app is as easy as placing another strings.xml file in res/values-fr folder. When a device that is configured in French tries to open the app, Android will detect there is a strings.xml for French locale and will use values from that file.

Important Note:

Default resources must always be made available, otherwise the app will crash if it is launched in another locale. Locale or alternative resources can be a subset of the default resources, but not vice versa. As an example, maybe you want to translate all texts in your app to French except for the app’s title. then, you need not include the title in the strings.xml file for French locale and Android will load the default title together with French text for everything else.

When creating a resource directory for alternative resources, it is important that we follow the naming scheme specified on the android developer’s website for providing alternative resources.

Side Note:

Changing locale on an emulator for Android is possible with the Custom Locale application or by using the adb shell command:

setprop persist.sys.language [language code];setprop [country code];stop;sleep 5;start


Setup Your Android Development Environment Quickly With Android Developer Tools Bundle

Experienced Android app developers probably know what a pain it was to setup a development environment for Android. But now, with the ADT (Android Developer Tools) Bundle, setting up your development environment is a breeze. Seriously. You just need to download the appropriate bundle for your platform (Windows, Mac or Linux), unzip and launch Eclipse. That’s it.

Two minutes, you would have already created a simple Android app with some text on it and images in it. The bundle also includes all the components to create an emulator and launch your app, if you don’t have a device.

Of course, if you prefer to develop your Android apps on another version of Eclipse, you would have to set up everything manually. Have a look on the Android developer’s website for more information.

Why Did I Choose To Develop On Android Rather Than IOS?

Being an iOS developer, creating apps for THE iPhone, certainly has a ‘cool factor’ but the costs involved in setting up a development environment is very HOT. That was the main reason that pushed me to join the Android developers community, but Android is fast becoming very popular because of it’s openness. You can have an Android device for less than $100 and the cost of setting up the development environment is not high as well. In fact, you can start creating Android apps on a low priced computer running a free operating system such as Linux or Ubuntu.

The ‘apps culture’ is quite different for the iOS and Android platform, in my opinion. It is easier to make money selling apps directly to iPhone/iPad/iPod users, whereas with Android, you will have to be a bit more smart with the way you are going to make money from the apps. The best way is probably to place ads in the apps and get paid per impression. A nice, useful and cleverly marketed Android apps can have thousands, if not millions, of installs.

Before starting my mobile development experiments, I already had some experience programming in Java, so adopting java for Android was not too hard. On the other hand, when I tried to learn the basics of Objective C for iOS, I quickly realized there is a very steep learning curve ahead of me. That’s certainly NOT a reason for me to give up iOS development though.

So, will I start developing apps for iPhone in the near future?

Certainly YES, until I have enough money to setup everything, but for the time being I still have quite a lot to learn and put in practice in my mobile apps. Hopefully, will put some Android apps on the Google Play Store soon.

How To Build An Android App Within An Android App

Sounds crazy, yeah? But it’s possible with the AIDE – Android Java IDE app, where you can write and compile Java code and generate Android apps from your Android TABLET or even PHONE.

Development on tablets or phones is surely gonna be a real pain, especially if you don’t have an external keyboard connected. But, it is helpful if you are on the go and want to do some coding. ┬áPersonally, I think I’ll stick with the computer for developing apps, it’s way much faster, especially when you have more than one screen. ;)

In my opinion, the AIDE app is a one-of-a-kind innovation in the Android World. Hats off to the AIDE Team!

Getting Started With Android Apps Development

Long time, no post ;)

Anyways, the last few weeks I have started learning Android apps development for mobiles and tablets. I have had the chance to do quite a bit of programming in Java at RMIT University, but never really used the skills in the real world. So, now I will be re new those skills when developing my android apps.

As with any new programming platform, I started with a ‘Hello World’ application and ran it on the emulator for an Android phone. Currently, I reading some books and working on a simple application that will post and retrieve status updates from a Twitter-like site.

For anyone wishing to get started developing apps, I recommend going through all the resources available on the Android Developers Guide for a start and then start reading some books. But above all, it’s very important to get your hands dirty and actually practice. It may all seem so complicated when you are just reading, it’s only when you get started doing it and with some practice that you will get familiar with all the stuffs.

The hardest part at first would probably be to setup your programming environment. As suggested in the Android Developers Guide, I’m using the latest version of Eclipse with the ADT plugin. I will be posting more about Android apps development soon…