When you write a desktop application, you are “master of your own domain”. You launch your main window and any child windows – like dialog boxes – that are needed. From your standpoint, you are your own world, leveraging features supported by the operating system, but largely ignorant of any other program that may be running on the computer at the same time. If you do interact with other programs, it is typically through an API, such as using JDBC (or frameworks atop it) to communicate with MySQL or another database.
Android has similar concepts, but packaged differently, and structured to make phones more crash-resistant.
The building block of the user interface is the activity. You can think of an activity as being the Android analogue for the window or dialog in a desktop application. While it is possible for activities to not have a user interface, most likely your “headless” code will be packaged in the form of content providers or services, described below.
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.
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., raise such-and-so intent when the user gets within 100 meters of this-and-such location).
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.
Now we’ll see some of the things that android provide but its up to the programmer to use in his applications depending upon the requirements.
You can package data files with your application, for things 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.
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.
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.
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.
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.
- Android Project Structure
- Calling REST API from Android Application
- How to Install the Android SDK On Eclipse
- Android Database Handling
- Android: A programmer’s Guide
- Flash Light On-Off Android Application
- Flip Image Android Application
- Unlocking Android – Manning
- Learning Android
- Android Cookbook
- How to create Dynamic Colors in your App using Android 5.0 Lollipop
Popular Posts (last 30 days)
- Applications of Stack in … 1126 view(s)
- Circular Linked Lists 1069 view(s)
- Attendance Management Sys… 937 view(s)
- Simple Currency Converter… 666 view(s)
- Finding Minimum, Maximum … 637 view(s)
- Implementing Stack Data S… 619 view(s)
- Recursive Factorial funct… 572 view(s)
- Graph Implementation in C… 560 view(s)
- Finding Maximum Number in… 418 view(s)
- GRASP Design Patterns 357 view(s)
TagsAndroid C-Sharp C/C++ language Classes Data structures Design Pattern Eclipse Game Development Graphics Design Books HTML iPhone JAVA JAVA GUI MIPS Assembly Mobile Programming Books Object Oriented PDF PHP Programming Programming Books Programming Languages Books Python RaphaelJS REST Source Code Threads Tutorial Web Development Books