july 9
Wednesday
notes from java I
http://javarevisited.blogspot.com/2011/12/java-string-replace-example-tutorial.html
http://docs.oracle.com/javase/6/docs/api/java/lang/String.html
http://www.java2s.com/Code/JavaAPI/java.lang/StringBufferreplaceintstartintendStringstr.htm
write code learn, meet peoplelocal meetups, explore the open source community
android has a culture that culture speaks java. but knowing java is not enough. getting your head around android requires learning many new ideas and techniques
write applications
learn and understand
there are three areas where our choices differ from what you might see elsewhere in the android community
we use anonymous inner classes for listeners
we find it makes for cleaner code (oopinion) it puts the listeners method implementations right where you want to see them. in high performance contets anonymous inner classes may cause problems but for most circumstances they work fine.
after we introduce fragments in chapter 7 we use them for all user interfaces.
fragments have clear advantages over activities that make them worth the effort, including flexibility in building and presenting your ui
we write apps to be compatible with gingerbread and froyo devices
the android platform has changed with the introduction of ice cream sandwich and jellybean and soon key lime pie.we intentionally take you through the difficulties involved in writing apps that are backwards compatible with froyo or at least gingerbread. in a real world gingerbread still makes up more than 40% of the market.
geoquiz- fundamentals of projects activities layouts and explicit intents.
criminalintent- the largest app in the book keep a record of your colleages lapses around the office you will learn to uuse fragments masterdetail interfaces list backed interfaces menus the camera implicit intents and more
hellomoon-in this small shrine to the Apollo program we learn about fragments media playback resources and localization
nerdlauncher-building this custom launcher you will see the intent system and tasks
remotecontrol- in this toy app you will learn to use styles state list drawables and other tools to create attractive ui
photogallery- a flickr client that downloadsand displays photos from flickrs public fee, this app will take you through services multithreading accessing web services and more
draganddraw- in this simple drawing appyou wil learn about handling touch events and creating custom views.
runtracker- this app lets you track and display a map on your travels around town. in it you will learn how to use location SQLite databases loaders and maps
figure 1.2 a relationship between the xml and an instance of the activity class called quiz activity
figure 1.3 the new android application wizard from file new android applicationproject in the eclipse ADT android sdk notice the package name uses reverse dns convention in which the domain name of your organization is reversed and suffixed with further identifiers. this convention keeps package names unique and ddistinguishes applications from each other on a device and on google play.
figure 1.4 is configuring the new android app project figure 1.5 dialog of creating activities of three types: blank, fullscreen and master/detail flow
as of adt 21 the xml version tag is no longer required
<? sml version"1.0" encoding="utf-8"?>
thedefault activity layout defines two widgets a relativelayout and a textview
widgets are the building blocks you use to compose a user interface. buttons text input controls and check boxes are all types of widgets. a widget can show text or graphics, interact with a user, or arrange other widgets on the screen.
the android sdk includes many widgets that you can configure yourself.