practical android course part iii - rest api with aquery, preferences, android studio
DESCRIPTION
Entire course: http://soldiersofmobile.com/android-course/ Introduction to: - REST API - AQuery lib (AJAX Calls) - Shared Preferences + homework Source code used can be found at: https://github.com/smdremedy/kni-lunchtime This is a third part of Practical Android Course conducted at Warsaw University of Technology.TRANSCRIPT
![Page 1: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/1.jpg)
ANDROID III
![Page 2: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/2.jpg)
CONTACTSYLWESTER MADEJ@[email protected]
![Page 3: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/3.jpg)
TODAY'S MISSION● Embrace The Android Studio● Learn how REST API works● Get to know AQuery● Save data on device with Preferences● Work with Cookies
![Page 4: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/4.jpg)
RESTfull WEB API● Used by more and more● REpresentational State Transfer● HTTP Verbs: GET, POST, PUT,DELETE● Test: Postman (chrome), REST Client (FF)
![Page 5: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/5.jpg)
AQuery● https://code.google.com/p/android-query/
“Android-Query (AQuery) is a light-weight library for doing asynchronous tasks and manipulating UI elements in Android. Our goal is to make Android
coding simpler, easier, and more fun!”
![Page 6: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/6.jpg)
AQuery – AJAX POSTMap<String, Object> params = new HashMap<String, Object>();
params.put("q", "androidquery");
aq.ajax("http://search.twitter.com/search.json", params, JSONObject.class,
new AjaxCallback<JSONObject>() {
@Override public void callback(String url, JSONObject json, AjaxStatus status) { } });
![Page 7: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/7.jpg)
AQuery – Images● Async ImageView load from url
//load an image to an ImageView from network, cache image to file and memory
aq.id(R.id.image1).image("http://www.vikispot.com/z/images/vikispot/android-w.png");● Cache in mem and storage● Reduce size● Provide placeholders
![Page 8: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/8.jpg)
DEMO
Go, Go, Go!● Details layout● Login● Save session and user_id● Load items● Place and cancel orders● Show image● Logout
![Page 9: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/9.jpg)
TOOLS: HIERARCHY VIEWER
Second approach :)
![Page 10: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/10.jpg)
HOMEWORK IIIHomework:
Do Tumblr browser for http://wehavethemunchies.tumblr.com/
Use Tumblr REST API (free signup required)
http://www.tumblr.com/docs/en/api/v2
Try to make it simillar to web (display links, maybe tags).
Pro version: Do endless scroll!
![Page 11: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/11.jpg)
NEXT MISSION● Suntan ;)● Introducing: Gram of Art● UI pro tips from Paweł
![Page 12: Practical Android Course Part III - REST API with AQuery, Preferences, Android Studio](https://reader034.vdocuments.mx/reader034/viewer/2022052316/5588f5a2d8b42a59138b4716/html5/thumbnails/12.jpg)
FOR MORE GO TO:SoldiersOfMobile.com