Android	
  For	
  Java	
  
  Developers	
  

     Marko	
  Gargenta	
  
       Marakana	
  
Agenda	
  
•    Android	
  History	
  
•    Android	
  and	
  Java	
  
•    Android	
  SDK	
  
•    Hello	
  World!	
  
•    Main	
  Building	
  Blocks	
  
•    Debugging	
  
•    Summary	
  
History	
  
2005	
     Google	
  buys	
  Android,	
  Inc.	
  
           Work	
  on	
  Dalvik	
  starts	
  


2007	
     OHA	
  Announced	
  
           Early	
  SDK	
  


2008	
     G1	
  Announced	
  
           SDK	
  1.0	
  Released	
  


2009	
     G2	
  Released	
  
           Cupcake,	
  Donut,	
  Eclair	
  
Android	
  and	
  Java	
  

Android Java =
Java SE –
AWT/Swing +
Android API
Android	
  SDK	
  -­‐	
  What’s	
  in	
  the	
  box
                                                     	
  
SDK

Tools
Docs
Platforms
     Data
     Skins
     Images
     Samples
Add-ons
     Google Maps
The	
  Tools
           	
  
          Tools are important part of the
          SDK. They are available via
          Eclipse plugin as well as command
          line shell.
HELLO	
  WORLD!	
  
Create	
  New	
  Project
                                         	
  
Use the Eclipse tool to create a new
Android project.

Here are some key constructs:


Project	
          Eclipse	
  construct	
  
Target	
           minimum	
  to	
  run	
  
App	
  name	
      whatever	
  
Package	
          Java	
  package	
  
AcXvity	
          Java	
  class	
  
The	
  Manifest	
  File	
  
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.marakana"
   android:versionCode="1"
   android:versionName="1.0">
  <application android:icon="@drawable/icon"
        android:label="@string/app_name">
    <activity android:name=".HelloAndroid"
           android:label="@string/app_name">
       <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
       </intent-filter>
    </activity>
  </application>
  <uses-sdk android:minSdkVersion="5" />
</manifest>
The	
  Layout	
  Resource	
  

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  >
<TextView
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="@string/hello"
  />
</LinearLayout>
The	
  Java	
  File	
  
package com.marakana;

import android.app.Activity;
import android.os.Bundle;

public class HelloAndroid extends Activity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);
  }
}
Running	
  on	
  Emulator
                        	
  
MAIN	
  BUILDING	
  BLOCKS	
  
AcXviXes
                       	
  
Activity is to an    Android Application

application what a       Main Activity
                                           Another    Another
                                           Activity   Activity
web page is to a
website. Sort of.
AcXvity	
  Lifecycle	
  
                                                         Starting




Activities have a well-
                                                     (1) onCreate()
                                                      (2) onStart()
                                              (3) onRestoreInstanceState()

defined lifecycle. The                              (4) onResume()


Android OS manages
your activity by                                         Running


changing its state.       (3) onResume()
                            (2) onStart()
                                                                               (1) onSaveInstanceState()
                                                                                     (2) onPause()

You fill in the blanks.
                           (1) onRestart()                    onResume()


                                                  (1) onSaveInstanceState()
                            Stopped                      (2) onStop()                     Paused



                                 onDestroy()
                                     or                                       <process killed>
                               <process killed>

                                                        Destroyed
Intents
                           	
  
Intents are to      Android Application
Android apps                                         Another
                        Main Activity     Intent
what hyperlinks                                      Activity

are to websites.
They can be




                                                        Intent
implicit and
                    Android Application
explicit. Sort of
like absolute and       Main Activity       Intent
                                                     Another
                                                     Activity
relative links.
Services
                           	
  
A service is something that can be started and
stopped. It doesn’t have UI. It is typically managed
by an activity. Music player,
for example
Service	
  Lifecycle	
  
Service also has a                                       Starting

lifecycle, but it’s                                                            (1) onCreate()
much simpler than                                                               (2) onStart()


activity’s. An activity                      onStart()

typically starts and
stops a service to do       Stopped                                                Running

some work for it in
the background.                                                     onStop()

Such as play music,
check for new               onDestroy()
                                or

tweets, etc.
                          <process killed>
                                                    Destroyed
Content	
  Providers
                               	
  
Content Providers share                    Content
content with applications                  Provider

across application           Content URI

boundaries.                    insert()

Examples of built-in          update()

Content Providers are:         delete()

Contacts, MediaStore,          query()

Settings and more.
Broadcast	
  Receivers
                                	
  




An Intent-based publish-subscribe mechanism. Great for listening
system events such as SMS messages.
DEBUGGING	
  	
  
ANDROID	
  APPS	
  
LogCat
                              	
  
The universal, most
versatile way to track
what is going on in
your app.

Can be viewed via
command line or
Eclipse.

Logs can be
generated both from
SDK Java code, or
low-level C code via
Bionic libc extension.
Debugger
                                    	
  




Your standard debugger is included in SDK, with all the usual bells & whistles.
TraceView	
  




TraceView helps you profile you application and find bottlenecks. It shows
execution of various calls through the entire stack. You can zoom into specific
calls.
Hierarchy	
  Viewer
                                          	
  
Hierarchy Viewer helps
you analyze your User
Interface.

Base UI tends to be the
most “expensive” part of
your application, this tool
is very useful.
Summary	
  
     Android is based on Java.

     You write Java code, but technically
     don’t run it.

     Java is augmented with XML, mostly
     for UI purposes.

     Android Java is mostly based on Java
     SE with replacement UI libraries.


     Marko Gargenta, Marakana.com
     marko@marakana.com
     +1-415-647-7000


     Licensed under Creative Commons
     License (cc-by-nc-nd). Please Share!

More Related Content

PDF
Marakana Android User Interface
DOCX
Android Tutorial For Beginners Part-1
PDF
04 user interfaces
DOCX
Android xml-based layouts-chapter5
PPTX
PDF
Android Basic Components
PDF
Mobile Application Development with JUCE and Native API’s
PPT
View groups containers
Marakana Android User Interface
Android Tutorial For Beginners Part-1
04 user interfaces
Android xml-based layouts-chapter5
Android Basic Components
Mobile Application Development with JUCE and Native API’s
View groups containers

What's hot (20)

PDF
Build UI of the Future with React 360
PPT
android layouts
PPTX
Android Tutorials : Basic widgets
PPTX
Android application development the basics (2)
PPTX
Android Study Jam 2
PPTX
Application Development - Overview on Android OS
PDF
Android Screen Containers & Layouts
PDF
What's new in android 4.4 - Romain Guy & Chet Haase
PDF
Android layouts
PDF
Android ui layout
PPTX
Introduction to android
PPTX
Android components
PPT
Android tutorial
PPT
Android tutorial
PPT
Android tutorial
PDF
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
PPT
Designing Apps for the Motorola XOOM
PDF
01 08 - graphical user interface - layouts
DOCX
How to create ui using droid draw
PPT
Android tutorial
Build UI of the Future with React 360
android layouts
Android Tutorials : Basic widgets
Android application development the basics (2)
Android Study Jam 2
Application Development - Overview on Android OS
Android Screen Containers & Layouts
What's new in android 4.4 - Romain Guy & Chet Haase
Android layouts
Android ui layout
Introduction to android
Android components
Android tutorial
Android tutorial
Android tutorial
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Designing Apps for the Motorola XOOM
01 08 - graphical user interface - layouts
How to create ui using droid draw
Android tutorial
Ad

Viewers also liked (20)

PDF
Validation
PPT
Arte Polimaterica
PPTX
About Me
PPT
Career In Financing Administration
PPT
feelings
PPT
Future Uses Of Computer
PPT
Creating A Positive Classroom Environment 1192954359997023 3
PDF
【労働者健康福祉機構】平成18年度環境報告書
PPTX
Shortguideto Flashmeeting[1]
DOC
Lyons Brown Bag Afc 20091112
PDF
4.Oracle Day Sigortacili Mali Isler
PPT
The Gasoline Brothers spelen band 2.0 met Twitter, Facebook, blog en een 'gra...
PDF
Guida base Adobe Illustrator CS 5.5
PDF
Railsservers
PPT
418 Sunum
PPTX
IBM Training Presentation
PPTX
PrimaProva01
KEY
Wellspiration 6 - Fighting Heart Disease Naturally
PDF
How To Motivate People
PDF
Samantha Jamson, University of Leeds
Validation
Arte Polimaterica
About Me
Career In Financing Administration
feelings
Future Uses Of Computer
Creating A Positive Classroom Environment 1192954359997023 3
【労働者健康福祉機構】平成18年度環境報告書
Shortguideto Flashmeeting[1]
Lyons Brown Bag Afc 20091112
4.Oracle Day Sigortacili Mali Isler
The Gasoline Brothers spelen band 2.0 met Twitter, Facebook, blog en een 'gra...
Guida base Adobe Illustrator CS 5.5
Railsservers
418 Sunum
IBM Training Presentation
PrimaProva01
Wellspiration 6 - Fighting Heart Disease Naturally
How To Motivate People
Samantha Jamson, University of Leeds
Ad

Similar to Marakana android-java developers (20)

PPT
Android activity, service, and broadcast recievers
PDF
Androidoscon20080721 1216843094441821-9
PDF
Androidoscon20080721 1216843094441821-9
PPT
android-tutorial-for-beginner
PDF
Android Development
PDF
Android introduction
PPTX
Android 101 Session @thejunction32
PDF
Getting Started with Android - OSSPAC 2009
PDF
Android Jumpstart Jfokus
PPTX
Android development orientation for starters v2
PDF
Android application development
KEY
Android Development: The Basics
PPT
LA_FUNDAMENTALS OF Android_Unit I ONE.ppt
PPT
Android Tutorial
PPTX
Android beginners David
PDF
Android development - the basics, MFF UK, 2012
PPT
Ruby conf2012
PDF
Introduction to Android - Mobile Portland
PDF
Android Jump Start
PPT
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9
android-tutorial-for-beginner
Android Development
Android introduction
Android 101 Session @thejunction32
Getting Started with Android - OSSPAC 2009
Android Jumpstart Jfokus
Android development orientation for starters v2
Android application development
Android Development: The Basics
LA_FUNDAMENTALS OF Android_Unit I ONE.ppt
Android Tutorial
Android beginners David
Android development - the basics, MFF UK, 2012
Ruby conf2012
Introduction to Android - Mobile Portland
Android Jump Start
Android activity, service, and broadcast recievers

More from Marko Gargenta (16)

PDF
Open Android
PDF
LTE: Building New Killer Apps
PDF
Java Champion Wanted
PDF
Android Beyond The Phone
PDF
Android for Java Developers
PDF
Android Internals
PDF
Android Deep Dive
PDF
Android for Java Developers at OSCON 2010
PDF
Android: A 9,000-foot Overview
PDF
Marakana Android Internals
PDF
Android Internals
PDF
Scrum Overview
PDF
Android For Managers Slides
ODP
Why Python by Marilyn Davis, Marakana
PDF
Jens Østergaard on Why Scrum Is So Hard
PDF
Jens Østergaard on Why Scrum Is So Hard
Open Android
LTE: Building New Killer Apps
Java Champion Wanted
Android Beyond The Phone
Android for Java Developers
Android Internals
Android Deep Dive
Android for Java Developers at OSCON 2010
Android: A 9,000-foot Overview
Marakana Android Internals
Android Internals
Scrum Overview
Android For Managers Slides
Why Python by Marilyn Davis, Marakana
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So Hard

Recently uploaded (20)

PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PDF
State of AI in Business 2025 - MIT NANDA
PDF
Examining Bias in AI Generated News Content.pdf
PDF
TrustArc Webinar - Data Minimization in Practice_ Reducing Risk, Enhancing Co...
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PPTX
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PDF
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
PDF
Ebook - The Future of AI A Comprehensive Guide.pdf
PDF
Secure Java Applications against Quantum Threats
PDF
Revolutionizing recommendations a survey: a comprehensive exploration of mode...
PDF
TicketRoot: Event Tech Solutions Deck 2025
PDF
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
PDF
Child-friendly e-learning for artificial intelligence education in Indonesia:...
PDF
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
PDF
Rooftops detection with YOLOv8 from aerial imagery and a brief review on roof...
PPTX
Introduction-to-Artificial-Intelligence (1).pptx
PDF
Intravenous drug administration application for pediatric patients via augmen...
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
NewMind AI Journal Monthly Chronicles - August 2025
State of AI in Business 2025 - MIT NANDA
Examining Bias in AI Generated News Content.pdf
TrustArc Webinar - Data Minimization in Practice_ Reducing Risk, Enhancing Co...
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
Ebook - The Future of AI A Comprehensive Guide.pdf
Secure Java Applications against Quantum Threats
Revolutionizing recommendations a survey: a comprehensive exploration of mode...
TicketRoot: Event Tech Solutions Deck 2025
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
Child-friendly e-learning for artificial intelligence education in Indonesia:...
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
Rooftops detection with YOLOv8 from aerial imagery and a brief review on roof...
Introduction-to-Artificial-Intelligence (1).pptx
Intravenous drug administration application for pediatric patients via augmen...
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]

Marakana android-java developers

  • 1. Android  For  Java   Developers   Marko  Gargenta   Marakana  
  • 2. Agenda   •  Android  History   •  Android  and  Java   •  Android  SDK   •  Hello  World!   •  Main  Building  Blocks   •  Debugging   •  Summary  
  • 3. History   2005   Google  buys  Android,  Inc.   Work  on  Dalvik  starts   2007   OHA  Announced   Early  SDK   2008   G1  Announced   SDK  1.0  Released   2009   G2  Released   Cupcake,  Donut,  Eclair  
  • 4. Android  and  Java   Android Java = Java SE – AWT/Swing + Android API
  • 5. Android  SDK  -­‐  What’s  in  the  box   SDK Tools Docs Platforms Data Skins Images Samples Add-ons Google Maps
  • 6. The  Tools   Tools are important part of the SDK. They are available via Eclipse plugin as well as command line shell.
  • 8. Create  New  Project   Use the Eclipse tool to create a new Android project. Here are some key constructs: Project   Eclipse  construct   Target   minimum  to  run   App  name   whatever   Package   Java  package   AcXvity   Java  class  
  • 9. The  Manifest  File   <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.marakana" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloAndroid" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="5" /> </manifest>
  • 10. The  Layout  Resource   <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout>
  • 11. The  Java  File   package com.marakana; import android.app.Activity; import android.os.Bundle; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
  • 14. AcXviXes   Activity is to an Android Application application what a Main Activity Another Another Activity Activity web page is to a website. Sort of.
  • 15. AcXvity  Lifecycle   Starting Activities have a well- (1) onCreate() (2) onStart() (3) onRestoreInstanceState() defined lifecycle. The (4) onResume() Android OS manages your activity by Running changing its state. (3) onResume() (2) onStart() (1) onSaveInstanceState() (2) onPause() You fill in the blanks. (1) onRestart() onResume() (1) onSaveInstanceState() Stopped (2) onStop() Paused onDestroy() or <process killed> <process killed> Destroyed
  • 16. Intents   Intents are to Android Application Android apps Another Main Activity Intent what hyperlinks Activity are to websites. They can be Intent implicit and Android Application explicit. Sort of like absolute and Main Activity Intent Another Activity relative links.
  • 17. Services   A service is something that can be started and stopped. It doesn’t have UI. It is typically managed by an activity. Music player, for example
  • 18. Service  Lifecycle   Service also has a Starting lifecycle, but it’s (1) onCreate() much simpler than (2) onStart() activity’s. An activity onStart() typically starts and stops a service to do Stopped Running some work for it in the background. onStop() Such as play music, check for new onDestroy() or tweets, etc. <process killed> Destroyed
  • 19. Content  Providers   Content Providers share Content content with applications Provider across application Content URI boundaries. insert() Examples of built-in update() Content Providers are: delete() Contacts, MediaStore, query() Settings and more.
  • 20. Broadcast  Receivers   An Intent-based publish-subscribe mechanism. Great for listening system events such as SMS messages.
  • 22. LogCat   The universal, most versatile way to track what is going on in your app. Can be viewed via command line or Eclipse. Logs can be generated both from SDK Java code, or low-level C code via Bionic libc extension.
  • 23. Debugger   Your standard debugger is included in SDK, with all the usual bells & whistles.
  • 24. TraceView   TraceView helps you profile you application and find bottlenecks. It shows execution of various calls through the entire stack. You can zoom into specific calls.
  • 25. Hierarchy  Viewer   Hierarchy Viewer helps you analyze your User Interface. Base UI tends to be the most “expensive” part of your application, this tool is very useful.
  • 26. Summary   Android is based on Java. You write Java code, but technically don’t run it. Java is augmented with XML, mostly for UI purposes. Android Java is mostly based on Java SE with replacement UI libraries. Marko Gargenta, Marakana.com [email protected] +1-415-647-7000 Licensed under Creative Commons License (cc-by-nc-nd). Please Share!