Top 8 Amazing Android Development Tips
Android basically is an operating system used for mobile devices. Android is an open platform, iPhone is a good product, everything else is decoration. Android is most exciting in its incarnations outside of what is expected in mobile, desktop and tablets. Android makes it extremely easy to get started. The full contents of the Android source code are available online, with comprehensive documentation and an eager and friendly community. Here we are showing you eight tips of android development.
1.Reserve your name space – The Google Android Market uses the package name that you declare to uniquely identify you amongst the thousands of other apps available. If you know ahead of schedule that you’ll be releasing a certain application, it’s a good idea to get in there early and make sure you can reserve your place!
2.Learn SQL and put your data models in a database – Android has an excellent persistence system; use it to make your applications more robust in case of failure or shutdown, and to make suspending and resuming more efficient. Android’s SQLite-based storage system is thoroughly integrated with Android’s user interface classes.
3.Listen to your users – Your own views and preconceptions can blind you to what the majority of people really care about. Gather as much feedback as you can about your application and more importantly, be sure to act upon it.
4.Use Android’s platform patterns – There are a lot of applications out there and we want them to use together, so before we start cutting out our unique niche in the Android Market, consider first trying to fit into the way people are already using Android applications. If you prove yourself into their existing habits you’ll already have an eager well educated bunch of users!
5.Learn XML – You don’t have to know much about XML to use the visual editing tools for defining layouts and other resources. You are, in theory, hardly ever required to edit XML “by hand.” But these tools are imperfect. The more you know about how Android uses XML, and about the Android XML schema, the easier it is to fix problems that occur in XML in Android applications, and the more comfortable you will be using XML to maximum effect in developing Android applications. A general XML book, like XML in a Nutshell, or Learning XML can be useful.
6. Add layout defaults to your theme – Every single layout item in views is going to need a declared height and width. All together this adds up to lots and lots of extra lines in your XML layouts and styles. Instead, fallback on the sensible default of always wrapping your layouts. This way, unless you declare otherwise in your styles, you can expect your views to wrap their content and you can save space on all those redundant width/height declarations. Simply add the following within your theme:
<style name="Theme.YourApp" parent="android:style/Theme.Light"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> </style>
7. Use automated testing – Use the Monkey to stress test your application. It generates a stream of events, simulating random inputs, and reports application crashes or lack of response. Use the Instrumentation Framework and JUnit to write unit tests that can be run from Eclipse using adb and the Instrumentation TestRunner.
8. Standardize your naming convention – You should standardize your naming convention first. Under the res/values/directory you’ll find a whole load of attributes, but try not to get carried away in creativity with your naming. Establish some sensible guidelines and then stick to them/ That way, later on down the line during an important bug fix, your development partner will be able to find items unassisted.