0% found this document useful (0 votes)
20 views

2 Android Studio

This document provides an overview of mobile application development using Android Studio. It discusses prerequisites for mobile app development including Java, XML, and using an IDE. It then introduces Android Studio as the integrated development environment for Android and describes its interface. Finally, it outlines the steps to create a basic "Hello World" Android app in Android Studio, including setting up a project, configuring an activity, and running the app on an emulator or physical device.

Uploaded by

tharunpawar1829
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

2 Android Studio

This document provides an overview of mobile application development using Android Studio. It discusses prerequisites for mobile app development including Java, XML, and using an IDE. It then introduces Android Studio as the integrated development environment for Android and describes its interface. Finally, it outlines the steps to create a basic "Hello World" Android app in Android Studio, including setting up a project, configuring an activity, and running the app on an emulator or physical device.

Uploaded by

tharunpawar1829
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Mobile Application Development

Lesson 2
Dr. Syed Asim Jalal
Department of Computer Science
University of Peshawar
Prerequisites
● Java Programming Language
● Object-oriented programming
● XML - properties / attributes
● Using an IDE for development and debugging

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 2
Android app
International License.
Android Studio

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 3
Android app
International License.
What is Android Studio?

● Android integrated development environment (IDE)


● Project and Activity templates
● Layout editor
● Testing tools
● Gradle-based build
● Log console and debugger
● Emulators

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 4
Android app
International License.
Android Studio interface

1. Toolbar
2. Navigation bar
3. Project pane
4. Editor
5. Tabs for other
panes

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 5
Android app
International License.
Installation Overview
● Mac, Windows, or Linux
● Download and install Android Studio from
https:/ / developer.android.com/ studio/

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 6
Android app
International License.
Creating your
first Android app

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 7
Android app
International License.
Start Android Studio

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 8
Android app
International License.
Create a project inside Android Studio

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 9
Android app
International License.
Name your app

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 10
Android app
International License.
Your first This work is licensed under a
Android Developer Fundamentals V2 Creative Commons Attribution 4.0 11
Android app
International License.
Pick activity template
Choose templates for
common activities,
such as maps or
navigation drawers.

Pick Empty Activity


or Basic Activity for
simple and custom
activities.
Your first This work is licensed under a
Android Developer Fundamentals V2 Creative Commons Attribution 4.0 12
Android app
International License.
Name your activity
● Good practice:
○ Name main activity
MainActivity
○ Name layout
activity_main
● Use AppCompat
● Generating layout
file is convenient

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 13
Android app
International License.
Your first This work is licensed under a
Android Developer Fundamentals V2 Creative Commons Attribution 4.0 14
Android app
International License.
Project folders
1. manifests—Android Manifest file -
description of app read by the
Android runtime
• examples
2. java—Java source code packages
3. res—Resources (XML) - layout,
strings, images, dimensions,
colors...
4. build.gradle—Gradle build filesYour first This work is licensed under a
Android Developer Fundamentals V2 Creative Commons Attribution 4.0 15
Android app
International License.
Gradle build system
● Modern build subsystem in Android Studio
● Three build.gradle:
○ Project: information about the gradle itself.
○ Module: information about each module. Phone, Wear, TV, Car
○ Settings: information about which module to compile, Phone+TV

● Typically not necessary to know low-level Gradle details

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 16
Android app
International License.
Run your app
1. Run

2. Select virtual
or physical
device
3. OK
Your first This work is licensed under a
Android Developer Fundamentals V2 Creative Commons Attribution 4.0 17 17
Android app
International License.
Create a virtual device
Use emulators to test app on different versions of Android and form factors.

Tools > Android > AVD Manager or:

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 18
Android app
International License.
Configure virtual device

1. Choose hardware
2. Select Android version
3. Finalize

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 19
Android app
International License.
Your first This work is licensed under a
Android Developer Fundamentals V2 Creative Commons Attribution 4.0 20
Android app
International License.
Your first This work is licensed under a
Android Developer Fundamentals V2 Creative Commons Attribution 4.0 21
Android app
International License.
Run on a virtual device

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 22
Android app
International License.
Run on a physical device
1. Turn on Developer Options:
a. Settings > About phone
b. Tap Build number seven times
2. Turn on USB Debugging
a. Settings > Developer Options > USB Debugging
3. Connect phone to computer with cable

Windows/Linux additional setup:


● Using Hardware Devices

Windows drivers:
● OEM USB Drivers
Your first This work is licensed under a
Android Developer Fundamentals V2 Creative Commons Attribution 4.0 23
Android app
International License.
Get feedback as your app runs
1. Emulator
running the
app
2. Run pane
3. Run tab to
open or close
the Run pane

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 24
Android app
International License.
Adding logging to your app
● As the app runs, the Logcat pane shows information
● Add logging statements to your app that will show up in the
Logcat pane
● Set filters in Logcat pane to see what's important to you
● This will be covered in later lectures.

Your first This work is licensed under a


Android Developer Fundamentals V2 Creative Commons Attribution 4.0 25
Android app
International License.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy