You are on page 1of 41

Getting Started

TEL 61662 – Mobile Device Programming


Lecturer : Mr. Ibrahim, S.T., M.T.

© 2020 - Made with in Karawang


Lesson 1 : Build Your First App
TEL 61662 – Mobile Device Programming
Lecturer : Mr. Ibrahim, S.T., M.T.

© 2020 - Made with in Karawang


Lesson 1.1: Android Studio and Hello  World
TEL 61662 – Mobile Device Programming
Lecturer : Mr. Ibrahim, S.T., M.T.

© 2020 - Made with in Karawang


Introduction

© 2020 - Made with in Karawang


What you'll learn
● How to install and use the Android Studio IDE.
● How to use the development process for building Android apps. 
● How to create an Android project from a template.

© 2020 - Made with in Karawang


Prerequisites
● Java Programming Language
● Object-oriented programming
● XML - properties / attributes
● Using an IDE for development and debugging
● Internet access or an alternative way of loading the latest
Android Studio and Java  installations onto your computer. 

© 2020 - Made with in Karawang


What you'll do
● Install the Android Studio development environment.
● Create an emulator (virtual device) to run your app on your computer. 
● Create and run the Hello World app on the virtual and physical devices. 
● Explore the project layout. 
● Generate and view log messages from your app. 
● Explore the AndroidManifest.xml  file. 

© 2020 - Made with in Karawang


Task 1: Install Android Studio

© 2020 - Made with in Karawang


What is Android Studio?
● Android Integrated Development
Environment (IDE)
● Project and Activity templates
● Layout editor
● Testing tools
● Gradle-based build Android Studio provides a complete integrated
● Log console and debugger development environment (IDE) including an  advanced
● Emulators code editor and a set of app templates. In addition, it
contains tools for development,  debugging, testing, and
performance that make it faster and easier to develop
apps. You can test  your apps with a large range of
preconfigured emulators or on your own mobile device,
build  production apps, and publish on the Google Play
store. 

© 2020 - Made with in Karawang


Installation Overview

● Mac, Windows, or Linux


● Download and install Android Studio from
https://developer.android.com/studio/

© 2020 - Made with in Karawang


System requirements

© 2020 - Made with in Karawang


Android Studio interface

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

© 2020 - Made with in Karawang


Task 2: Creating your first Android app

© 2020 - Made with in Karawang


App Overview

© 2020 - Made with in Karawang


Start Android Studio

© 2020 - Made with in Karawang


Create a project

© 2020 - Made with in Karawang


Name your app

© 2020 - Made with in Karawang


Choose Android Devices

© 2020 - Made with in Karawang


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.

© 2020 - Made with in Karawang


Name Your Activity

● Good practice:
○ Name main activity
MainActivity
○ Name layout
activity_main
● Use AppCompat
● Generating layout
file is convenient

© 2020 - Made with in Karawang


Explore the Project

© 2020 - Made with in Karawang


Name Your Activity

© 2020 - Made with in Karawang


Project folders
1. manifests—Android Manifest file -
description of app read by the Android
runtime
2. java—Java source code packages
3. res—Resources (XML) - layout, strings,
images, dimensions, colors...
4. build.gradle—Gradle build files

© 2020 - Made with in Karawang


Gradle build system
● Modern build subsystem in Android Studio
● Three build.gradle:
o project
o module
o settings
● Typically not necessary to know low-level Gradle details
● Learn more about gradle at https://gradle.org/

© 2020 - Made with in Karawang


Run your App

© 2020 - Made with in Karawang


Task 3: Use a virtual device (emulator) 

© 2020 - Made with in Karawang


Run Your App

1. Run

2. Select virtual
or physical
device

3. OK

© 2020 - Made with in Karawang


Create a virtual device
Use emulators to test app on different versions of Android and form factors.

Tools > Android > AVD Manager  or:

© 2020 - Made with in Karawang


Configure virtual device

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

© 2020 - Made with in Karawang


Run the app on the virtual device 

© 2020 - Made with in Karawang


Task 4: (Alternative) Use a physical device

© 2020 - Made with in Karawang


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

© 2020 - Made with in Karawang


Get feedback as your app runs

1. Emulator
running the
app
2. Run pane
3. Run tab to
open or close
the Run pane

© 2020 - Made with in Karawang


Summary

© 2020 - Made with in Karawang


Learn more
● Meet Android Studio
● Official Android documentation at developer.android.com
● Create and Manage Virtual Devices
● Supporting Different Platform Versions
● Supporting Multiple Screens
● Gradle Wikipedia page
● Google Java Programming Language style guide
● Find answers at Stackoverflow.com

© 2020 - Made with in Karawang


Mini Quiz!

© 2020 - Made with in Karawang


Homework 

© 2020 - Made with in Karawang


Coding Challenge

● Build and run your own app


● Create a new Android project from the Empty Template. 
● An Activity  that displays “Your Name, NPM, Prodi, Fakultas, Universitas" on
the screen.
● Create an emulator for a device, targeting any version of Android you like,
and run the app. 
● Submit your app for grading

© 2020 - Made with in Karawang


What's Next?

● Exploring Widgets, Designing Layout, Activity, UI in your first mobile app.


● Stay tune!

© 2020 - Made with in Karawang


See ya!
Best Regards,

Iyannugraha9

© 2020 - Made with in Karawang


END
© 2020 Teknik Elektro Unsika - Made with in Karawang
All Right Reserved.

elektro.ft.unsika.ac.id

You might also like