M'HAMED BOUGARA University
Faculty of Sciences, Computer Science department
Mobile application development
Introduction
Carried out by Mr. BITIT Rahmoune
1 UMBB/FS/DEP-INFO 29/10/2023
Module content
Mobile operating systems (iOS, WindowsPhone, Android)
Overview of the Android platform
The development environment
Structure and components of mobile applications
Building the user interface
Use of resources: XML, images, files, etc.
Mobile programming (JSON, SQLite, etc.)
Deploying a mobile application
2 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
References
Android 5 Programming by Example, Kyle Mew; Packt Publishing 2015.
M. Dalmau, "Développement d'applications pour Android"
Pierre Nerzic, "Programmation mobile avec Android"
Jean-FrancoisLalande, "Développement Android«
https://developer.android.com/develop/index.html
https://www.tutorialspoint.com/android/
https://www.javatpoint.com/android-tutorial
http://www.tutos-android.com/
https://android-developers.googleblog.com/
http://www.tutos-android.com/
….
3 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Mobile operating systems
4 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Introduction
Mobile technologies (mobile phones and tablets) have become essential
tools in daily life.
Smartphones/tablets are considered as small computers (they can
replace the laptop in different situations)
They are becoming more and more popular due to the different mobile
operating systems which continue to develop, such as: Android, iOS and
Windows Phone.
Mobile applications have become an essential way to create new
services for mobile users.
5 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Smartphones ?
That is to say “smart phones”.
Are generally touchscreen, although some models still offer a
keyboard (certain BlackBerry models for example).
In addition to calling and sending messages, smartphones allow
you to do many other things using applications: access the
Internet, read and send emails, listen to music, watch films, play
games, take photos and videos ......
Adding applications allows you to personalize the device as
needed
6 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Smartphone, Phablette, Tablette ?
7 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
What is a mobile OS?
A mobile phone has a platform that controls all of its features.
This is known as a mobile Operating System (OS).
Commonly known as mobile OS, it is an operating system that
runs a mobile device.
It controls all the basic operations of the mobile device like touch
screen option, Bluetooth,Wifi, camera...
Example: iOS, Windows Phone, Android, BlackBerryOS,
Symbian, ….
8 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Mobile OS
Android de Google iOS d’Apple Windows Phone de
Microsoft
• Developed in 2007.
• Windows Phone
• It became an open • Derived from Mac OS appeared in 2010.
platform in 2008
• Developed in 2007 • Successor to
• Free and open OS. Windows Mobile.
• Used in Apple devices.
• Major manufacturers • It doesn't find much
use Android in their place on the market.
devices.
9 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Mobile OS
Android, iOS and MS phone applications are programmed in
different programming languages.
Kotlin
swift
10 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Global market share of Mobile OS
11 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Global market share of Mobile OS
12 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Types of mobile applications
13 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Types of mobile applications
Native application
It is custom-developed using a native language (e.g. Java for
Android) and must be adapted to each operating system.
A different version for each type of phone.
It functions optimally.
Web application
Designed with HTML and CSS.
Created to be consulted from a smartphone’s internet browser
Accessible from any mobile device.
Offers less functionality and performance.
14 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Types of mobile applications
Hybride application
It is a mobile application that merges the characteristics of
the web application (development in HTML) and those of the
native application.
It is multiplatform.
Compared to native applications, hybrid applications are
cheaper and quicker to develop but offer less performance.
15 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Types of mobile applications
16 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Presentation of the Android platform
17 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Introduction
2004: Android emerged from the work of a startup
2005:The Android startup bought by Google
2007: Creation of the OHA (Open Handset Alliance)
• It is a consortium created by Google bringing together actors in the mobile
technology market (manufacturers, operators, software publishers).
• The goal is to develop standards for mobile devices
11-2007: Official announcement of the Android platform and release of the 1st SDK
18 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Introduction
• Android was first designed for smartphones and touchscreen tablets,
then diversified into connected objects such as televisions (Android TV),
cars (Android Auto), computers (Android-x86) and smartwatches
(AndroidWear).
• The Android platform offers:
• A complete development environment
• Dalvik virtual machine
• Integrated browser
• 2D and 3D graphics
• SQLite Database
• Audio and video CODEC (MPEG4, MP3, AAC, PNG, etc.)
• Hardware options: GSM telephony, camera, GPS, Wifi, Bluetooth,
etc.
19 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Android versions
● Google publishes version usage distribution
● Information collected via Google Play
– link : http://developer.android.com/about/dashboards/index.html
● Here on 16/04/2019
20 UMBB/FS/DEP-INFO 2019-2020 29/10/2023
Android platform architecture
21 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Android platform architecture
Applications
• Android comes with a set of basic programs (called native
applications) allowing access to features such as: emails, SMS,
calendar, photos, theWeb…
• These applications are developed using the Java programming
language
• For the end user, it is the only accessible and visible layer
22 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Android platform architecture
Application Framework
• Offers developers the ability to create extremely rich and
innovative applications
• Developers are free to take advantage of hardware, location
information, background services, set alarms, add notifications,...
23 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Android platform architecture
Libraries
• A set of libraries used by many components of the Android platform.
• Accessible to the developer via the Android framework.
• Examples:
Skia: 2D graphics library
OpenGL: 3D graphics library
SQLit: Application data storage
WebKit: Web navigation engine (used in the browser)
24 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Android platform architecture
Android Runtime
• Dalvik VM:
• Provides a virtual machine adapted to the limitations of mobile devices.
• Dalvik allows multiple applications to run simultaneously.
• It executes bytecode dedicated to it (the .dex bytecode)
• From Android version 5, Dalvik was replaced by ART (Android Run Time)
25 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Android platform architecture
Linux Kernel
• Android is based on a Linux kernel which manages
• System services, memory, processes, drivers,...
• Hardware, sensors (camera, GPS, wifi, etc.)
• It acts as an abstraction layer between hardware and software
26 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Development environment for Android
(Android Studio, SDK Android, AVD Manager)
27 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Android Studio
• The official IDE for Android
• It provides the tools to create apps on every type of Android device.
• Available for free at the link:
• https://developer.android.com/studio/index.html
Development language : Java, Kotline, XML
• Some JDK classes are not available (e.g. Swing)
Required configuration
• Microsoft Windows 8/10/11(64 bits) / Ubuntu 12.04 64 bits / Max OsX
• 4 Go de RAM minimum, 8 Go de RAM recommended;
• 4 GB recommended disk space (500 MB for IDE + 1.5 GB for Android
SDK and emulation system image)
• For an accelerated emulator: 64-bit operating system
• Java Development Kit (JDK)
28 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Software Development Kit (SDK) :
Is a set of software tools intended for developers,
facilitating the development of software on the Android
platform.
Android SDK provides::
• Java libraries for Android
• Images of the Android system
• An emulator for testing applications
Android Virtual Device (AVD) :
Allows you to launch and run the application on
a virtual device that emulates the behavior of an
Android device.
29 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Software Development Kit (SDK) :
30 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
IDE installation :
1. Download and install the 64-bit JDK (Java Development Kit)
(Uninstall any previous versions of the JDK)
2. Download Android Studio. It contains the development environment,
the Android SDK and an emulator.
https://developer.android.com/studio/index.html
3. Run the executable to start the installation and follow the wizard
Remark :
• On first launch, the IDE automatically downloads tools necessary
for creating and compiling an Android project (SDK and Gradle)
31 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
First Android Studio project
Creating a new project : File/New/New Project
32 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Choice of Android version
33 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Result of the project creation wizard
34 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Structure of an Android project
manifests : application description
java : sources, ordered by package
ressources XML files and images of the interface
Drawable: images, icons used in the interface
layout: graphical interfaces
mipmap: icons used in the interface
values : configuration values, texts...
Gradle scripts : This is the project compilation tool
35 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Java source code
The setContentView method loads an interface on the screen.
36 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
AndroidManifest.xml file
37 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
AndroidManifest.xml file
<manifest> The root of the file
The namespace android
Application package declaration
android:versionCode : an integer (positive) that indicates the current version
of the application.
Not shown to the user, but considered by the Play Store.
If we put an application with a version code higher than that of the old one, then
the Play Store considers that the application has been updated.
android:versionName : can be a string and will be shown to the user.
Example android:versionName="First alpha version - 0.01a"
38 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
AndroidManifest.xml file
The version of Android (API 15) or higher to use this application (this
application will only be offered on Google Play if a user is using this version
of Android or higher).
The SDK version on which the application was designed and tested
.i.e. from this version we will be able to fully exploit the application
Android version or lower to use this application
39 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
AndroidManifest.xml file
It describes the attributes and components of the application.
By default, the application has only one component, the main activity.
Setting the application icon, name, and theme
Declaration of activities
Indicates that the activity is the
entry point to the application
40 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Running the app on a real device
connected by USB
1. Enable Developer Mode on Android Device
1) Go to settings.
2) Go to About device.
3) Tap the “Build number” box seven (07) times, a message will appear
“You are now a developer”
4) In the settings menu, we will see a new submenu “Developer
options”
41 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Running the app on a real device
connected by USB
42 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Running the application on a virtual device
Creating a virtual device
43 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Running the application on a virtual device
Creating a virtual device
3- Choose a virtual device
44 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Running the application on a virtual device
Creating a virtual device
4- Choose the Android OS version
45 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Running the application on a virtual device
Virtual device name
Advanced settings
46 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Running the application on a virtual device
Creating a virtual device
Advanced settings
47 UMBB/FS/DEP-INFO 2020-2021 29/10/2023
Running the application
2. Select a real or virtual
Android device
48 UMBB/FS/DEP-INFO 2020-2021 29/10/2023