0
ProgrammingChristopher League30 November 2011
Links for later●    eclipse.org/    Integrated Development Environment for Java●    developer.android.com/    Complete dev...
Teach Yourself Java in 21 seconds●    All code is in the context of a class●    Class can contain fields, methods, inner c...
Eclipse
Eclipse toolbarRun » Run        Android SDK   Android Virtual(Ctrl+F11)       Manager       Device Manager
AVD, AVD, wherefore art thee?
Importing an Eclipse project●    Download: http://bit.ly/liu-android-zip●    Eclipse menu: File » Import●    Import source...
Importing an Eclipse project●    Select archive file: browse to downloaded    league-liu-android-blahblah.zip●    Select a...
open FloodPuz » FloodPuzActivity
Run, select device
Check progress in console
Check progress in console
Activities●    Roughly:    each UI screen    in your app    is an activity
Activities●    Multiple activities sequenced using back stack
Layouts, views, & widgets
Layouts, views, & widgets
Event-based programming::
Starting a new project●    File » New » Project●    Android » Android Project (Next)●    Project name: MyApp (Next)●    Ta...
Initial files
XML Layout editor
XML Layout editor●    Drag a button onto the layout●    Right-click “hello” text, edit ID
Access widgets in Java code          Source » Organize Imports          (Ctrl+Shift+O) to fix
Access widgets in Java codeOr, get this code athttps://gist.github.com/1410641
Next steps●    Try to extend my projects, especially SketchBot●    Additional colors●    Draw shapes instead of just lines...
Docs are your friends
Programming Android
Upcoming SlideShare
Loading in...5
×

Programming Android

477

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
477
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Programming Android"

  1. 1. ProgrammingChristopher League30 November 2011
  2. 2. Links for later● eclipse.org/ Integrated Development Environment for Java● developer.android.com/ Complete developer’s guide and reference● slidesha.re/soQgoZ These slides● github.com/league/android2011/ Source code for my sample apps
  3. 3. Teach Yourself Java in 21 seconds● All code is in the context of a class● Class can contain fields, methods, inner classes● Static pertains to class itself, not every object● All objects are references, and can be null● Inherit and override methods from base classes● Import classes from library packages● The rest is mostly the same as C/C++/C#● Beginners should use an IDE, such as Eclipse
  4. 4. Eclipse
  5. 5. Eclipse toolbarRun » Run Android SDK Android Virtual(Ctrl+F11) Manager Device Manager
  6. 6. AVD, AVD, wherefore art thee?
  7. 7. Importing an Eclipse project● Download: http://bit.ly/liu-android-zip● Eclipse menu: File » Import● Import source: General » Existing Projects
  8. 8. Importing an Eclipse project● Select archive file: browse to downloaded league-liu-android-blahblah.zip● Select all; Finish
  9. 9. open FloodPuz » FloodPuzActivity
  10. 10. Run, select device
  11. 11. Check progress in console
  12. 12. Check progress in console
  13. 13. Activities● Roughly: each UI screen in your app is an activity
  14. 14. Activities● Multiple activities sequenced using back stack
  15. 15. Layouts, views, & widgets
  16. 16. Layouts, views, & widgets
  17. 17. Event-based programming::
  18. 18. Starting a new project● File » New » Project● Android » Android Project (Next)● Project name: MyApp (Next)● Target: Android 4.0 (Next)● Package name: net.liucs (Next)● Finish
  19. 19. Initial files
  20. 20. XML Layout editor
  21. 21. XML Layout editor● Drag a button onto the layout● Right-click “hello” text, edit ID
  22. 22. Access widgets in Java code Source » Organize Imports (Ctrl+Shift+O) to fix
  23. 23. Access widgets in Java codeOr, get this code athttps://gist.github.com/1410641
  24. 24. Next steps● Try to extend my projects, especially SketchBot● Additional colors● Draw shapes instead of just lines● Save drawing across application switch
  25. 25. Docs are your friends
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×