1 / 59

Android Application Development gerber.cs.uchicago/android/

Android Application Development gerber.cs.uchicago.edu/android/. Adam Gerber, PhD, SCJP Some of my mobile work: MythicMobile.com Introductions: Name Where are you from? Your experience with mobile and java? What you want to get out of this class?. Android .

kmachado
Télécharger la présentation

Android Application Development gerber.cs.uchicago/android/

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 Developmentgerber.cs.uchicago.edu/android/

  2. Adam Gerber, PhD, SCJP Some of my mobile work: MythicMobile.com Introductions: Name Where are you from? Your experience with mobile and java? What you want to get out of this class?

  3. Android • Comprehensive open-source platform for mobile devices • Owned by Open Handset Alliance http://en.wikipedia.org/wiki/Open_Handset_Alliance • Championed by Google • Stated goal: "accelerate innovation in mobile and offer consumers a richer, less expensive, and better mobile experience." • Chrome OS and Android merge.

  4. Vision for Android

  5. Android is NOT just phones Tablets Readers Televisions Game consoles AR-Devices Android Wear Android is open-source, which means any manufacturer of mobile devices can drop Android onto it.

  6. 6/9/12

  7. Android Version Distribution Using the compatability (support) libraries, you can develop in 4.2 and min-build-target to 1.6. https://developer.android.com/about/dashboards/index.html

  8. Code/Version/API map http://source.android.com/source/build-numbers.html

  9. Mods (skins) HTC Motorola Samsung | HTC Motorola Samsung

  10. 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)

  11. Intel losing market share to tablets and phones https://www.ispot.tv/ad/AT1o/intel-6th-generation-core-processor-the-chase-feat-jim-parsons.

  12. Android Support three different processors: ARM, Intel, and MIPS. The Intel or x86 chips are fast but they’re power hungry. They’re used on laptops. (Complex Instruction Set Computing or CISC) The MIPS are used in embedded systems. The ARM are RISC or (Reduced Instruction Set Computing). Much less power hungry chips.

  13. iOS versus Android Revenue at POP

  14. Android Architecture

  15. 6/9/12

  16. Stock apps, all of which can be replaced; modular architecture. Managers (APIs to OS). You will use these APIs in your apps. SQLite and WebKit are in iOS as well. libc is from c. OpenGL is graphics, etc. kernel components; you won't touch these.

  17. android dex files are like java class files - they're bytecode, but they've been optimized for a resource constrained environment.

  18. Android is modular

  19. Building Blocks of an App • Activities (you can see an activity, activities have views.) • Intents (shuttle messages) • Services (background services) • Content Providers (api abstraction to datastore) • Broadcast Receivers (capture OS broadcasts; such as battery-low, reboot, sms-received, headphone-plugged-in, etc. )

  20. Some Developer Resources

  21. Resources Android Developer's Guide : developer.android.com/guide/index.html Stack Overflow: stackoverflow.com/questions/tagged/android AssetStudio: android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html Android Views: www.androidviews.net

  22. Android Layouts explained The Layout file is nothing more than XML with some Android namespaces: xmlns:android https://developer.android.com/guide/topics/ui/declaring-layout.html Search for TextView or EditText or Button

  23. Views versus ViewGroups All Views and ViewGroups are Views. View is the Grand-daddy of all Views in Android which itself is just a Java Object. ViewGroups collect Views and other Viewgroups. You can nest ViewGroups. Typical ViewGroups: LinearLayout, RelativeLayout, FrameLayout.

  24. ViewGroups All Views and ViewGroups are Views. View is the Grand-daddy of all Views in Android which itself is just a Java Object. ViewGroups collect Views and other Viewgroups. You can nest ViewGroups. Typical ViewGroups: LinearLayout, RelativeLayout, FrameLayout.

  25. Attributes (match_parent and fill_parent same since API8) :match_parent / fill_parent :wrap_content

  26. Attributes :layout_gravity :gravity :layout_gravity descibes how the view is layed-out inside its parent. (outside) :gravity describes how the view lays out its elements or children (inside) http://stackoverflow.com/questions/3482742/gravity-and-layout-gravity-on-android

  27. Attributes :margin :padding :margin is the outside “margin” :padding is the inside “margin”

  28. LinearLayout :orientation is horizontal or vertical :weightSum is typically 100 (percent) :gravity – where should the content be placed

  29. Projects

  30. Projects

  31. Projects

  32. Download and install required software: Java SDK (7): www.oracle.com/technetwork/java/javase/downloads/index.html Android Studio: developer.android.com/sdk/installing/studio.html Git: git-scm.com SourceTree: www.sourcetreeapp.com

  33. GIT architecture

  34. git config --global user.name "Your Name" git config --global user.email "your_email@whatever.com"

  35. add/reset/commit: move files from working-dir to stage-dir(aka index) git add . git add res/. git add src/. git add res/values/strings.xml move files from stage-dir(aka index) to working-dir git reset HEAD . git reset head res/. git reset head src/. git reset head res/values/strings.xml git commit -m “your commit message.”

  36. Amending: Every commit is associated with a sha-1 hash. That hash is derived from 1/ the file changes in that commit and 2/ the previous commit. You can not change any commit unless that commit is at the head. Since no other commits depend on the head, you may safely change the head. To change the head, use git commit --amend -m “your message” git commit --amend --no-edit

  37. Branching: To list the branches in a project: git branch git branch -r git branch --all To create a branch: git checkout -b branchName c39b git checkout -b branchName To delete a branch: git branch -D branchName To checkout a branch: git checkout 7afe git checkout master

  38. Pushing to remotes: To see the remotes: git remote -v show To push to a remote: git push origin master git push --all To clear all local changes since last push git reset --hard origin/master

  39. Reverting (does the exact opposite) git revert 0da8 --no-edit git revert head --no-edit git revert head~3 --no-edit To clear all local changes since last push git reset --hard origin/master To delete a remote branch git push origin :branchName

  40. Unit00: Setup

More Related