Android Application Development: - Pallabi Saha
Android Application Development: - Pallabi Saha
APPLICATION
DEVELOPMENT
-PALLABI SAHA
INTRODUCTION TO MOBILE APPS
Need of Mobile Apps
Easily
available in
Usually
Google Play
developed in
Store,
Java with the
Amazon App
Android SDK
Store and
support
different
other store
Features
Beautiful UI
Resizable
Connectivity
widgets
Multi
language Storage
support
Media
Multi tasking
Support
Web
Messaging
browser
Android API versions
Name Version number(s) Initial release date API level
1.0 September 23, 2008 1
No codename
1.1 February 9, 2009 2
Cupcake 1.5 April 27, 2009 3
Donut 1.6 September 15, 2009 4
Eclair 2.0 – 2.1 October 26, 2009 5–7
Froyo 2.2 – 2.2.3 May 20, 2010 8
Gingerbread 2.3 – 2.3.7 December 6, 2010 9 – 10
Honeycomb 3.0 – 3.2.6 February 22, 2011 11 – 13
Ice Cream Sandwich 4.0 – 4.0.4 October 18, 2011 14 – 15
Jelly Bean 4.1 – 4.3.1 July 9, 2012 16 – 18
KitKat 4.4 – 4.4.4 October 31, 2013 19 – 20
Lollipop 5.0 – 5.1.1 November 12, 2014 21 – 22
Marshmallow 6.0 – 6.0.1 October 5, 2015 23
Nougat 7.0 – 7.1.2 August 22, 2016 24 – 25
Oreo 8.0 – 8.1 August 21, 2017 26 – 27
Pie 9 August 6, 2018 28
Q (Android 10) 10 September 3, 2019 29
R (Android 11) 11 September 8, 2020 30
Android 12 12 October 4, 2021 31
ANDROID ARCHITECTURE
INSTALLATION OF ANDROID
Development Requirements
JDK 8 or above
Android SDK
Android Studio
Step -1 Setup java
► Install and set variable path
► To set the path, follow the process
► Right click on the My computer/ PC icon, select Advance system setting
Step 2-
https://developer.android.com/studio/
CREATING FIRST ANDROID APP
Start a new Project
(cont.)
► Thus after completion of all the steps, project environment setup starts and finally it
launches
► A java file and a xml file opens
► Xml file for designing purpose
► Java file for describing the data i.e. coding purpose
File Structure
Configuration
file
Package for Java
file
Layout file
File containing
color
File containing Strings
•Activity
•Entry point for user interaction
•Represents single screen with a UI
•Service
•Entry point for keeping the app running in the background
•Broadcast Receiver
•Enables inflow and outflow of events
•Content Provider
•Manages a share set of data that can be stored in any storage (database, file
system, web, etc.)
•Helps in retrieving and modifying the data
Other Components
•Layouts
•Fragments
•Intent
•Views
•…
Layouts
•Constraint Layouts
•Layout within which each views are connected with either each other or with
the parent view (viewgroup)
•Relative Layouts
•Layout within which the views are arranged with respect to their relative
position
•Linear Layouts
•Layouts in which the view are arranged linearly, i.e. either horizontally(by
default) or vertically
BUILDING UI WITH ACTIVITIES
Activity Life Cycle
NOTIFICATIONS
Toast
► A small window that prompts the user to make a decision or enter additional
information
► A dialog can be a general dialog, an AlertDialog also
► For AlertDialog the syntax,
AlertDialog.Builder alert = new AlertDialog.Builder(this);
► Thus to include an alert dialog in an activity, we have to pass “this” as context
Status Bar Notifications
► A message that Android displays outside any app's UI to provide the user with
reminders, communication from other people, or other timely information
from your app
STYLES AND THEME
Color
► To change the existing color, change the color code in the color.xml file
► For example,
<color name=“colorPrimary”>#AD1457</color>
<color name=“colorPrimaryDark”>#78002e</color>
► To add new color to the app, color.xml file needs to be modified using the
<color> element
► For example,
<color name=“textColor”>#FFFFFF</color>
Theme
► To modify the existing theme of the app, change the theme of the app by
changing the <theme> in style.xml file
► To add new theme to the app, add new <theme> element in style.xml file
► Accordingly update the manifest file to apply the theme in specific activity
RESOURCES AND ASSET
Drawable Resources
► User-choice image
► Copy the image and paste into the drawable folder
Accessing drawable image in ImageView
► XML ► JAVA
► A messaging object that can be used to request an action from another app
component.
► For starting an activity
► Intent object is passed to startActivity()
► For starting a service
► Intent object is passed to startService()
► Intent is of 2 types
► Implicit
► Explicit
Intent-filter
► For example,
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Here, it stated that the particular activity will act as main or starting point of the app
and it will be only be launched as soon as app icon is clicked
DATA STORAGE
SQLiteDatabase
► Now this intent can be used to set the captured image in an ImageView as
follows:
ImageView iView;
Bitmap pic = (Bitmap) data.getExtras().get(“data”);
iView.setImageBitmap(pic);
GoogleMap
(cont.)
► Java File
► Contains the java code for the map