BCA TY Mobile Application Development UNIT I Introduction To Android
BCA TY Mobile Application Development UNIT I Introduction To Android
1. Applications
2. Android Framework
3. Android Runtime
4. Platform Libraries
5. Linux Kernel
Applications
The top layer of the android architecture is Applications. The native and third-
party applications like contacts, email, music, gallery, clock, games, etc.
Application Framework
The Application Framework provides the classes used to create Android
applications.
It also provides a generic abstraction for hardware access and manages the user
interface and application resources
Android Runtime
Android Runtime environment is an important part of Android rather than an
internal part and it contains components like core libraries and the Dalvik
virtual machine.
Linux Kernel
Linux Kernel is a bottom layer and heart of the android architecture.
It manages all the drivers such as display drivers, camera drivers, Bluetooth
drivers, audio drivers, memory drivers, etc. which are mainly required for the
android device during the runtime.
Activities
Intents
Content Providers
Broadcast Receivers
Services
All these application components are defined in the android app description file
Android Activities
In android, Activity represents a single screen with a user interface (UI) and it
will acts an entry point for the user’s to interact with app.
Android Intents
In android, Intent is a messaging object which is used to request an action from
another component.
Intents are mainly used to perform the following things.
Starting an Activity
Starting a Service
Delivering a Broadcast
Android Services
Service is a component that keeps an app running in the background to perform
long-running operations based on our requirements. For Service, we don’t have
any user interface and it will run the apps in background like p
Lay music in background when the user in different app.
An activity represents a single screen with a user interface just like window or
frame of Java. Android activity is the subclass of ContextThemeWrapper class.
By the help of activity, you can place all your UI components or widgets in a
single screen.
The 7 lifecycle method of Activity describes how activity will behave at different
states.
The android project contains different types of app modules, source code files,
and resource files.
1. Manifests Folder
2. Java Folder
3. res (Resources) Folder
Drawable Folder
Layout Folder
Mipmap Folder
Values Folder
4. Gradle Scripts
Manifests Folder
Manifests folder contains AndroidManifest.xml for our creating the android
application. This file contains information about our application such as
application components. It acts as an intermediate between android OS and our
application. Following is the manifests folder structure in android application.
Java folder
Java folder contains all the java source code (.java) files that we create during the app
development, including other Test files. If we create any new project using Java, by
default the class file MainActivity.java file will create automatically under the package
name “com.gopal.notificationdemo”.
Res/drawable folder
It contains the different types of images used for the development of the
application. We need to add all the images in a drawable folder for the
application development.
Res/layout folder
The layout folder contains all XML layout files which we used to define the user
interface of our application. It contains the activity_main.xml file.
Res/mipmap folder
This folder contains launcher.xml files to define icons that are used to show on
the home screen. It contains different density types of icons depending upon the
size of the device such as hdpi, mdpi, xhdpi.
Res/values folder
Values folder contains a number of XML files like strings, dimensions, colors and
styles definitions. One of the most important file is strings.xml file which
contains the resources.
1. Responsive design
The best way to create a responsive layout is to use Constraint Layout as the base
layout in your UI.
Constraint Layout enables you to specify the position and size of each view
according to spatial relationships with other views in the layout. All the views
can then move and resize together as the screen size changes.
wrap_content — enables the view to set its size to whatever is necessary to fit
the content contained in the view.
match_parent — enables the view to expand as much as possible within the
parent view.
0dp (match constraint) — In a ConstraintLayout, similar to match_parent.
Enables the view to take all the available space within the view's constraints.
2. Responsive design
This is the required xml file for all the android application and located inside the
root directory.
2. <application>
3. <activity>
4. <intent-filter>
4.1 <action>
It adds an action for the intent-filter. The intent-filter must have at least one
action element.
4.2 <category>
It adds a category name to an intent-filter.
<manifest>
<application>
<activity android:name=".MainActivity" >
</activity>
</application>
</manifest>
5. <uses-permission>: This element specifies the Android Manifest
permissions that are requested for the purpose of security.
The End