Lecture no 02 (Installation of IDE + Make First Android App)

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

Mobile Application

Development
Lecture no 2: (Installation of IDE + Make First Android App)
Step 1: Install Java
• Android Studio is a Java development environment, so you need to
make sure the right version of Java is installed on your machine.

• First, check the Android Studio system requirements to see which


versions of the Java Development Kit (JDK) and Java Runtime Edition
(JRE) you need.

2
Install Android Studio
• Once you have Java up and running, you can download Android
Studio from here: https://developer.android.com/studio
• This page also includes installation instructions. Follow the
instructions to install Android Studio on your computer. Once you’ve
installed Android Studio, open it and follow the instructions to add
the latest SDK tools and support libraries.

3
Install Android Studio (Cont.)
• Android Studio is the official integrated development environment
(IDE) for Google's Android operating system, built on JetBrains' IntelliJ
IDEA software and designed specifically for Android development.

4
See more at: https://developer.android.com/studio
5
6
Let’s
build the
basic
app
Click on “New Project” to
create a new Android Studio
Project 8
9
This application name is shown in Google
Play Store and various other places, too

All your
project
files ill be
saved here

The package name of an Android app


uniquely identifies your app on the
device, in Google Play Store, and in
supported third-party Android stores.
The minimum required SDK is
the lowest version your app
will support. Your app will run You can also select Kotlin from here
on devices with this level API
or higher. It won’t run on
devices with a lower API.
10
itor
Design Ed

11
tor
Code Edi

12
Compile, package, deploy and run

13
Run the app in the Virtual Device /
Emulator
• The Android emulator allows you to run your app on an Android
virtual device (AVD). The AVD behaves just like a physical Android
device. You can set up numerous AVDs, each emulating a different
type of device.

14
15
The system image gives you an installed version of the Android
operating system.

16
17
Run the app on Physical Device
• Enable USB debugging on your device.
• On most devices running Android 3.2 or older, you can find the option under
Settings > Applications > Development.
• On Android 4.0 and newer, it's in Settings > Developer options.
• On Android 4.2 and newer, Developer options is hidden by default. To make it
available, go to Settings > About phone and tap Build number seven times.
Return to the previous screen to find Developer options.

18
Main Menu

Allows you to do several actions:


• New Project, save, open Project
• Manage IDE settings
• Edit the toolbars and other sections
• Inspect, analyze the code
• Build project, clean project, generate
APK
• Run the project, debug, profile
• Managing SDK, the device, the
resources…
• Integrating version control

And many other actions…

19
The tool window bar

20
Layout Editor

21
Design and Code Editors
Toolbar

Palette

Component
Tree Attributes

22
Manifest.xml
• Every application must have an
AndroidManifest.xml file
• The manifest file presents essential information
about your app to the Android system, information
the system must have before it can run any of the
app's code.
• More about the Manifest file:
http://developer.android.com/guide/topics/manifes
t/manifest-intro.html

23
Manifest.xml (Cont.)
• Your app must declare all its components in this file.
• Identify any user permissions the app requires, such as Internet
access or read-access to the user's contacts.
• Declare the minimum API Level required by the app.
• Declare hardware and software features used or required by the app,
such as a Camera, Bluetooth services, or a Multi Touch screen.

24
Java
• This is where all your source code files will go.
• MainActivity.java: This is the auto-generated
Activity Class with the name you entered into
the project creation wizard.

25
res
• The res/values folder is used to store the values
for the resources that are used in many android
projects to include features of color, styles,
dimensions etc.
• For any type of resource, you can specify
default and multiple alternative resources for
your application:

26
Default and Alternate Resources
• Default resources are those that should be used regardless of the
device configuration or when there are no alternative resources that
match the current configuration.
• Alternative resources are those that you've designed for use with a
specific configuration. To specify that a group of resources are for a
specific configuration, append an appropriate configuration qualifier
to the directory name.

27
Default Resources

28
Alternate Resources

29
res (Cont.)
• drawable: Bitmap files (.png, .9.png, .jpg, .gif) or XML files that are
compiled into drawable resource.
• layout: XML files that define a user interface layout.
• mipmap: place your app/launcher icons here.
• menus: XML files that define application menus, such as an Options
Menu, Context Menu, or Sub Menu.
• values: XML files that contain simple values, such as strings, string
arrays, quantity strings, integers, and colors.

30
Gradle
• Android Studio uses Gradle, an advanced build toolkit, to automate
and manage the build process while letting you define flexible,
custom build configurations.
• The Android Gradle plugin works with the build toolkit to provide
processes and configurable settings that are specific to building and
testing Android apps.

https://developer.android.com/build 31

You might also like