Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated...
-
Upload
marshall-warren -
Category
Documents
-
view
217 -
download
1
Transcript of Android and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated...
![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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/1.jpg)
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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/2.jpg)
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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/3.jpg)
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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/4.jpg)
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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/5.jpg)
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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/6.jpg)
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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/7.jpg)
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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/8.jpg)
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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/9.jpg)
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.](https://reader035.fdocuments.net/reader035/viewer/2022080915/56649ddd5503460f94ad617c/html5/thumbnails/10.jpg)
Hello, (customizable) world!