CS436 - Mobile Application Development: Dr. Usman Khan Durrani
CS436 - Mobile Application Development: Dr. Usman Khan Durrani
CS436 - Mobile Application Development: Dr. Usman Khan Durrani
Application
Development
DR. USMAN KHAN DURRANI
PHD. RMIT UNIVERSITY – MELBOURNE AUSTRALIA
3
Project Structure in AS
Each project in Android Studio contains one
or more modules with source code files and
resource files.
4
Project Structure in AS
All the build files are visible at the
top level under Gradle Scripts and
each app module contains the
following folders:
1. manifests: Contains
the AndroidManifest.xml file.
2. java: Contains the Java source code
files, including JUnit test code.
3. res: Contains all non-code
resources, such as XML layouts, UI
strings, and bitmap images.
5
AS User Interface
6
Tutorial 0 Example
7
Developer workflow basics
To efficiently build a well-designed app for
Android, you need some specialized tools:
8
Developer workflow basics
continued
9
Developer workflow basics
continued
10
Developer workflow basics
continued
11
Projects overview
Project
12
Project
14
Project
1. Android Library
2. Java Library
15
Project
16
Week 2b: Build
and run
application
Build and run your app
Android Studio sets up new projects to deploy
to the Android Emulator or a connected device
with just a few clicks.
18
Run apps on the Android
Emulator
The Android Emulator simulates Android devices on
your computer so that you can test your application on
a variety of devices and Android API levels without
needing to have each physical device.
19
Run apps on the Android
Emulator
The Android Emulator has additional
requirements beyond the basic system
requirements for Android Studio, which are
described below:
SDK Tools 26.1.1 or higher
64-bit processor
Windows: CPU with UG (unrestricted guest) support
HAXM 6.2.1 or later (HAXM 7.2.0 or later recommended)
20
Run apps on a hardware
device
When building an Android app, it's
important that you always test your
app on a real device before releasing it
to users.
1. Set up a device for development
2. Install OEM USB drivers
3. Connect to your device using USB
4. Get the Google USB Driver
21
Week 2c:
Configure your
build
Configure your build
1. The Android build system compiles app resources and
source code, and packages them into APKs or Android App
Bundles that you can test, deploy, sign, and distribute.
3. Each build configuration can define its own set of code and
resources, while reusing the parts common to all versions
of your app.
23
Configure your build -
Continued
4. Gradle and the Android plugin run independent of
Android Studio.
5. This means that you can build your Android apps
from within Android Studio, the command line on
your machine, or on machines where Android Studio
is not installed (such as continuous integration
servers).
24
The build process
25
Debug your app
Android Studio provides a debugger that
allows you to do the following and more:
26
Debug your app
DEBUG
27
Week 2c: Testing
Android application
Testing Android application
1. Android Studio is designed to make testing
simple.
2. With just a few clicks, you can set up a JUnit test
that runs on the local JVM or an instrumented
test that runs on a device.
3. We can also extend your test capabilities by
integrating test frameworks such as Mockito to
test Android API calls in your local unit tests, and
Espresso or UI Automator to exercise user
interaction in your instrumented tests.
29
Types of Tests in Android
Local tests: Unit tests that run on your local machine
only. These tests are compiled to run locally on the
Java Virtual Machine (JVM) to minimize execution
time
Instrumented tests: Unit tests that run on an Android
device or emulator. These tests have access to
instrumentation information, such as the Context for
the app under test
UI tests: This type of test verifies that the target app
behaves as expected when a user performs a specific
action or enters a specific input in its activities.
30
Week 2d: Profiling
Android application
Profile app performance
1. An app is considered to have poor performance if it
responds slowly, shows choppy animations, freezes, or
consumes too much power.
33
Week 2e:
Publishing Android
application
Publish your app
Publishing is the general process that makes your Android
applications available to users. When you publish an
Android application you perform two main tasks:
35
Preparing your app for
release
1. Configuring your application for release
2. Building and signing a release version of
your application
3. Testing the release version of your
application
4. Updating application resources for release
5. Preparing remote servers and services that
your application depends on
36
Releasing your app to users
You can release your Android
applications several ways.
1. Release applications through an
application marketplace such as Google
Play
2. Release applications on your own
website
3. Sending an application directly to a user
37
Questions
EMAIL:
[email protected]
K
38