Thursday, 26 June 2014

Android Programming

Android has always attempted to foster a strong development environment. After all, good developers who are confident in the platform are the key to innovation. Becoming a Google developer is simple and requires a one-time setup fee of $25 (good for an unlimited number of app submissions). One of the most attractive aspects of creating Android apps is how quickly they are available for sale after submission.
Typically, apps are available for purchase and download within hours of submission. A submission to the Apple App Store, for instance, can take 4-6 weeks (or longer) for approval before becoming available to consumers. In such a highly-competitive app marketplace, this time-to-market differential is significant.
You will learn more about the app submission process later in this guide, but it’s important to understand why Android is probably the best platform for creating best-selling applications since you have now chosen it as your development platform of choice.
The Android programming language is actually a set of Java APIs. You already have the JRE and JDK installed on your computer so you are all set there. As previously mentioned, a basic understanding of Java principles also helps. Java Fundamentals I & II is a great place to start.
Although Android is Java-based, there are a few differences that even experienced Java developers may not be familiar with. Android programming is broken up into four components that work together to create every functional application. They include:

  • Activities – An Activity represents any single screen with a user interface on an Android device. For instance, an email application would have an activity that displays new emails, another designed to compose new emails and another activity for reading mail. This is an important component of Android because although these activities all work together, they are separate processes. This means that another application can start an activity (with permission). A good example of this idea in action is a camera application that can open the email app to attach a photo to a new email automatically.
  • Services – A Service does not have a user interface and is specifically designed to handle long-running operations. Typical Services include a service that plays music in the background and background data synchronization. This component allows the OS to perform these functions while the user is performing other tasks on the device.
  • Content Provider – A Content Provider manages a shared set of data across applications. Data can be stored directly in the file system of the device, in a separate SQLite database, on the Web or in any other persistent data location. The default Contacts application built into Android has a Content Provider that can share contact information with other applications. This is how social media apps like Facebook can sync with existing contact information (and how contacts are automatically backed up to Google servers).
  • Broadcast Receiver – Broadcast Receivers respond to system-wide announcements. Although many of these announcements are generated by Android (such as screen off or battery low), Broadcast Receivers can also be generated by user-installed applications. Although Broadcast Receivers usually don’t do much work, they are responsible for starting services or activities as needed to provide a smooth user experience. Broadcast Receivers are also commonly used to implement many app widgets placed on the homescreen.
Remember that one of the most powerful parts of Android from a development standpoint is that you can reuse existing code to create functional applications quickly. For instance, if your app needs GPS data, you don’t need to write the code for implementing GPS. Instead, you simply need to call the existing GPS framework inherent to Android for use in your application. Using the camera, SQLite databases and 3D graphics rendering are all just as easy. Even novice developers can start creating useful application without extensive training or experience.
You can learn more about creating your own Android applications in Android App Development Fundamentals I.

No comments:

Post a Comment