Sei sulla pagina 1di 29

MOBILE

TECHNOLOGY
ANDROID APPS
DEVELOPMENT
#1
Welcome to
Android App Development
Requirements
 Android Smartphone or Tablet
 Java SE 6 and above (JDK and JRE)
 Eclipse (bundled with ADT)
 Android Development Tool (ADT)
 Android SDK
 NOTE:
 Android SDK components updated
 Eclipse preferences
 • Android SDK location set
 • At least one AVD (Android Virtual Device) defined
 Documentation
 • http://developer.android.com/guide/developing/index.html
 • http://developer.android.com/reference/packages.html
Meet the Android
 Smartphones
 Can browse the Web
 Allow you to play games
 Use business applications
 Check e-mail
 Play music
 Record video
 Map locations with GPS
 Oh yes, make phone calls and send
text messages
Meet the Android
 Android phone platform runs a free, open-
source operating system from Google
 Open Handset Alliance
 80
companies that develop standards for
mobile devices
 Android Phone Device
 Most popular are EVO, Droid, Galaxy, Echo,
etc.
 OS also powers tablets, netbooks, e-
readers, MP4 players and Internet TVs
Android Architecture
Meet the Android
 Features of the Android
 Flash support - Flash video plays within the
Android Web browser. (The iPhone does not
support Flash capabilities.)
 Power management - Android identifies
programs running in the background using
memory and processor resources.
 Optimized gaming - Android supports the
use of gyroscope, gravity, barometric
sensors, linear acceleration, and rotation
vector.
Meet the Android
 Features of the Android
 Onscreen keyboard - Spell-check,
predictive text, voice-input mode.
 Wi-Fi Internet tethering - Allows a phone to
be used as a wireless or wired hot spot.
 Multiple language support - Android
supports multiple human languages.
 Front- and rear-facing cameras
 Voice-based recognition for calling, texting,
and navigating with the phone.
Meet the Android
 Features of the Android
 3D graphics - The interface can support 3D
graphics for a 3D interactive game
experience or 3D image rendering.
 Facial recognition - Android provides this
high-level feature for automatically
identifying or verifying a person’s face from
a digital image or a video frame.
Meet the Android
 Writing Android Apps
 Java is the language of choice for Android
Apps
 Object-oriented programming languages
allow for good software engineering practices
 Eclipse
 The most popular tool (IDE) for writing Java
programs
 Can also be used to develop applications in
other languages
 XML is used to assist in the layout of the
Android emulator
Meet the Android
 Android Emulator
 Design, develop, prototype, and test Android
apps without using a physical device
 Mimics almost every feature of a real Android
handset, except placing phone calls
 Current version is Ice Cream Sandwich – all
versions named after dessert items (in
alphabetical order)
 Previous versions include Cupcake, Donut,
Éclair, Froyo (frozen yogurt), Gingerbread, and
Honeycomb
Meet the Android
 Getting Oriented with Market Deployment
 Platform consists of the Android OS,
application development tools, and a
marketplace Apps are compiled into package
files with an .apk extension
 Android Market (http://market.android.com)
sells and deploys all apps
 Programs must meet minimum standards
 Apps are free or paid (70/30 split between
developer and wireless carrier)
 Also sold through Amazon
(amazon.com/appstore) and iTunes (both
charge a $99 registration fee)
Android SDK
 Once installed open the SDK Manager
 Install the desired packages
 Create an Android Virtual Device (AVD)
Android
Virtual
Device
(AVD)
Android Versions and Usage Share
Version Code Name Release Date API Distribution
Level
Marshmallow
Lollipop
Kitkat
4.2 Jelly Bean November 13, 2012 17 0.8%
4.1.x Jelly Bean July 9, 2012 16 5.9%
4.0.x Ice Cream Sandwich December 16, 2011 15 27.5%
3.2 Honeycomb July 15, 2011 13 1.2%
3.1 Honeycomb May 10, 2011 12 0.4%
2.3.3–2.3.7 Gingerbread February 9, 2011 10 50.6%
2.3–2.3.2 Gingerbread December 6, 2010 9 0.2%
2.2 Froyo May 20, 2010 8 10.3%
2.0–2.1 Eclair October 26, 2009 7 2.7%
1.6 Donut September 15, 2009 4 0.3%
1.5 Cupcake April 30, 2009 3 0.1%
Developing Android
Applications
Revisiting the Android World
• Opening Eclipse to Create a New Project
– Install Eclipse IDE, Android SDK
– Create the Android Virtual Device (AVD)
– You’ll need to have:
• Project name, application name, package
name, activity name, API level
• Creating the Hello World Project
– Open Eclipse and choose the Android
Project icon
– Name the project and specify a save
location
First Venture into
the Android World
 Creating the Hello World Project
 Enter a package name, such as:
(com.mymp3player)
 Enter the Activity name (main)
 Enter the Minimum SDK (14)
 Click the Finish button
First Venture into
the Android World
 Building the User Interface
 Must be intuitive
 Interface must not distract from functionality
 Java code or XML layout files are needed
 XML method is preferred
 Can design interface without writing large
amounts of code
First Venture into
the Android World
 Taking a Tour of the Package Explorer
 Src folder – contains Java source code
 Gen folder – contains automatically
generated Java files
 Android 4.0 library – contains all class
libraries
 Assets folder – contains asset files
 Res folder – contains images, music, and
video
 Android Manifest.xml – contains information
about the application that Android needs
to run
First Venture into
the Android World
 Designing the user Interface Layout
 Layout – a container that holds as many
widgets as needed
 Widget– a single element on the screen
(Button, Text Box, etc.)
 Also called an object
Source
code

Auto-generated
code

Library

String
constants
UI
layout

Configuration
First Venture into the Android World

Figure 1-10 Layout Displayed in Eclipse Window


First Venture into the Android World
 Adding a Form Widget to the User Interface Layout

Figure 1-12 TextView form widget in the emulator


First Venture into the Android World
 Testing the Application in the Emulator
First Venture into the Android World
 Testing the Application in the Emulator
First Venture into the Android World
 Opening a Saved App in Eclipse
Summary
 Android OS is released under Apache license
allowing anyone to get the full open-source for free
 Android OS powers all types of mobile devices
 To write apps, you can use Eclipse, an IDE used for
building applications
 The Android emulator lets you design, develop
prototype, and test Android applications
 The Android platform consists of the Android OS, the
Android application development platform, and the
Android marketplace
Summary
 Android supports both Java code and
XML layout files, although XML is preferred
 The Package Explorer contains folders for
an Android project
 To design a user interface for an Android
app, you can create a layout containing
widgets (objects)
 The Android emulator allows you to test
an application and make sure it runs
correctly

Potrebbero piacerti anche