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

Lecture2.1 SettingUpEnviornmentAppFundamentals

Uploaded by

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

Lecture2.1 SettingUpEnviornmentAppFundamentals

Uploaded by

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

Muhammad Adnan Aslam

Mobile Application
Development
LECTURE 02
Todays Agenda

 Introduction to Android Environment


 Setting up Environment
 Application Fundamentals
 Android Platform Architecture
Development Environment

 Java is the most popular language used to develop Android


applications.
 Android devices don’t run .class and .jar files directly.
 Instead, to improve speed and battery performance
 Android devices use their own optimized formats for compiled code.
 That means that you can’t use an ordinary Java development
environment
 You also need special tools to convert your compiled code into an
Android format, to deploy them to an Android device, and to let
you debug the app once it’s running
Old Developer Android
Environment
 Eclipse IDE: type code in,
compile, not Android‐specific

 Android Dev Tools (ADT):


Eclipse plugin, adds Android
functionality

 Android Software Dev Kit


(SDK):
Tools to build, test and run
apps

 Packages: Enables
developing for various
New Developer Android
Environment
 Google developed it’s own IDE called
 Android Studio
 Combines tools in old development
environment into 1 IDE
 Cleaner interface specifically for Android
Development (e.g. drag and drop app design)
 In December 2014, Google announced it will
stop supporting Eclipse IDE

Android Studio
Installing Android Studio

The most important place to find information


and links to tools is the Android Developers site:
http://developer.android.com
Installing Android Studio
 Step 1: Install Java (at least version 1.7)
 Note: You may already have Java installed. Check first
 Can find the JDK at
http://www.oracle.com/technetwork/java/javase/downloads/index.html

 Step 2: Set JAVA_HOME system environmental variable


 This variable tells applications that need Java where it is installed

 Step 3: Install Android Studio (version 4 is latest)


https://developer.android.com/studio/install

 Bucky Roberts (thenewboston): nice youtube Android tutorials


 Tutorial 1: Install Java https://www.youtube.com/watch?
v=QAbQgLGKd3Y
 Tutorial 2: Install Android Studio
https://www.youtube.com/watch?v=zEsDwzjPJ5c
Where to Run Android App
 Android app can run on:
 Real phone (or device) Preview phone
 Emulator (software version of pane in Android
Studio
phone)
Emulator Pros and Cons
 Pros:
 Conveniently test app on basic hardware by clicking in
software
 Easy to test app on various devices (phones, tablets, TVs,
etc), various screen sizes

 Cons:
 Some hardware missing, especially hardware for sensing
environment
 E.g. GPS, camera, video recording, etc
 Needs a lot of memory to run and eventually slows down the
system
Emulator
Limitations
 No support for
 Phone calls (calling or receiving)
 USB connections
 Camera/video capture (input)
 Bluetooth
 Sensors, acccelerometer, gyroscope, etc
 Device‐attached headphones
 Determining battery charge level and AC
charging state
 Determining SD card insert/eject

 Slow!!!
Running Android App on Real
Phone
 Need USB cord to copy app from development PC
to phone
Setting up your Project
 After installing Android Studio, need to set up your
project
 Tutorial: Android App Development for Beginners ‐
3
– Setting up your project by Bucky Roberts
(thenewboston)
 https://www.youtube.com/watch?v=r4oIez0sfvY

 Main steps to set up Android Project


 Start a new Android Project
 Configure new Android Project (select app name, domain
name, etc)
 Set platform and minimum SDK
 Add an Activity
What is a gradle?
 When you click the run button in Android Studio, most of the actual work is
done by an external build tool called Gradle.
 Gradle works behind the scenes to
 Locates and downloads the correct versions of any third-party libraries you need.
 Calls the correct build tools in the correct sequence to turn all of your source code
and resources into a deployable app.
 Installs and runs your app on an Android device.
 A whole bunch of other stuff, like running tests and checking the quality of your
code.
Android Studio
Run AVD
Manager
How to Run the App?
Click here to run the app
Run App on Virtual Device (Phone)
Tour of Android Studio
Interface
 Tutorial 5: Tour of Android Studio Interface
[6:01 mins]
 https://www.youtube.com/watch?v=‐pdTqBq2TFQ

 Quick overview of main sections of Android


Studio
 Windows menu bar
 Android tool bar
 Project window
 Editor Window
 Palette for Drag‐and‐Drop Design of Android buttons

 More detailed coverage of specific UI aspects


later
Typical Windows Menu Bar (File, edit, etc)
Tool Bar: Shortcuts to Frequently used Android-specific Functions
(E.g. One-click access to SDK manager)
Path to Current File in IDE Window (Clickable)
Editor Window (Allows editting of current file we are working on)
Clicking on Editor Window Tabs switches between Java code and Visual Interface
Project Window (Allows between project files, packages, etc)
Palette of Drag-and-Drop Elements for Designing Interface (Layout, widgets, etc)
Parameters of Drag-and-Drop Elements for Designing Interface
(e.g. colors, dimensions of widgets, etc)
Importing Existing Code
 Can also import existing code
 The text comes with lots of free code you can learn from, use in projects as
starting point
 Can import from gitHub repository
 See https://developer.android.com/studio/intro/migrate

You might also like