Android is a mobile operating system developed by Google, based on the Linux kernel and designed primarily for touch
screen mobile devices such as smart phones and tablets.
In November 2007 Google formed Open Handset Alliance (OHA) in order to develop an open source software platform
for use in mobile devices. The members of OHA include handset manufactures, chip makers, commercialization
companies, software companies and mobile operators/users.
To learn about Android operating system and develop Android applications, it is very important to understand the entire
ecosystem of Android and the stakeholders of Android ecosystem.
Important Components of the Android Ecosystem
i) Google
ii) OEMs (Original Equipment Manufacturers)
iii) Application Development Companies
iv) Freelance Android Developers
v) Consumers
List Features of Android:
1) Storage
2) Multitasking
3) Web Browser
4) Open Source
5) Accessibility
6) Media Support
7) Streaming Media Support
8) Voice Based Features
9) Multi touch
10) External Storage
11) Video Calling
12) Handset Layout
13) Google cloud Messaging
14) WiFi Direct
Android architecture is a software stack of components to support a mobile device needs. The main components of
android architecture are Applications, Android Framework, Android Runtime, Platform Libraries and Linux Kernel.
Android SDK stands for Android Software Development Kit which is developed by Google for Android Platform. With
the help of Android SDK, we can create android Apps easily. Android SDK is a collection of libraries and Software
Development tools that are essential for Developing Android Applications.
An Android Virtual Device (AVD) is a virtual mobile phone that runs on a computer. It is part of the Android Emulator
and is used to test Android apps without needing a real phone. Developers can create different AVDs to test their apps
on various screen sizes, Android versions, and hardware configurations.
The Dalvik Virtual Machine (DVM) is a special virtual machine created by Google for the Android operating system. It is
designed to run apps smoothly on mobile devices, which have limited memory, battery, and processing power. Unlike
the Java Virtual Machine (JVM), which runs Java programs using .class files, DVM uses .dex (Dalvik Executable) files,
which take up less space and work faster on Android.
Emulators in Android application development are tools that mimic real Android devices on a computer. They help
developers to test and run apps without needing a physical device.
For creating a new project in studio we need to first understand the directory structure or control flow.
1. Manifests Folder
2. Java Folder
3. res (Resources) Folder
o Drawable Folder
o Layout Folder
o Mipmap Folder
o Values Folder
4. Gradle Scripts
The basic building block for user interface in Android is a View, which is created from the View class and occupies a
rectangular area on the screen. Examples of widgets are buttons, text boxes, labels etc.
The ViewGroup is a subclass of View and provides invisible container that hold other Views or other ViewGroups.
Examples of ViewGroup are FrmaeLayout, LinearLayout etc.
LinearLayout is a type of layout that arranges its child elements (like buttons, text views, etc.) either in a horizontal or
vertical direction. The orientation can be set using the android:orientation property.
An Absolute Layout in Android is a type of layout where you can place elements (like buttons, text views, etc.) at
specific, fixed positions on the screen using exact coordinates (x and y values). This means you can control the precise
location of each element by setting their android:layout_x and android:layout_y attributes.
Relative Layout in Android is a layout that arranges its child views in relation to each other. There are so many properties
that are supported by relative layouts: layout_alignParentTop, layout_alignParentBottom, layout_alignParentRight,
layout_alignParentLeft, layout_centerHorozontal, layout_centerVertical, layout_above, layout_below.
A Table Layout in Android is a layout that organizes its child elements into rows and columns, much like a table in a
spreadsheet. It helps you arrange items in a grid-like structure where you can control the alignment and positioning of
elements in each row.
Frame Layout is one of the simplest layout to organize view controls. A Frame Layout is a layout that allows placing
views on top of each other. By default, all child views are placed at the top-left corner, but you can adjust their position
using layout_gravity.
A Text View is a UI component used to display text in an Android app. can change its text size, color, style, and
alignment.
An Edit Text is a UI component which is commonly used for input fields like usernames, passwords, and search boxes.
A Button is a UI component that users can click to perform an action. It is used to submit forms, navigate screens, or
trigger functions in an app.
A Toggle Button is a UI component that functions as an on/off switch. It allows users to toggle between two states,
such as ON/OFF, Enable/Disable, or Play/Pause.
A Check Box is a UI component that allows users to select or deselect an option. It is commonly used in forms, settings,
or multiple-choice selections. A user can check multiple Check Boxes at the same time.
A Progress Bar is a UI component that visually represents progress in an Android app. It is commonly used for loading,
downloading, or performing background tasks.
A Radio Button is a UI component that allows the user to select only one option from multiple choices. Radio Buttons
are used inside a Radio Group to ensure single selection. If not inside a Radio Group, multiple Radio Buttons can be
selected.
A List View is a UI component used to display a scrollable list of items. It is useful when showing a large number of
items.
A Grid View in Android is a layout that displays items in a two-dimensional grid, similar to a table.
android:id → Unique ID for the Grid View
android:numColumns → Number of columns in the grid
android:verticalSpacing → Space between rows
android:horizontalSpacing → Space between columns
android:stretchMode → How columns should expand
android:gravity → Alignment of items
An Image View in Android is used to display images from different sources like drawable resources, assets, or URLs. It
supports scaling, cropping, and adjusting image positions for better UI design.
android:src – Sets the image resource.
android:scaleType – Defines how the image fits inside the view.
android:contentDescription – Provides accessibility support.
android:adjustViewBounds – Resizes the image while maintaining aspect ratio.
android:layout_width and android:layout_height – Define the size of the Image View.
Scroll View is a view group used to make content scrollable when it doesn’t fit on the screen. It supports vertical
scrolling by default, while HorizontalScrollView enables horizontal scrolling.
android:layout_width – Sets the width of the ScrollView (e.g., match_parent, wrap_content).
android:layout_height – Defines the height of the ScrollView (match_parent allows full-screen scrolling).
android:fillViewport – If set to true, forces child views to expand and fill the viewport.
android:background – Sets the background color or drawable of the ScrollView.
android:scrollbars – Controls scrollbar visibility (vertical, horizontal, or none).
android:fadingEdgeLength – Defines the size of the fading effect when scrolling.
android:overScrollMode – Controls the overscroll effect (always, ifContentScrolls, never).
A Date Picker in Android is a UI component that allows users to select a date (day, month, and year). It provides an easy
way to pick a date using either a spinner or a calendar view.
Important Attributes of Date Picker
1. android:datePickerMode – Defines the display mode (spinner or calendar).
2. android:calendarViewShown – Controls whether the calendar view is shown (true/false).
3. android:spinnersShown – Controls whether the spinner view is shown (true/false).
4. android:minDate – Sets the minimum selectable date.
5. android:maxDate – Sets the maximum selectable date.
6. android:firstDayOfWeek – Defines the starting day of the week.
Important Methods of Date Picker
1. getYear() – Returns the selected year.
2. getMonth() – Returns the selected month (0-based index).
3. getDayOfMonth() – Returns the selected day.
4. setMinDate(long date) – Sets the minimum date selection.
5. setMaxDate(long date) – Sets the maximum date selection.
6. getFirstDayOfWeek() – Returns the first day of the week in the current locale.
A TimePicker in Android is a UI component that allows users to select a specific time, including hours and minutes. It
supports two modes: Clock Mode (default) and Spinner Mode. The picker can be set to use either a 12-hour or 24-hour
format using the android:is24HourView attribute.
The Android security model is designed to provide a safe and secure environment for mobile applications users by
leveraging a combination of sandboxing, permissions, and application signing.
Steps to deploy and Android Application on Google Play Store:
Step 1: Make a Developer Account
Step 2: Plan to Sell? Link Your Merchant Account
Step 3: Create an App
Step 4: Prepare Store Listing
Step 5: Upload APK to an App Release
Step 6: Provide an Appropriate Content Rating
Step 7: Set Up Pricing & Distribution
Step 8: Rollout Release to Publish Your App
Permissions: Permissions controls the access to sensitive user data and system features. They protect user privacy and
prevent apps from interfering with other apps or the system. Permissions are categorized into different protection levels
based on their potential impact on user privacy and system security:
i) Normal Permission
ii) Dangerous Permission
iii) Signature Permission
Geocoding is the process of converting a location name or address into latitude and longitude coordinates. It helps in
finding the geographical coordinates of places and is commonly used in map-based applications. In Android, Geocoder is
a built-in class that provides geocoding functionalities using the device's internet connection or offline data.
Reverse Geocoding is the process of converting latitude and longitude into a human-readable address (e.g., street
name, city, country). In Android, Geocoder is a built-in class that provides geocoding functionalities using the device's
internet connection or offline data.
Creating API keys
The API key is a unique identifier that authenticates requests associated with your project for usage and billing purposes.
You must have at least one API key associated with your project.
1. Browse the site on your browser. [Link] [Link]/project
2. Login with your google account.
3. Create a new project by clicking on Create Project option.
4. Add your project name and organization name in the fields present on the screen.
5. Now click on APIs and Services.
6. Enable APIs and services.
7. Select Google maps Android API
8. To create an API key for Maps click on Create credentials option and then select the API key option
Click on the API key option to generate your API key. After clicking on this option your API key will be generated.
List different methods which we can use with location object to get the specific location.
1. getLatitude() – Returns the latitude in degrees.
2. getLongitude() – Returns the longitude in degrees.
3. getAltitude() – Returns the altitude in meters.
4. getSpeed() – Returns the speed in meters/second.
5. getAccuracy() – Returns the accuracy in meters.
6. hasSpeed() – Returns true if speed is available.
List different types of goggle map.
1. MAP_TYPE_NORMAL
2. MAP_TYPE_SATELLITE
3. MAP_TYPE_TERRAIN
4. MAP_TYPE_HYBRID
5. MAP_TYPE_NONE
List different methods of goggle map.
1. setMapType(int type)
This method sets the style of the map such as normal, satellite, or terrain. It helps in displaying the map based on your
app's need. You can choose from several predefined map types.
Example:
[Link](GoogleMap.MAP_TYPE_SATELLITE);
2. addMarker(MarkerOptions options)
This method adds a marker to the map at a specific latitude and longitude. Markers help show places like cities, stores,
or user clicks. You can also add a title to the marker.
Example:
[Link](new MarkerOptions().position(new LatLng(19.0760, 72.8777)).title("Mumbai"));
3. moveCamera(CameraUpdate update)
This method moves the camera to a new position on the map instantly. It is used when you want to show a certain
location. No animation is applied.
Example:
[Link]([Link](new LatLng(28.6139, 77.2090), 10));
4. animateCamera(CameraUpdate update)
This method moves the camera to a new location with animation. It gives a smooth zoom or scroll effect.
Example:
[Link]([Link](new LatLng(12.9716, 77.5946), 12));
6. clear()
Removes all markers, lines, and shapes from the map. It resets the map to an empty view.
Example:
[Link]();
Explain important methods of zoom control.
1. hide()
This method hides a ZoomControls widget from the screen. It is useful when you want to remove zoom controls
manually.
Example:
[Link]();
2. show()
This method shows the ZoomControls widget on the screen. It is used when you want to display zoom buttons.
Example:
[Link]();
3. setOnZoomInClickListener([Link] listener)
This is method is called when the Zoom In button is clicked. Here you define what happens when zoom in is pressed.
Example:
[Link](new [Link]() {
@Override
public void onClick(View v) {
[Link]([Link]());
}
});
4. setOnZoomOutClickListener([Link] listener)
This is method is called when the Zoom Out button is clicked. Here you define what happens when zoom out is pressed.
Example:
[Link](new [Link]() {
@Override
public void onClick(View v) {
[Link]([Link]());
}
});
Intent is a messaging object that we can use to request an action from an app component. Intent is basically an
intention to do an action. There are three fundamental uses of intents: To Start an Activity, To Start a Service and To
Deliver a Broadcast.
When we explicitly define which Android component should be opened on some user action, then we use explicit
intents.
When we just have to tell what action we want to perform without worrying which component will perform it, then we
can use implicit intent.
Intent_filters is a very powerful way to connect different applications together. Intent filter are declared in the
[Link]. An intent filters is an instance of the Intent_Filter class.
Activity is one of the building blocks of Android OS. In simple words, Activity is a screen that user interact with. Every
Activity in android has lifecycle which consists of different states that define how an activity behaves from creation to
destruction. These different states are known as Activity Lifecycle.
1. onCreate() – This method runs when the activity starts for the first time.
2. onStart() – This method runs when the activity becomes visible to the user.
3. onResume() – This method runs when the activity is fully visible and the user can interact with it.
4. onPause() – This method runs when the activity is partially hidden.
5. onStop() – This method runs when the activity is no longer visible on the screen.
6. onRestart() – This method runs when an activity is coming back from the stopped state.
7. onDestroy() – This method runs just before the activity is completely removed from memory.
In Android, Content Providers are a very important component that serves the purpose of a relational database to store
the data of applications. Content Providers support the four basic operations, normally called CRUD-operations. CRUD is
the acronym for Create, Read, Update and Delete.
Fragment is the part of activity, it is also known as sub-activity. There can be more than one fragment in an activity.
Fragments represent multiple screens inside one activity. We can create Fragments by extending Fragment class or by
inserting a Fragment into our Activity layout by declaring the Fragment in the activity’s layout file, as an element.
A service is an application component which runs without direct interaction with the user in the background. Services
are used for repetitive and long running operations. Service can either be started or bound we just need to call either
startService() or bindService() from any of our android components.
In mobile application development, a sensor is a hardware component within a device that detects and measures
various physical phenomena like motion, orientation, location, and environmental conditions.
Animation in Android is used to create movement and visual effects to make apps more interactive. There are different
types of animations like View Animation, Property Animation, and Drawable Animation. View Animation changes the
appearance of a view without affecting its real position. Property Animation modifies actual object properties like size,
position, or color. Drawable Animation plays a sequence of images to create an animation effect.
Text to Speech converts the text written on the screen to speech like you have written “Hello World” on the screen and
when you press the button it will speak “Hello World”.