android and eclipse thaddeus diamond cpsc 112. a quick introduction eclipse is an ide (integrated...

10
Android and Eclipse Thaddeus Diamond CPSC 112

Upload: marshall-warren

Post on 25-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

Android and EclipseThaddeus DiamondCPSC 112

Page 2: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

A Quick Introduction• Eclipse is an IDE (Integrated Development Environment• Open Source• Much more full-featured than DrJava• Debug mode• Project management• Support for multiple languages• Arbitrary user-developed plug-ins

• The primary way Android applications are developed (supported by Google)• DEFINITELY the way you should do your bonus assignment (if you

choose to do so)• USB Debugging

Page 3: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

A Quick Introduction• Android is a mobile phone…• Open Source• Completely open platform• iPhone is nearly completely closed• Security issues

• Applications are written in Java and compiled onto the Java Dalvik VM

• Applications can be purchased from the Google Marketplace and the Amazon marketplace

• Now on version 4.0 (Ice Cream Sandwich)

Page 4: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

Android JVM Architecture

Page 5: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

The API• CREDIT: http://developer.android.com/• Libraries are natively deployed on Android, no linking or including

required when using simulator or real Android device• API defines what to import, how to reference it

• HINT: You will have to look through it for the assignment

Page 6: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

Components of an Application• Activity• Single screen with a user interface• One pane of your application with logic about where to place the

objects and how to handle • Service• Runs in the background to perform long-running operations or remote

processes• Think: music player, GPS scraper, RSS reader pull

• Context Provider• Manages a shared set of application data• The main state of your application, transparent

• Broadcast Receiver• Responds to system-wide announcements• When you click a mail link in one application, how does the mail

application know to come to attention?

Page 7: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

The Activity Life Cycle

Page 8: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

The Manifest File• Written in XML

• Tells Android what’s doing in your app!• Tags for each component of your application, gives the main logo

of your application, …

<?xml version="1.0" encoding="utf-8"?><manifest ... > <application android:icon="@drawable/app_icon.png" ... > <activity android:name="com.example.project.ExampleActivity" android:label="@string/example_label" ... > </activity> ... </application></manifest>

Page 9: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

User Interface• Written in XML (same as manifest

file)• Composed of standard layouts,

buttons, image views, input fields, labels, etc…• These can be customized to a very

large degree• Android “look and feel”

• Can interact with components of the XML-defined interface in the Java application code• Much like how HTML/CSS interacts

with JavaScript on a webpage

Page 10: Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured

Hello, (customizable) world!