Android ApplicationDevelopment

download Android ApplicationDevelopment

of 34

Transcript of Android ApplicationDevelopment

  • 7/31/2019 Android ApplicationDevelopment

    1/34

    JordanJozwiakNovember13,2011

  • 7/31/2019 Android ApplicationDevelopment

    2/34

    Agenda

    WhyAndroid? Applicationframework Gettingstarted UIandwidgets Applicationdistribution Externallibraries Demo

  • 7/31/2019 Android ApplicationDevelopment

    3/34

    WhyAndroid?

  • 7/31/2019 Android ApplicationDevelopment

    4/34

  • 7/31/2019 Android ApplicationDevelopment

    5/34

  • 7/31/2019 Android ApplicationDevelopment

    6/34

    WhyAndroid?

    Opensource Thatmeansthatitsfree!

    EasytouseframeworkbasedonJava Truecustomization

    Replacestockapps PersonalizeHomeScreenswithwidgets

    Betternotifications Easiertopublishnoreviewprocess

  • 7/31/2019 Android ApplicationDevelopment

    7/34

    WhyAndroid?Security

    ReputationaslesssecurethaniOS True,butitisstillverysecure!

    Eachapplicationlivesinitsownsecuritysandbox SystemassignseachappauniqueLinuxuserID

    Eachprocesshasitsownvirtualmachine,soanappscoderunsinisolationfromotherapplications

    Permissionsareapprovedbytheuserduringappinstallation.

    Appsaresignedbyadevelopersprivatekey

  • 7/31/2019 Android ApplicationDevelopment

    8/34

    Applicationframework

  • 7/31/2019 Android ApplicationDevelopment

    9/34

    Applicationframework

    srcsourcefileswheretheactualcodingtakesplace

    rescollectionofresourcesforscreenlayouts,images,sounds,text,animationsandmore.

    ManifestrepresentsessentialinformationabouttheapplicationtotheAndroidsystem

  • 7/31/2019 Android ApplicationDevelopment

    10/34

    Applicationframework

    srccodeexample

  • 7/31/2019 Android ApplicationDevelopment

    11/34

    Applicationframework

    res res/drawablelogoandallimages

    Customizablefordifferentpixeldensities res/rawsoundsandmusic res/layouttheXMLlayoutforeachactivity

    Customizablefordifferentscreensizesandorientations

    res/valuessavesallstringsandobjectstyles NotasstreamlinedorstandardizedasiOS

  • 7/31/2019 Android ApplicationDevelopment

    12/34

    Applicationframework

    Layoutexample

  • 7/31/2019 Android ApplicationDevelopment

    13/34

    Applicationframework

    Manifest Permissions

    e.g.accessinternet,accessSMSmessages MinimumAPI Hardwareandsoftwarefeaturesrequired Youmustalsodeclareeveryactivityyoucreate!

  • 7/31/2019 Android ApplicationDevelopment

    14/34

    Applicationframework

    Manifestexample

  • 7/31/2019 Android ApplicationDevelopment

    15/34

    ApplicationframeworkActivityLifecycle

  • 7/31/2019 Android ApplicationDevelopment

    16/34

    ApplicationFramework

    Activity Visiblescreens

    Service Backgroundservices

    Contentprovider Shareddata

    Broadcastreceivers Receiveandreacttobroadcastevents

    Intent Launchnewactivities

  • 7/31/2019 Android ApplicationDevelopment

    17/34

    Gettingstarted

  • 7/31/2019 Android ApplicationDevelopment

    18/34

    Gettingstartedinstallation

    GetthelatestJavaDevelopmentKit(JDK) GetthelatestversionofEclipseClassic(recommended)InstalltheAndroidSoftwareDevelopmentKit(SDK)

    InstalltheAndroidDevelopmentTools(ADT)pluginforEclipse

    Makesyourlifeeasier:letsyouquicklysetupnewAndroidprojects,createanapplicationUI,debugyourapps,andexport

    APKsfordistribution!

  • 7/31/2019 Android ApplicationDevelopment

    19/34

    GettingstartedEclipse+ADT

  • 7/31/2019 Android ApplicationDevelopment

    20/34

    GettingstartedEmulator

    Eclipse+ADT+Emulator=

  • 7/31/2019 Android ApplicationDevelopment

    21/34

    Gettingstarteddebugging

    DDMSdebuggernotfun,butyoushoulddoit.

  • 7/31/2019 Android ApplicationDevelopment

    22/34

    UIandwidgets

  • 7/31/2019 Android ApplicationDevelopment

    23/34

    UIandwidgets

    AndroiduserinterfaceiscomposedofhierarchiesofobjectscalledViews

    View:adrawableobjectsuchasabutton,image,ortextlabel Widget:likeformtypesinHTML,waysthattheusercaninteractwiththeUIsuchasTextView,ListView,ScrollView,Spinner,TabWidget,Button

    Layout:acontainerforwidgets

  • 7/31/2019 Android ApplicationDevelopment

    24/34

    UIandwidgets

    LinearLayout,RelativeLayout,andTableLayout

  • 7/31/2019 Android ApplicationDevelopment

    25/34

    Applicationdistribution

  • 7/31/2019 Android ApplicationDevelopment

    26/34

    Applicationdistribution

    PublishintheAndroidMarket Purchaseadeveloperaccountfor$25 ExportAPKfromEclipsewithADT UploadAPK,images,anddescription

  • 7/31/2019 Android ApplicationDevelopment

    27/34

    ExternalLibraries

  • 7/31/2019 Android ApplicationDevelopment

    28/34

    ExternalLibraries

    Easilyaddexternallibrariesbyimporting3rdpartyJARs(.jarfiles)

    Allowsyoutoeasilyintegratecoolfeaturesintoyourapp MakeuseofSDKsfrombigcorporations Sellingpoint Lesscoding

  • 7/31/2019 Android ApplicationDevelopment

    29/34

    ExternalLibrariesAnalytics

    GoogleAnalytics(recommended)

    Understandhowusersinteractwithyourapp Numberofvisitorsperday Timeonpage(inactivity) Demographicsandlocation Trackappversion Appinteraction(buttonpresses,conversions,etc.)

  • 7/31/2019 Android ApplicationDevelopment

    30/34

    ExternalLibrariesMonetization

  • 7/31/2019 Android ApplicationDevelopment

    31/34

    ExternalLibrariesMonetization

    Opensourcephilosophy Peoplearelesswillingtopayforapps,sodevelopersmaymoneythroughadvertisements

    AdMob(recommended) BoughtbyGooglein2009for$750million Paidbyclick,notbyimpression Easilytransferfundstoadvertiseyourownapp(20%bonus)

  • 7/31/2019 Android ApplicationDevelopment

    32/34

    ExternalLibrariesOthers

    ManylargecompanieshavetheirownSDKsintheformofJARs

    Facebook,Twitter,Dropbox,OpenFeint,etc. SearchonlineforJARsforotherfunctions(advancedmathoperations,etc.)

  • 7/31/2019 Android ApplicationDevelopment

    33/34

    Demo

    TutorialforHello,world! http://developer.android.com/resources/tutorials/helloworld.html

    TutorialsforViews http://developer.android.com/resources/tutorials/views/index.html

    Othertutorials http://developer.android.com/resources/browser.html?tag=tutorial

  • 7/31/2019 Android ApplicationDevelopment

    34/34

    Thanksforcoming!