Common and Silly Mistakes to Avoid while writing Android Apps

Android Manifest File: This file is the heart of the app. This file contains the configuration settings like which file is the main program that is should be executed when you launch the app. Few things to remember

1. If your app is using any one of these features like bluetooth, writing data into a file on sdcard, making any REST calls communications you should give permissions in the android manifest file in your app, in order to access them.

<uses-permission android:name=”android.permission.BLUETOOTH” />
<uses-permission android:name=”android.permission.BLUETOOTH_ADMIN” />
<uses-permission android:name=”android.permission.INTERNET”/>
<uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”/>

2. If you want to have multiple pages in your app, you usually write different activities, and to navigate from one page to another page you use intents. You should put this activity in the manifest file else you will get an error.

3. Always perform network operations (like making http calls etc) in new thread. Never use main thread to do these operations.

Android 2.2 supports writing network operations on main thread but its not supported from Android 2.3