Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

Mobile Programming Android Studio Activity APK

MOBILE PROGRAMMING 1
(SESSION 2)
Nova Agustina, M.Kom.

Tools :
LECTURE
CONTRACT

PRESENSI
UTS UAS ASSIGNMENT QUIZ UTS
PRESENSIES

20% 25% 30% 10% ?%


15%
1 0 0
PURPOSE Able to understand Activity on
Android

Know the project structure in


Android Studio

Implementation: First Running


Project in Android Studio & Build
APK
Activity
TASK ON ANDROID

An application usually contains several


activities.

Each activity must be designed with a specific


type of action that the user can perform and can
start other activities. For example, an email app
might have one activity to display a list of new
messages. When a user selects a message, a new
activity opens to view the message.
TASK ON ANDROID
Activity can even start an activity
that is in other applications on the
device.
Examples??
TASK ON ANDROID

Although it may be an activity from a different app, Android will still


maintain a seamless user experience by running both activities in the
same task.

A task is a collection of activities that a user interacts with while


performing a specific task. The activities are arranged in a back-stack,
in the order in which each activity opens.
TASK ON ANDROID

Your device's Home screen is where almost any task is started. When
the user taps an icon in the app launcher (or a shortcut on the Home
screen), that app's task appears in the foreground.

If there is no task for the app (the app hasn't been used recently), then
a new task will be created and the "main" activity for that app will
open as the root activity in the stack.
TASK ON ANDROID
WHEN DOES THE TASK END?

If the user keeps pressing Back, then every activity in


the stack will be ejected to show the previous one,
until the user returns to the Home screen (or
whichever activity was running when the task started.
When all activities have been removed from the stack,
the task will no longer exist).
WHEN DOES THE TASK END?

task is a cohesive unit that can be moved to the


"background" when the user starts a new task or goes
to the Home screen, via the Home button. While in the
background, all activities in the task are stopped, but
the back-stack for the task does not change. A task
loses focus during another task, as shown in the
image.
WHEN DOES THE TASK END?
WHEN DOES THE TASK END?
Then, the task can return to the "foreground" so that the user can continue the task
where it stopped it.
Task A has 3 activities User presses Home If the new application
Run a new screen appears, task A will
(2 at the moment) button application switch to the background

When a new application starts, the system will start a task for that application (task B)
with its own activity stack. After interacting with the app, the user returns to Home
again and selects the app that originally started task A. Now, task A appears in the
foreground—all three activities in the stack don't change and activities on top of the
stack resume. At this point the user can also switch back to task B by going to Home
and selecting the icon of the application that started the task (or by selecting the
application task from the summary screen). This is an example of multitasking on
SUMMARY

1. When activity A starts activity B, activity A is


stopped, but the system retains its state (such as
scroll position and text entered into the form). If
the user presses the Back button while in
activity B, activity A resumes with the restored
state.
SUMMARY

2. When the user leaves the task by pressing the Home


button, the current activity will be stopped and the
task switches to the background. The system will
maintain the state of each activity in the task. If the
user later continues the task by selecting the launcher
icon that starts the task, the task will switch to the
foreground and continue the activity on the stack.
SUMMARY

3. If the user presses the Back button, the


current activity will be removed from the stack
and destroyed. The previous activity in the stack
will continue. When an activity is destroyed, the
system will not maintain the activity state.
Gradle
Gradle

Gradle is a program that functions to build


automatically. Because of this, Gradle is often referred
to as a build-tool.

Build here can be interpreted as an activity to compile


and packaging.
Gradle

Android apps are built using the Gradle Build


system with open source code. Every time we
rebuild, or deploy our app to an emulator or
device, Android Studio builds our source code
based on the configuration in the Gradle file.
Gradle

Once you've created your new project, you'll create three main
Gradle files that you can see in the left pane of Android
Studio.
Gradle Setting

A project is a collection of sub-projects configured in


Gradle. A list of sub-projects can be seen in the
settings.gradle file.

The include syntax indicates that the app folder is the only
sub-project listed here, if we want to add a library to the
project we must also add it to this settings.gradle file.
RUNNIN
G
PROJEC
T
CREATE PROJECT
CREATE PROJECT

1
2
3
4
5
CREATE PROJECT

Name  Name of Project


Package Name  is used for unique identification for the application
Save Location  Project repository
Language  Programming Language To Create Project (Java / Kotlin)
1. Minimum SDK  Project can run on Minimum SDK
specified
RUNNING PROJECT
APK

An Android application package


file is a file format used to
distribute and install software and
middleware to phones with the
Android operating system, similar
to MSI packages on Windows or
Deb on Debian OS.
APK

On Android Studio Project, apk can be found at


yourProjectLocation\ProjectName\app\build\intermediates\apk\
debug/app-debug.apk

Noted : APK will appear when your Project Android is already


Successful Running.
NEXT

SESSION 3:
VIEW, LAYOUT, AND
RESOURCES

You might also like