Activating Components in Android,
Android Application Fundamentals and Components
Android Application Fundamentals →
As all we know that Android apps are
developed in Java Programming Language. The Tools Android SDK will
compile the code and then along with any resource files and data.
Complete code can be found in the single file that is apk file (It is
called Android package file) .apk file is use to installed app on
devices
Each android application have its own
world where it execute and show the results.
Actually Android OS is like a multi
user Linux systems where each and all applications is a different -2
user.
By Default, all applications executes
in its own process of Linux. Android begins the process when any of
the application's code required to be executed and the process should
be the shut down after completion of work and when no longer required
to execute and system resources are required by the another
application.
Each process have its own VM mean java
virtual machine, so applications code executes in isolation form the
code for all other application.
By Default all applications assign a
unique user ID of Linux. Access are set so that the files of
application's are became visible only for that user and only to that
application itself – although there is a way to export those to
another application as well as.
With some specific conditions,
different applications can share their data or record with each
other:
→ Both applications should have linux
user id and both must be execute with same process of linux .
→ The Application must be sign for
same certificate
Android Application Fundamentals and Components |
Components of Applications:
There are multiple component of android
application are available but that are very essential for building
the blocks of apps which are exist as its own entity and specific
role play by them. Building blocks for apps define the all over
behavior for our application. There are generally four types of
component of an application.
- Activities → An activity gives to user interface for a single screen in our applications. Activities can move into the background and then it can be resume with the saved state. Applications usually consists for multiple activities that are not closely connected to each other. So typically one activity in an application is specified as the “Main” activity, which is available for user when going live the application first time. If one app is compose to multiple screens then it have an activity for each and every screen. When new activities start a new activity will start then previous activity will stop, bit system preserve the activity in a stack.
- Services: A service is like a component of Android app that executes in the background and has none any visual UI. Services are used to process the processing part of our application in background. While the user is working on the foreground UI, services can be used to handle the processes that required to be completed in the background. A service will start by one component but it can be keep start in the background after user switches on another apps. By this way services are very less like to be destroyed by the Android system to free resources than Activities.
Mostly there are two types of Android
services are:
→ Unbound Services: As it name
suggest it is not bound to any type of component. Once it started it
will run in the backgound even after the components which was begun
the service finished.
→ Bound Services : It is the
bound to other components and executes only till the component to
which is bounded executes.
- Content Provider:AS it name suggest it is used to share the records among the multiple applications. We can save the record in the file system, SQLite database, on the web, or any other persistent save location our app can access. Then through content provider another application are able to query, access or the even edit the record we have generated, as long as our content provider allow it.
- Broadcast Receivers: A broadcast receiver is a component that does nothing but react and receive to broadcast the announcement. Many broadcast originate from the systems -: for example, a broadcast announcing that the screen has been switched off, or picture was capture, the battery is low and other apps can receive with the help of broadcast receivers.
Activating Components:
Intents: are the components which are
going to activate. The component → activities, services and
broadcast receivers are activated by the asynchronous messages called
intent. An intent is an object that hold the contents of the
messages. There are following two types of intent in Android:
→ Explicit Intents:It is
designated by its name to the target component. So in explicit
Intent, you need to specify the activity which should get active on
the intent of receiving. These are commonly used for internal
communication of application.
→ Implicit Intents: From
implicit Intent, you can send a message to the system of Android to
find the suitable activity which can responded to the intent.
Implicit intent are often use to activates component in the another
apps.
Manifest File: In its root
directory, AndroidManifes.xml fiels are present for each application.
AndroidManifest.xml is a powerful file on the Android platform which
allow us to describe the functionalities and the requirement of your
android application. The manifest is the structured XML file and is
always name it with AndroidManifest.xml for all the application.
Following are some comment for more
explanation -:
→ Informing about the component of
application to Android
→ Declaring the components of
application, like as naming any libraries that application need to be
link against.
→ Declare the feature of software and
hardware which are used or require by the application.
→ Now Declare the minimum API level
require by application
→ User permission need to identify
for app expect to be granted
Need to confirm that manifes is
packaged with our apps and contains the given below elements and
recore
→ Version Name
→ Uses -SDK
→ Uses – Configuration
→ Uses-feature
→ Supports – Screens
No comments:
Post a Comment