33
Background of Mobile App Development North Carolina A&T State University

Background of Mobile App Development North Carolina A&T State University

Embed Size (px)

Citation preview

Page 1: Background of Mobile App Development North Carolina A&T State University

Background of Mobile App

Development

North Carolina A&T State University

Page 2: 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

Page 3: Background of Mobile App Development North Carolina A&T State University

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]

Page 4: Background of Mobile App Development North Carolina A&T State University

[Wikipedia]

Page 5: Background of Mobile App Development North Carolina A&T State University

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

Page 6: Background of Mobile App Development North Carolina A&T State University

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

Page 7: Background of Mobile App Development North Carolina A&T State University

Phone OS 2013

[Wikipedia]

Page 8: Background of Mobile App Development North Carolina A&T State University

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

Page 9: Background of Mobile App Development North Carolina A&T State University

Android OS

•Android is an operating system for telephones•Open Source system from Google•Android is the fastest growing phone OS

Page 10: Background of Mobile App Development North Carolina A&T State University

•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”

Page 11: Background of Mobile App Development North Carolina A&T State University

Why Google is in the Phone Market?

Page 12: Background of Mobile App Development North Carolina A&T State University

Overview of Android

Page 13: Background of Mobile App Development North Carolina A&T State University

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

Page 14: Background of Mobile App Development North Carolina A&T State University

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)

Page 15: Background of Mobile App Development North Carolina A&T State University

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

Page 16: Background of Mobile App Development North Carolina A&T State University

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

Page 17: Background of Mobile App Development North Carolina A&T State University

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

Page 18: Background of Mobile App Development North Carolina A&T State University

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?

Page 19: Background of Mobile App Development North Carolina A&T State University

Google Glass

Google has made a wearable computer with optical display

It runs the Android OS

Page 20: Background of Mobile App Development North Carolina A&T State University

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

Page 21: Background of Mobile App Development North Carolina A&T State University

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

Page 22: Background of Mobile App Development North Carolina A&T State University

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

Page 23: Background of Mobile App Development North Carolina A&T State University

Tools for Developing Android Apps

Page 24: Background of Mobile App Development North Carolina A&T State University

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

Page 25: Background of Mobile App Development North Carolina A&T State University

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

Page 26: Background of Mobile App Development North Carolina A&T State University

Start a new Project in Android Studio

• Click start a new project

• Make up an application and domain name

Page 27: Background of Mobile App Development North Carolina A&T State University

Form and Version

• Select Phone and Tablet as the target device• Select the minimum SDK• Select Blank Activity

Page 28: Background of Mobile App Development North Carolina A&T State University

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

Page 29: Background of Mobile App Development North Carolina A&T State University

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

Page 30: Background of Mobile App Development North Carolina A&T State University

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

Page 31: Background of Mobile App Development North Carolina A&T State University

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.

Page 32: Background of Mobile App Development North Carolina A&T State University

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

Page 33: Background of Mobile App Development North Carolina A&T State University

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