Upload
alisha-hudson
View
217
Download
2
Tags:
Embed Size (px)
Citation preview
Background of Mobile App
Development
North Carolina A&T State University
“The explosion in access to mobile phones and digital services means that people everywhere are contributing vast amounts of information to the global knowledge warehouse. Moreover, they are doing so for free, just by communicating, buying and selling goods and going about their daily lives.”
Ban Ki-moonU.N. Secretary General
OS for Telephones
• Smartphones have an operating system that is just as complex as a desktop or laptop• Telephones are often said to have limited
resources, although they are not that limited•Over 106 million people in the United States
owned smartphones in 2012 [L2ThinkTank]
• Smartphone sales make up 59% of total handset sales, 62% in the 25-34 age range as of 2011[Wikipedia]
[Wikipedia]
Explosive Growth
• In 2006, Android, iOS, Windows Phone and Bada did not exist•Only 64 million smartphones were sold in
2006•As of 2011, nearly 10 times as many
smartphones were sold annually
First Smartphone
• The IBM Simon Personal Communicator was the first smartphone in 1992•Originally priced at $899
$1358 in today’s dollars• Had a calendar, address
book, calculator, note pad, e-mail and games
Phone OS 2013
[Wikipedia]
Separation
• Some phone OS separate the “computer” functionality from the “telephone” functionality•Programs on these systems cannot make
phone calls•Other phone OS allow programs access the
full hardware of the device
Android OS
•Android is an operating system for telephones•Open Source system from Google•Android is the fastest growing phone OS
•Google's mission is “to organize the world's information and make it universally accessible and useful”• The unofficial company slogan is
“Don't be evil”
Why Google is in the Phone Market?
Overview of Android
Kernel
•Android is built on the Linux kernel, but Android is not Linux•Many standard Linux features are not
included•Patch of “kernel enhancements” to
support Android• Linux provides memory and process
management, security and device drivers• Linux is open source
Dalvik - Android Virtual Machine
•Dalvik is a different type of Java Virtual Machine• Java programs are compiled to a different
set of instructions•Optimized to run on slow-cpu, low-RAM,
low-power devices• None of the above really apply now
• runs .dex files (not .class/.jar)
Interpreting Java
•Applications on Android are written in Java•After the Java program is compiled, the
Java Jar file is converted to a new format called Dex (Dalvik EXecutable)• The Java byte codes are converted to Dex
byte codes
Dex File
• Entire Jar file with multiple classes are converted to a single Dex file• The merging of multiple class files into one
Dex file reduces significant redundancy•Dex file is often less than half the size of
normal Jar file, even more than compressed Jar
Law Suits
•On August 12, 2010, Oracle sued Google over claimed infringement of Java copyrights and patents for $6.1 billion• In May 2012 the jury found Google not
guilty•Almost every phone maker has sued
every other phone maker
Beyond the Phone
•Both Google and Apple have table computers based on their phone OS•A tablet does everything a phone does,
except act as a phone
What is a small device?
Google Glass
Google has made a wearable computer with optical display
It runs the Android OS
Apps for Android Phones
•Apps for Apple phones and tablets are written in Objective-C•Apps for Microsoft phones and tablets
are written in C#•Android apps are written in Java
Limited Java
•Android apps are written with Java•Most standard Java language features
are supported•Does not support the java.awt,
javax.swing packages or applets• The features available to an Android
app developer depend on the version of Android
XML
• Android uses the eXtended Markup Language to specify details about an Android app
• XML is similar to HTML– HTML defines how a webpage should appear– XML defines how data should be stored
• XML is used to save– App layout– Strings in the program– Configuration information
Tools for Developing Android Apps
Resources Abound
• If you Google for Android development tools, you will find lots to help you
• A useful tutorial can be found at:https://developer.android.com/training/basics/firstapp/index.html
Patience
noun [pey-shuh ns] an ability or willingness to suppress restlessness or annoyance when confronted with delay
• You need patience when dealing with Android development
• The Android emulator is one of the slowest programs in common use
Start a new Project in Android Studio
• Click start a new project
• Make up an application and domain name
Form and Version
• Select Phone and Tablet as the target device• Select the minimum SDK• Select Blank Activity
SDK Levels
• Android is rapidly developing and changing• Each new version of Android has a new level
of the Application Programmer Interface (API)• Newer levels have more advanced features• Older levels run on more phones
Android LevelsCode name Version API level
Lollipop 5.1 API level 22
Lollipop 5.0 API level 21
KitKat 4.4 - 4.4.4 API level 19
Jelly Bean 4.3.x API level 18
Jelly Bean 4.2.x API level 17
Jelly Bean 4.1.x API level 16
Ice Cream Sandwich 4.0.3 - 4.0.4 API level 15, NDK 8
Ice Cream Sandwich 4.0.1 - 4.0.2 API level 14, NDK 7
Honeycomb 3.2.x API level 13
Honeycomb 3.1 API level 12, NDK 6
Honeycomb 3.0 API level 11
Gingerbread 2.3.3 - 2.3.7 API level 10
Gingerbread 2.3 - 2.3.2 API level 9, NDK 5
Froyo 2.2.x API level 8, NDK 4
Files Created
• MyActivity.java – Java source code for the Activity class
• activity_my.xml - XML layout file for the activity. Android Studio shows both the XML and a preview of the screen
• build.gradle – various files to build the app• resources/ - directory of files used by your
program, including Strings
The Secret Handshake• To run your Android apps on your phone, you
should turn on the developer features• 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 is in Settings > Developer options. Note: 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.
Gradle
• Open source tool to build programs• Android studio uses Gradle to build apps– Decides what files need to be compiled– Merges changes from XML and Java
• NetBeans uses Ant, a different open source
Running the App
• Click the run button in Android Studio to run the program
• You can run the app on a real phone or with the Android Emulator
• On a Windows system, you must first download a device driver to connect your phone to your laptop