android and eclipse thaddeus diamond cpsc 112. a quick introduction eclipse is an ide (integrated...
TRANSCRIPT
Android and EclipseThaddeus DiamondCPSC 112
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
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)
Android JVM Architecture
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
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?
The Activity Life Cycle
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>
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
Hello, (customizable) world!