1 / 45

Android Application Development Adam Gerber, PhD, SCJP gerber@cs.uchicago Office: Ryerson 154

Android Application Development Adam Gerber, PhD, SCJP gerber@cs.uchicago.edu Office: Ryerson 154 Office Hours: Mon 8:20pm-10:00pm TA: Jonathan Nieder jrnieder@cs.uchicago.edu. Evaluations. 20% homework assignments (4@ 5% each) 20% midterm exam 50% individual final project (take home)

Renfred
Download Presentation

Android Application Development Adam Gerber, PhD, SCJP gerber@cs.uchicago Office: Ryerson 154

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android Application DevelopmentAdam Gerber, PhD, SCJPgerber@cs.uchicago.edu Office: Ryerson 154 Office Hours: Mon 8:20pm-10:00pm TA: Jonathan Nieder jrnieder@cs.uchicago.edu

  2. Evaluations 20% homework assignments (4@ 5% each) 20% midterm exam 50% individual final project (take home) 10% class participation Late homework/final project is penalized 10% every day late, for three days; after that, you get a zero.

  3. lec 01 The Android Computing Platform and Architecture Setting Up Your Development Environment Tour of Eclipse/ADT First App: HelloWorld Understanding Android Resources

  4. The Android Computing Platform

  5. Android • Comprehensive open-source platform for mobile devices • Owned by Open Handset Alliance • Championed by Google • Stated goal: "accelerate innovation in mobile and offer consumers a richer, less expensive, and better mobile experience."

  6. Vision for Android

  7. http://developer.android.com/resources/dashboard/platform-versions.htmlhttp://developer.android.com/resources/dashboard/platform-versions.html

  8. Mods (skins)

  9. Open Handset Alliance The OHA was established on 5 November 2007, led by Google with 34 members including mobile handset makers, application developers, some mobile carriers and chip makers. Android, the flagship software of the alliance, is based on an open source license and competes against mobile platforms from Apple, Microsoft, Nokia (Symbian), HP (formerly Palm), Research In Motion, and Samsung Electronics (bada). Headquarters: South Korea http://en.wikipedia.org/wiki/Open_Handset_Alliance http://en.wikipedia.org/wiki/Android_(operating_system)

  10. Setting up your dev enviroment

  11. Getting/Using the tools Google-search-> java jdk || java se downloads || JDK version 6 || install to c:\java || set the path env variable. C:\path\to\jdk\bin || java -version from command line. Google-search-> android sdk || install to c:\java\android-sdk || path to C:\java\android-sdk\platform-tools;C:\java\android-sdk\tools; adb devices to test. Google-search-> eclipse ide | right-side download eclipse get the SE version || portable version so no need to "install" || dnd in root of c Google-search-> adt eclipse || half way down to red url, and copy it. | within eclispe help || install new software || paste in there. within eclipse || little-down arrow || opens And SdK manager 4.0.3 within eclipse || little=phone-icon || pulls up AVDM new http://www.classes.cs.uchicago.edu/archive/2012/summer/51031-1/android-src.zip C:\java\android-sdk\platforms\android-15\sources\android-src.zip

  12. Quick Java Review

  13. Java Primitives (integers)

  14. How Java Stores positive Integers -2(bits -1)to 2(bits -1)– 1 • 0001 0011 • The above is a binary representation of the number 19 stored in a byte (8 bits). • The range of a byte is: -128 to 127.

  15. Java Primitives (others)

  16. Primitives versus Objectsmemory

  17. primitive object pass by value pass by reference Action: Tell my accountant how much I intend to spend on a new car next year. Change in bank account: no change. Action: Swipe debit card and enter pin at the Bently dealership. Change in bank account: -125k.

  18. Class Objects

  19. Class Objects

  20. Spot the “class” here

  21. Naming conventions

  22. Naming local variables - suggestions boolean bFlag byte yAge char cFirst short sRosterSize int nStudent; nC long lPopulation float fPrice double dDistanceToMoon

  23. Naming local references - suggestions Person per perDirector String str strFirstName Rectangle rec recShape Bee bee beeDrone

  24. Naming local arrays and collections - suggestions Array of boolean bAnswers Array of byte yAges Array of int nIdentities Array of Person perStudents Array of String strCountries Collection of Bee such as ArrayList<Bee> beeDrones Collection of Athlete athPlayers

  25. Why use a naming convention? • metadata is immediately discernible just by looking at the local variable or local reference name. This makes your code easy to read and debug. • Primitives always have one letter prefix; nNumber • References have three letter prefix; perDirector. • Arrays and collections have s postfix: beeDrones; strCountries, nLevels. • Avoid ending with s for variables or references that are NOT collections/arrays; e.g. nRadiux, or nRadius_ • Overridden methods in Android come with their own set of params.

  26. Eclipse IDE

  27. Shortucts: New class and browse to superclass Activity Cntrl-numeric 1 is QuickFix! Control click to source. Source || override/implements methods Extract method Create getters and setters Templates || see video Window || preferences || Java || Editor || Templates Ctrl-Shift-L

  28. Using the debugger • Perspectives; Java and Debug • Setting breakpoints • Step-over F6, and Step-in F5 • Watch expressions • Conditional breakpoints

  29. Resources in Android

  30. Alt-Shift-A to externalize strings <st + ctrl space Create many xml resources, but don't name the actual resources the same Add resources from the Add Resources from the graphical editor and also manually. #FFFFFF white getResources(). getStringArray(R.array.whatever)

  31. Building Blocks of an App • Activities • Intents • Services • Content Providers • Broadcast Recievers

  32. Some Developer Resources

  33. Dev Guide • http://developer.android.com/guide/topics/fundamentals.html • http://developer.android.com/training/index.html

  34. Turning in Assignments Use git

More Related