Your SlideShare is downloading. ×
0
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Build Your First Android App Session #1
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Build Your First Android App Session #1

3,193

Published on

The slides from the build your first android app course.

The slides from the build your first android app course.

Published in: Software, Technology, Education
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,193
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
40
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. BuildYour First Android App Session #1 10 May 2014
  • 2. Today’s Agenda • Installation • Coffee Finder • Understanding Android • Signing Our App • Registering for Service • Design Our UI
  • 3. Agenda Continue • Action Bars and Navigation • Debugging • Lists • Maps
  • 4. Installation • Java SDK 6 • Android Studio • Android SDK and Stuff • Genymotion andVirtualBox
  • 5. Why are we using Java 6? • Android does not run the JavaVirtual Machine, JVM • It runs an optimized version called the DalvikVirtual Machine, DVM • Because of this the current version of Java is immaterial to Android
  • 6. Installing Java • Install as an Admin • Keep the defaults • Add Java bin folder to path • And create JAVA_HOME
  • 7. Installing Java • Permit the install to make changes
  • 8. Installing Java • Click Next
  • 9. Installing Java • Once you completed installation… • Add the Java bin folder to the Path…
  • 10. Installing Java • Click Advanced system settings
  • 11. Installing Java • Click Environment Variables…
  • 12. Installing Java • We are going to modify the System variables • Scroll up/down in the bottom box until you the Path • Add the path to the Java bin folder to the end of the path
  • 13. Installing Java • Also add a JAVA_HOME to your system variables • This points to your Java 6 runtime
  • 14. Installing Java • From the command prompt run the java command to display the version number • If all is well it will respond: javac 1.6.0_45
  • 15. Installing Android Studio • Again, install as an Admin • Allow the install to make changes • The install isn’t signed, don’t panic
  • 16. Installing Android Studio • Accept the defaults by clicking next
  • 17. Installing Android Studio • Let anyone use Android Studio
  • 18. Installing Android Studio • Once you’ve installed successfully, we need to get the Android SDKs and stuff
  • 19. Installing Android Studio • So be sure to launch the studio
  • 20. Installing Android Studio • Don’t worry about this dialog, it just gives us a chance to upgrade old projects
  • 21. Installing Android Studio • Ignore this update! We will update from the app
  • 22. Installing Android Studio • Once you reach here, click the tiny “Check for updates now” link
  • 23. Installing Android Studio • Click Update and Restart
  • 24. Installing Android Studio • Now that we are update, lets get our SDKs
  • 25. Installing Android Studio • If you see this dialog, click Open
  • 26. Installing Android Studio • If this screen doesn’t come up on its own, click the Android with the down arrow icon • Select all of the indicated downloads • Click Install
  • 27. Installing Android Studio • Accept the licenses • Click Install
  • 28. Installing Android Studio • Once you see this screen, just one more packaged to install!
  • 29. Installing Genymotion • On Windows select the Genymotion /VirtualBox combo install package • Again, I recommend installing as admin
  • 30. Installing Genymotion • Once installed, run Genymotion • Click the plus sign to add a virtual device
  • 31. Installing Genymotion • If you want to keep up with me, choose the Google Galaxy Nexus
  • 32. Installing Genymotion • On the virtual Google Galaxy Nexus device • Drop the file: 
 gapps-jb-20130813- signed.zip • You should get this dialog • Click OK
  • 33. Installing Genymotion • Once you get to here, you will need to reboot the virtual device by powering it down, then up
  • 34. Installing Genymotion • The first time booting completely up, it should ask for you Google account
  • 35. Coffee Finder • This is our app • It is a small but full featured app • It uses lists, maps, the action bar, tasks, 3rd party web services, and more
  • 36. Coffee Finder • Click the new project button • Fill in the blanks • Use your own domain name! • Click Next
  • 37. Coffee Finder • Just click Next here
  • 38. Coffee Finder • Change the Activity Name • And the Layout Name • Click Next
  • 39. Coffee Finder • In order to run our app, click the run button, which looks like a green arrow at top near the center of the IDE • Next to it is the debug button which we will also use a lot
  • 40. Coffee Finder • If you get the Choose Device dialog, be sure to to select Use same device… • Click OK
  • 41. • logcat shows us logging messages from the device • And there are a lot of messages… • Luckily we can filter them logcat
  • 42. Understanding Android • Android Open Source Project • Alphabet Soup • Project Structure • Pages • The Application Object • Intents
  • 43. The Android Open Source Project • Android as we think of it is composed of two parts: • The Android Open Source Project • Google Services
  • 44. Alphabet Soup • ADB - Android Debug Bridge • ADT - Android Developer Tools • AVD - AndroidVirtual Device • DDMS - Dalvik Debug Monitor Server
  • 45. Project Structure • AndroidManifest.xml • bin - executable • libs - libraries • res - resources • src - source files
  • 46. AndroidManifest.xml • Every application must have one in the root directory • Presents essential app information to the Android system • Activities, services, the application object must all be defined in it • It also controls the look of some elements
  • 47. AndroidManifest.xml • It is a XML document • All elements must close • Elements contain attributes and data • The root element is the Manifest tag
  • 48. AndroidManifest.xml • Application tag • Activities and Services • Permissions • Meta-data
  • 49. Pages • Activity • Fragments
  • 50. The Application Object • A base class for those who need to maintain global application state • You provide its name in the AndroidManifest file • The Application object created before any activity or service • When destroyed, app is finished
  • 51. Coffee Finder • Here’s what we got so far… • We’ve got a lot of work to do
  • 52. Signing Our App • In order to use Google Maps, we need to know our apps two signatures • One for debug, which we will get now • And one for release, will do that next week
  • 53. Registering for Services • Google Maps Android • http://bit.ly/1jsfeJc • Registering withYP.com • http://publisher.yp.com
  • 54. Designing Our UI I don’t do anything fancy. Just plain 3x5 cards. Makes it easy to make changes and to play my design. Here is the design of the listings page.
  • 55. Designing Our UI Here is the map page.
  • 56. Designing Our UI The details page.
  • 57. Designing Our UI And finally the settings page.
  • 58. The Action Bar • The Action Bar will be are primary UI. • We will use it to move between the listings page and the map page • And to go to the settings page • Drilling down on either listings or map pages takes you to the details page
  • 59. Our 2nd Page • Create the MapActivity • Create the map layout • Register the new activity in the manifest • Launch new activity from the old one
  • 60. Create the Application Object • Create the Application object • Register the Application object in the manifest • Set breakpoint to see it in action
  • 61. Create the Constants Class • Create the Constants class • Add LOG_TAG to it
  • 62. Calling a Web Services • Make a direct calls toYP from DHC • Describe all of the objects in it • Create a class for each object • Avoiding ANR • Create an AsyncTask to load the data
  • 63. Converting JSON to POJO • Introduction to GSON • How does GSON work? • Implement GSON in Code
  • 64. Creating a ListView • Add the ListView to the layout • Create a row • Creating the ListAdapter • Watching the ListView get filled • Drilling to a list item
  • 65. More Map Activity • Returning to the Listings Activity • Via the Action Bar • Via the Back button
  • 66. Rendering a Map • A Simple Map • Positioning the Camera • Adding the user’s location • Adding Markers to the Map
  • 67. Summary Session #1 • Google Maps • Android Manifest • Activities and Fragments • Intents • AsyncTask

×