Prerequisites
Topics to knowbeforehand
01 Java Programming
02 HTML or XML
03 Basic Computer Logic
04 Basic Internet Surfing
Knowledge
A basic knowledge about Java programming
is preferred to easily understand Android
Programming. Ideas like classes and
functions must be known to some extend.
Logic and programming concepts like
conditions, loops are very important as
they provide the building block of any
Android application.
Use of tags and their basic structure is
helpful when learning XML for the first
time.
We usually tackle our problems by surfing
the internet. So all you need to know is to
know how to search according to our
needs.
3.
Our Goal
Topics thatwe intend to cover.
01 Basic Android App Development
02 Android apps with PHP
03 Android apps with MySQL
04 Android apps using libraries and
API
We will start by learning how to create
simple Android applications. Stand alone
applications that can be created easily with
the help of Java and XML.
We will learn how to use libraries such as
Volley to communicate with any database
that is stored on the server. This will be
done using PHP as a middle man and JSON.
Next, we will look at Android application
development where you can communicate
with a PHP script running on a server.
There are many libraries and APIs that we
can use in or with Android that we will
explore in the last section.
4.
OPERATING SYSTEMS
AN OPERATINGSYSTEM (OS) IS THE PROGRAM THAT, AFTER BEING INITIALLY LOADED INTO THE
COMPUTER BY A BOOT PROGRAM, MANAGES ALL OF THE OTHER APPLICATION PROGRAMS IN A
COMPUTER.
THEY CAN BE CATEGORISED AS FOLLOWS:
1. FREE AND OPEN SOURCE
2. PROPRIETARY
OR
1. COMPUTER OPERATING SYSTEMS
2. MOBILE OPERATING SYSTEMS
5.
About
Android
• Android isan Open Source Mobile operating
system with a modified Linux Kernel.
• Android apps can be created using many
methods like:
a. Using Java and XML
b. Using Kotlin and XML
c. Using Flutter or React Native
d. Using MIT App Inventor and
Thunkable.
6.
About
Android
• In 2005Google purchased Android. Google
made Android OS open and free. So, most of
the Android code was released under the open
source Apache License.
• Android offers a unified approach to application
development. Developers needed to develop
only for Android and their applications will run
on different devices that are powered using
Android.
7.
About
Android
• The developmentof Android started in 2003 by
Android, Inc., and there were at least two
internal releases of the software inside Google
and the Open Handset Alliance (OHA) before
the beta version was released.
• The beta was released on November 5, 2007,
while the software development kit (SDK) was
released on November 12, 2007. Several public
beta versions of the SDK were released.
8.
The Android versionswere initially given names of sweets
but nowadays they have dropped that pattern and release
each version with a new version number instead.
Let's learn more here:
https://en.m.wikipedia.org/wiki/Android_version_history
Version History
Android Version History
9.
Android Studio IDE
AnIDE or Integrated Development
Environment is a software that
provides users with multiple facilities
for software development.
We will be using Android Studio, an IDE
developed by Google for Android
Development. Other IDEs usually used
for Android Application Development
include Eclipse, VS Code and so on...
10.
Eclipse IDE
Eclipse isan IDE that is popular for Java
development and even other
programming languages.
Previously Android development was
done on Eclipse as well but is no longer
supported or encouraged.
11.
App Development
We willbe using Java and XML to design and create Android
Apps in this tutorial.
1. Java is used to provide program logic to our Android
application.
2. XML provides the User Interface or Layouts of our
Android application.
Going forward, we will be using PHP and SQL to create and
establish connections with a database. Finally we will also
try to use certain APIs to create Android applications.
12.
Android SDK
• TheAndroid SDK is a software development kit that
includes a comprehensive set of development tools.
• These include a debugger, libraries, a handset emulator
based on QEMU, documentation, sample code, and
tutorials. Currently supported development platforms
include computers running Linux (any modern desktop
Linux distribution), Mac OS X 10.5.8 or later, and
Windows 7 or later.
• As of March 2015, the SDK is not available on Android
itself, but software development is possible by using
specialized Android applications.
14.
• Linux Kernel:It is the heart of android architecture that exists at the root of android
architecture. Linux kernel is responsible for device drivers, power management, memory
management, device management and resource access.
• Native Libraries: On the top of linux kernel, their are Native libraries such as WebKit, OpenGL,
FreeType, SQLite, Media, C runtime library (libc) etc. The WebKit library is responsible for
browser support, SQLite is for database, FreeType for font support, Media for playing and
recording audio and video formats.
• Android Runtime: In android runtime, there are core libraries and DVM (Dalvik Virtual
Machine) which is responsible to run android application. DVM is like JVM but it is optimized
for mobile devices. It consumes less memory and provides fast performance.
• Android Framework: On the top of Native libraries and android runtime, there is android
framework. Android framework includes Android API's such as UI (User Interface), telephony,
resources, locations, Content Providers (data) and package managers. It provides a lot of
classes and interfaces for android application development.
• Applications: On the top of android framework, there are applications. All applications such as
home, contact, settings, games, browsers are using android framework that uses android
runtime and libraries. Android runtime and native libraries are using linux kernal.
15.
Android AVD
• AnAndroid Virtual Device (AVD) is a device configuration
that runs on the Android Emulator.
• It provides virtual device-specific Android Environment
in which we can install & test our Android Application.
• AVD Manager is a part of SDK Manager to create and
manage the virtual devices created.
16.
Android App Structure
•AndroidManifest.xml: Every project in Android includes a manifest file, which is AndroidManifest.xml, stored in the
root directory of its project hierarchy. The manifest file is an important part of our app because it defines the
structure and metadata of our application, its components, and its requirements. This file includes nodes for each
of the Activities, Services, Content Providers and Broadcast Receiver that make the application and using Intent
Filters and Permissions, determines how they co-ordinate with each other and other applications.
• Java: The Java folder contains the Java source code files. These files are used as a controller for controlled UI
(Layout file). It gets the data from the Layout file and after processing that data output will be shown in the UI
layout. It works on the backend of an Android application.
• drawable: A Drawable folder contains resource type file (something that can be drawn). Drawables may take a
variety of file like Bitmap (PNG, JPEG), Nine Patch, Vector (XML), Shape, Layers, States, Levels, and Scale.
• layout: A layout defines the visual structure for a user interface, such as the UI for an Android application. This
folder stores Layout files that are written in XML language. You can add additional layout objects or widgets as
child elements to gradually build a View hierarchy that defines your layout file.
17.
Android App Structure
•mipmap: Mipmap folder contains the Image Asset file that can be used in Android Studio application. You can
generate the following icon types like Launcher icons, Action bar and tab icons, and Notification icons.
• colors.xml: colors.xml file contains color resources of the Android application. Different color values are identified
by a unique name that can be used in the Android application program.
• strings.xml: The strings.xml file contains string resources of the Android application. The different string value is
identified by a unique name that can be used in the Android application program. This file also stores string array
by using XML language.
• styles.xml: The styles.xml file contains resources of the theme style in the Android application. This file is written in
XML language.
• build.gradle(Module: app): This defines the module-specific build configurations. Here you can add dependencies
what you need in your Android application.
18.
Android App Structure
•mipmap: Mipmap folder contains the Image Asset file that can be used in Android Studio application. You can
generate the following icon types like Launcher icons, Action bar and tab icons, and Notification icons.
• colors.xml: colors.xml file contains color resources of the Android application. Different color values are identified
by a unique name that can be used in the Android application program.
• strings.xml: The strings.xml file contains string resources of the Android application. The different string value is
identified by a unique name that can be used in the Android application program. This file also stores string array
by using XML language.
• styles.xml: The styles.xml file contains resources of the theme style in the Android application. This file is written in
XML language.
• build.gradle(Module: app): This defines the module-specific build configurations. Here you can add dependencies
what you need in your Android application.
Android App ActivityLifecycle
• Android Activity Lifecycle is controlled by 7 methods of android.app.Activity class. The
android Activity is the subclass of ContextThemeWrapper class. An activity is the single
screen in android. It is like window or frame of Java. By the help of activity, you can
place all your UI components or widgets in a single screen.
• onCreate(): called when activity is first created.
• onStart(): called when activity is becoming visible to the user.
• onResume(): called when activity will start interacting with the user.
• onPause(): called when activity is not visible to the user.
• onStop(): called when activity is no longer visible to the user.
• onRestart(): called after your activity is stopped, prior to start.
• onDestroy(): called before the activity is destroyed.