What an Android magic box has inside?

I hope you have enjoyed ‘My First Program‘ post. Before we proceed with the post, I request you to share this blog to your friends and colleagues who are interested to play around with Android. Our official Facebook has been launched. Like our FB page and keep getting the updates.

Okay, its time to understand the internals of Android OS and folder structure of Android application.
[pgsubscribe]

When we write a desktop application, we are the masters of using the controls which range from simple textbox to dialog box. Desktop app usually has main window – Window and child window controls – Textbox, Label etc., We use database to store and retrieve information by using JDBC, ODBC technologies to establish communication between application and DB.

Android also has similar concepts, but built differently, and structured to make phones more crash-resistant. They are:

The building block of the user interface is the activity. You can think of an activity as being the Android analogue clock for the android window or dialog in a traditional desktop application. Every android application should have at-least one activity if the application involves UI. Every class must inherit Activity class which is the predefined class in android.app.Activity package provided by Google. It is possible for activities to not have a user interface, most likely they will be content providers or services which are described here.
Content providers provide a level of abstraction for any data stored on the device that is accessible by multiple applications. The Android development model encourages you to make your own data available to other applications, as well as your own – building a content provider lets you do that, while maintaining complete control over how your data gets accessed. Typical example: Your third party SMS application, For ex: Go SMS Pro access contact information available in your mobile when you select recipient.
Intents are system messages, running around the inside of the device, notifying applications of various events, from hardware state changes (e.g., an SD card was inserted), to incoming data (e.g., an SMS message arrived), to application events (e.g., your activity was launched from the device’s main menu). Not only can you respond to intents, but you can create your own, to launch other activities, or to let you know when specific situations arise (e.g., When you click individual mail in Gmail app, mail will be opened in new window – the launch happens here with the help of intents ).
Activities, content providers, and intent receivers are all short-lived and can be shut down at any time. Services, on the other hand, are designed to keep running, if needed, independent of any activity. You might use a service for checking for updates to an RSS feed, or to play back music even if the controlling activity is no longer operating. Simple, your Facebook android application runs in background as service to check for new post etc.,

Stuffs involved in Android

Storage

You can package data files with your application, for now that do not change, such as icons or help files. You also can carve out a small bit of space on the device itself, for databases or files containing user-entered or retrieved data needed by your application. And, if the user supplies bulk storage, like an SD card, you can read and write files on there as needed. To be more specific, Android provides in built database – SqlLite

Network

Android devices will generally be Internet-ready, through one communications medium or another. You can take advantage of the Internet access at any level you wish, from raw Java sockets all the way up to a built-in WebKit-based Web browser widget you can embed in your application

Multimedia

Android devices have the ability to play back and record audio and video. While the specifics may vary from device to device, you can query the device to learn its capabilities and then take advantage of the multimedia capabilities as you see fit, whether that is to play back music, take pictures with the camera, or use the microphone for audio note-taking

GPS

Android devices will frequently have access to location providers, such as GPS, that can tell your applications where the device is on the face of the Earth. In turn, you can display maps or otherwise take advantage of the location data, such as tracking a device’s movements if the device has been stolen.

Phone services

And, of course, Android devices are typically phones, allowing your software to initiate calls, send and receive SMS messages, and everything else you expect from a modern bit of telephony technology

As of now, we discussed about the contents involved in Android OS. Let us shed some light on Project structure and folders in Android application:

An XML file which describes the application. The foundation for any Android application is the manifest file: AndroidManifest.xml in the root of your project. Here is where you declare what all is inside your application – the activities, the services, and so on.
Ant script for compiling the application and installing it on the device
Holds the application once it is compiled
Holds the Java source code for the application
Holds “resources”, such as icons, GUI layouts, and the like, that get packaged with the compiled Java in the application

Resources folder has many folders inside it, they are:

Holds images (PNG, JPEG, etc.)
Holds XML-based UI layout specifications
Holds general-purpose files
Holds strings, dimensions, and styles

That’s all, done! 🙂
Share with you friends if you felt this post interesting!!

[pglinkadssmall1]

Suggested posts for further reading


[pgfeedback]
[pgwriteforus]

Related Articles

Author: Udhay

Share This Post On
468 ad
  • Sumeda

    very good post….

    thanks for knowledge sharing…

Join now to get more access to our Android Tutorials

Join now to get more access to our Android Tutorials

Once you Join, you will receive Mail containing latest Android Tutorials once a month !!

I promise I wont spam you !!

You have Successfully Subscribed!

Pin It on Pinterest

Shares