kawa
Unmarried, Loving Life!
Posts by kawa
What you should know before you start application development on the Android system
Mar 20th
First of all, if you want to start developing Android applications you’re going to first have to get used to the Java programing language because this is the means by which you’ll code your applications. Of course, if you pretty savvy with C++ or some other object oriented language then simply having some good Java tutorials bookmarked (i like this one) and learning it on the way will not be a problem if you think you’re up to challenges that lie ahead.
Now, what is an Android system? It’s practically a complete development environment with a complete software stack which contains the operating system (based on the Linux 2.6 kernel), a middle-layer application framework, a set of C/C++ libraries used by various components of the system to which you have access through the application framework mentioned above, and some core applications that you can also have access to, programmatically (I’ll explain below how why this is possible).
Having the Linux 2.6 Kernel at the core of the operating systems makes the platform pretty safe and well established when considering the Linux Kernel process management, memory management, networking stack, and driver model have undergone a long and arduous process of R&D for years.
The most important thing you need to know is that each application runs in its own safe-box: it has a unique user ID assigned by the OS, a unique process and therefore a unique virtual machine. No application can access the files or the memory of another one without being allowed to do so by Android’s kernel system.
Application Components:
The second most important thing is the way applications are structured. Each application can be comprised of four distinct parts called Application Components: the Activities, Services, Content Providers and Broadcast Receivers components. What is remarkable is that from your application you can access components that belong to a different application and this is not achieved by loading the code of that component into your process’ address space; no, it’s simply executed within its own kernel assigned process that has its uniquely assigned user ID. Because the Android system allows every application to start another application’s component you can practically use components from already developed applications into your own as if they are an integral part of your program. Pretty neat!
Because each application is loaded by its own process into its own address space, and because each application can start (use) any others’ component this means that there is no central station, no entry point of the whole system or as Android’s Documentation puts it “Android applications don’t have a single entry point (there’s no main() function, …..)“.
What are the application components? Activities are simply a singe screen or window that contains a user interface. A certain application can contain lots of activities designed to achieve a specific goal. They all are part of the application even though they are treated as separate when you program their functionality.
Services are simply background processes which can run for the whole execution time of the application. You can think of them as the core/heart of you application because they can coordinate the activities for the other components, they can trigger specific actions at certain times, they can access the network, etc.
Broadcast receivers are simply listeners for system broadcasts or application broadcasts. Your own application can generate broadcasts that can be catched by Broadcast receivers. These components can have a wide variety of uses one being that they can be used as triggers in your application’s workflow logic when certain system events or other application generated events take place.

Android Architecture
And finally, Content Providers. They are data storage providers: databases, file system data, web storage, etc., these can all be accessed by means of a Content Provider. What’s interesting is that different applications can share (read, modify) data contained in the same Content Provider object which is practically a shared set of application data; one interesting example is the contacts (ContactsContract.Data) Content Provider which contains user contact information (such as a phone number) and its associated metadata (such as whether it is a work or home number, email, etc) and can be accessed and modified by applications that have the appropriate privileges (meaning the ones that have been programmed to have these privileges, and subsequently have been installed by the user of the device).












