- A service does not have a visual user interface, but rather runs in the background for an indefinite period time.
- Each service extends the Service base class.
- Performs regular processing or handle events even after your application’s Activities are invisible, inactive, or have been closed.
- It is possible to bind to a running service and start the service if it's not already running.
- While connected, it is possible communicate with the service through an interface.
Saturday, August 6, 2011
What is service?
Friday, August 5, 2011
What are the steps for creating an activity?
- create your own Class and extend it from Activity
- implement the method OnCreate() in your activity
- create your view using Layout file
- use Activity.setContentView() to set the above created view to your application.
- declare the the same Activity in the AndroidManifest.xml File
- declare intent-filter for the activity (optional).
What is an Activity?
- An Activity is a single screen visible on the screen and has the capability to interact with the user.
- Application’s presentation layer. Every screen in your application will be an extension of the Activity class.
- Activities use Views to form graphical user interfaces that display information and respond to user actions.
- A view hierarchy is placed within an activity's window by the Activity.setContentView() method.
- In terms of desktop development, an Activity is equivalent to a Form.
- An application might consist of just one activity or, it may contain several.
- In an Application, usually one activity is made as a main activity, which will be placed in the launcher menu as an icon to start the application.
Android Funamentals
Before going into the sample application the Application developer must have know about these components:
Android Basic Building Blocks:
Activity: Single visible screen for user interaction.
Service: Face less task to run in the background.
Content Provider: enables applications to share the data.
Broadcast Receivers: responds to system-wide notifications or status changes
Activating components:
These are responsible to activate the above building blocks. (except for Content providers).
Android Basic Building Blocks:
- Activities
- Services
- Content Providers
- Broadcast Receivers
Activity: Single visible screen for user interaction.
Service: Face less task to run in the background.
Content Provider: enables applications to share the data.
Broadcast Receivers: responds to system-wide notifications or status changes
Activating components:
These are responsible to activate the above building blocks. (except for Content providers).
- Intents
- Intent-filters
Intent filters: the means through which a component advertizes its own capabilities to handle specific job/operations to the android platform
Intents and Intent filters enables Activities, Services and Broadcast receivers to communicate with each other and pass the messages between each other.
Other than these components, we must know about AndroidManifest.xml file,
- describes all the application components that the package includes to Android system.
What is Dalvik Executable (DEX)?
- Compiled Android application code file.
- A optimized format for efficient storage.
- All classes are compiled with a standard Java language compiler.
- A tool called dx is used to convert some (but not all) Java .class files into the .dex format. Multiple classes are included in a single .dex file. Duplicate strings and other constants used in multiple class files are included only once in the .dex output to conserve space.
What is the Dalvik Virtual Machine?
- Is a register based virtual machine which runs the applications on Android mobile/tablet devices.
- It understands its own binary format Dalvik Executable (DEX)Every Android application runs in its own process, with its own instance of the Dalvik virtual machine.
- Optimized for low memory requirements run on a slow CPU on an OS without swap space low power consumption.
- Relying on underlying OS for memory management and threading support.
- From Android 2.2, Dalvik VM has a just-in-time compiler
What is Android?
- Android is the first: complete, open and free mobile platform..
- It was initially developed by Android Inc. and later Google acquired the start-up company and later formed the Open Handset Alliance
- A complete software stack for mobile devices, that includes :
- Operating system
- Middle-ware
- Key applications
- Rich set of API’s
- Based on Linux kernel 2.6 Uses the Java Language syntax for coding
Subscribe to:
Comments (Atom)