Android Made Simple
-
Upload
gabriel-dogaru -
Category
Technology
-
view
1.021 -
download
0
description
Transcript of Android Made Simple
![Page 1: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/1.jpg)
Made SimpleMade Simple
![Page 2: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/2.jpg)
Who am I?Who am I?
Gabriel Dogaru
– Ex software developer at Synygy
– Ex software engineer at Amazon
– Co-founder TAGonSoft
Gabriel Dogaru
– Ex software developer at Synygy
– Ex software engineer at Amazon
– Co-founder TAGonSoft
![Page 3: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/3.jpg)
AgendaAgenda
● Why Android
● Small Android overview
● Leverage the power of java frameworks with Android
● Why Android
● Small Android overview
● Leverage the power of java frameworks with Android
![Page 4: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/4.jpg)
What is Android?What is Android?
“Android is a software stack for mobile devices
that includes an operating system, middleware
and key applications”
“Android is a software stack for mobile devices
that includes an operating system, middleware
and key applications”
![Page 5: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/5.jpg)
Why Android?Why Android?
![Page 6: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/6.jpg)
Why Android?Why Android?
● http://www.guardian.co.uk/technology/appsblog/2012/aug/16/android-winning-apps-china-smartphone is Android?● http://www.guardian.co.uk/technology/appsblog/2012/aug/16/android-winning-apps-china-smartphone is Android?
![Page 7: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/7.jpg)
Why Android?Why Android?
● http://www.guardian.co.uk/technology/appsblog/2012/aug/16/android-winning-apps-china-smartphone is Android?● http://www.guardian.co.uk/technology/appsblog/2012/aug/16/android-winning-apps-china-smartphone is Android?
![Page 8: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/8.jpg)
Why write native Android?Why write native Android?
![Page 9: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/9.jpg)
Why Native Android?Why Native Android?
Indeed job trends 28.10.2012Indeed job trends 28.10.2012
![Page 10: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/10.jpg)
Why Native Android?Why Native Android?
Indeed job trends 28.10.2012Indeed job trends 28.10.2012
![Page 11: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/11.jpg)
Why Native Android?Why Native Android?
Respect your userRespect your user
![Page 12: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/12.jpg)
Who is Android?Who is Android?
![Page 13: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/13.jpg)
Who is Android?Who is Android?
![Page 14: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/14.jpg)
Who is Android?Who is Android?
![Page 15: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/15.jpg)
Who is Android?Who is Android?
![Page 16: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/16.jpg)
Android ArchitectureAndroid Architecture
![Page 17: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/17.jpg)
Android ArchitectureAndroid Architecture
![Page 18: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/18.jpg)
Android KernelAndroid Kernel
![Page 19: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/19.jpg)
Native librariesNative libraries
![Page 20: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/20.jpg)
Android RuntimeAndroid Runtime
![Page 21: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/21.jpg)
Application FrameworkApplication Framework
![Page 22: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/22.jpg)
ApplicationsApplications
![Page 23: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/23.jpg)
● Activity
● Intent Receiver
● Service
● ContentProvider
● Activity
● Intent Receiver
● Service
● ContentProvider
Building BlocksBuilding Blocks
![Page 24: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/24.jpg)
ActivityActivity
● A single, focused thing that the user can do
● Provides a screen with which users can interact in order
to do something
● A single, focused thing that the user can do
● Provides a screen with which users can interact in order
to do something
![Page 25: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/25.jpg)
●Intent ReceiverIntent Receiver
● Handle the broadcast intents● Handle the broadcast intents
![Page 26: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/26.jpg)
ServiceService
● Can perform long-running operations in the background
and does not provide a user interface
● A component can bind to a service to interact with it
● Can perform long-running operations in the background
and does not provide a user interface
● A component can bind to a service to interact with it
![Page 27: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/27.jpg)
Content providerContent provider
● Enable applications to share data● Enable applications to share data
![Page 28: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/28.jpg)
IntentIntent
● Passive data structure holding an abstract description of
an operation to be performed
● Used to start your activities
● Used to start external applications
● Passive data structure holding an abstract description of
an operation to be performed
● Used to start your activities
● Used to start external applications
![Page 29: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/29.jpg)
That's just old stuff from 2008That's just old stuff from 2008
● http://developer.android.com
● http://www.youtube.com/results?search_query=androidology
● blogs++
● http://developer.android.com
● http://www.youtube.com/results?search_query=androidology
● blogs++
![Page 30: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/30.jpg)
How about my handy Java frameworks?How about my handy Java frameworks?
![Page 31: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/31.jpg)
The Best Programmers Are The Best Programmers Are LazyLazy and Dumb ?!?!? and Dumb ?!?!?
![Page 32: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/32.jpg)
Android annotationsAndroid annotations
![Page 33: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/33.jpg)
Helps with activitiesHelps with activities
@NoTitle@Fullscreen@EActivity(R.layout.bookmarks)public class BookmarksToClipboardActivity extends Activity { @ViewById ListView bookmarkList; @ViewById EditText search; @AfterViews void initBookmarkList() { search.setText(??);//..... }
![Page 34: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/34.jpg)
Helps with eventsHelps with events
//.....
@Click( {R.id.button1, R.id.button2})
void updateBookmarksClicked() {
searchAsync(search.getText().toString(),userid);
}
@ItemClick
void bookmarkListItemClicked(Bookmark selectedBookmark) {
clipboardManager.setText(selectedBookmark.getUrl());
}
//.....
//.....
@Click( {R.id.button1, R.id.button2})
void updateBookmarksClicked() {
searchAsync(search.getText().toString(),userid);
}
@ItemClick
void bookmarkListItemClicked(Bookmark selectedBookmark) {
clipboardManager.setText(selectedBookmark.getUrl());
}
//.....
![Page 35: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/35.jpg)
Helps with preferences Helps with preferences
@SharedPref
public interface MyPrefs {
@DefaultString("John")
String name();
@DefaultInt(42)
int age();
long lastUpdated();
}
…...............................
@EActivity
public class MyActivity extends Activity {
@Pref
MyPrefs_ myPrefs;
}
@SharedPref
public interface MyPrefs {
@DefaultString("John")
String name();
@DefaultInt(42)
int age();
long lastUpdated();
}
…...............................
@EActivity
public class MyActivity extends Activity {
@Pref
MyPrefs_ myPrefs;
}
![Page 36: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/36.jpg)
Helps with Rest ServicesHelps with Rest Services
@Rest("http://tagonsoft.ro/")
public interface CodecampClient {
@Get("codecamp.php")
@Accept(MediaType.APPLICATION_JSON)
Codecamp getEventData();
@Post("feedback.php")
void sendFeedback(Feedback feedback);
RestTemplate getRestTemplate();
}
@Rest("http://tagonsoft.ro/")
public interface CodecampClient {
@Get("codecamp.php")
@Accept(MediaType.APPLICATION_JSON)
Codecamp getEventData();
@Post("feedback.php")
void sendFeedback(Feedback feedback);
RestTemplate getRestTemplate();
}
![Page 37: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/37.jpg)
Got ORM? OrmLite Got ORM? OrmLite
@DatabaseTable(tableName = "sessions")
public class Session {
@DatabaseField(id = true, columnName = "_id")
long id;
//....
}
//....
TableUtils.createTable(connectionSource, Session.class);
//....
dbHelper.getSessionDao().create(session);
dbHelper.getSessionDao().queryForId(sessionID);
@DatabaseTable(tableName = "sessions")
public class Session {
@DatabaseField(id = true, columnName = "_id")
long id;
//....
}
//....
TableUtils.createTable(connectionSource, Session.class);
//....
dbHelper.getSessionDao().create(session);
dbHelper.getSessionDao().queryForId(sessionID);
![Page 38: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/38.jpg)
And it all builds upAnd it all builds up
![Page 39: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/39.jpg)
So?So?
● Android is the world's most popular mobile platform
● Writing Android code can be fun and easy
● developer.android.com is your friend
● You can download example Codecamp app source code from
https://bitbucket.org/gdogaru/codecamp_android
● Android is the world's most popular mobile platform
● Writing Android code can be fun and easy
● developer.android.com is your friend
● You can download example Codecamp app source code from
https://bitbucket.org/gdogaru/codecamp_android
![Page 40: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/40.jpg)
![Page 41: Android Made Simple](https://reader033.fdocuments.in/reader033/viewer/2022051312/54638eacb4af9f623f8b45a0/html5/thumbnails/41.jpg)
Thank You!Thank You!
Please fill in the evaluation formsPlease fill in the evaluation forms
tagonsoft.ro