Programming Android

Uploaded on


More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. ProgrammingChristopher League30 November 2011
  • 2. Links for later● Integrated Development Environment for Java● Complete developer’s guide and reference● These slides● Source code for my sample apps
  • 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. Eclipse
  • 5. Eclipse toolbarRun » Run Android SDK Android Virtual(Ctrl+F11) Manager Device Manager
  • 6. AVD, AVD, wherefore art thee?
  • 7. Importing an Eclipse project● Download:● Eclipse menu: File » Import● Import source: General » Existing Projects
  • 8. Importing an Eclipse project● Select archive file: browse to downloaded● Select all; Finish
  • 9. open FloodPuz » FloodPuzActivity
  • 10. Run, select device
  • 11. Check progress in console
  • 12. Check progress in console
  • 13. Activities● Roughly: each UI screen in your app is an activity
  • 14. Activities● Multiple activities sequenced using back stack
  • 15. Layouts, views, & widgets
  • 16. Layouts, views, & widgets
  • 17. Event-based programming::
  • 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. Initial files
  • 20. XML Layout editor
  • 21. XML Layout editor● Drag a button onto the layout● Right-click “hello” text, edit ID
  • 22. Access widgets in Java code Source » Organize Imports (Ctrl+Shift+O) to fix
  • 23. Access widgets in Java codeOr, get this code at
  • 24. Next steps● Try to extend my projects, especially SketchBot● Additional colors● Draw shapes instead of just lines● Save drawing across application switch
  • 25. Docs are your friends