Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Android REST Client

1,610 views

Published on

good pattern for android REST application

Published in: Technology, Design
  • Login to see the comments

Android REST Client

  1. 1. @omayib omayib@gmail.com Facebook.com/omayib 75278432 omayib@gmail.com arul_sip@yahoo.com Arif Akbarul Huda Penulis Buku Mobile Apps Developer (android)
  2. 2. Buku ini cocok untuk buat mahasiswa yang pengen belajar membuat aplikasi android secara real. Dan nggak tanggung-tanggung, 9 Aplikasi yang bakal dibuat. Sangat excited baca buku ini, sambil buka editor tentunya. Pokoknya “Learning by Coding”!! Yanuar Waskito (Alumni Universitas TELKOM Bandung) pembayaran & buku dapat diambil di Kantor Technoporia dan Imagine IT Education Center (depan Goeboex Cafe Seturan Yogyakarta) pada tanggal 21-23 April 2014 | http://technophoriajogja.com omayib.com atau bit.ly/bukuandroid @omayib omayib@gmail.com Facebook.com/omayib 75278432 omayib@gmail.com arul_sip@yahoo.com
  3. 3. Program Pelatihan on Class ● 9 x pertemuan ● Biaya (PM) ● Tempat : Technoporia Building Depan Goebox Cafe Seturan) ● Waktu : soon! omayib.com atau bit.ly/bukuandroid @omayib omayib@gmail.com Facebook.com/omayib 75278432 omayib@gmail.com arul_sip@yahoo.com
  4. 4. Agenda REST ? REST API example REST vs mobile website Incorect REST method implementation Solution conclussion #TechTalk21
  5. 5. internet HTTP GET,POST,PUT,DELETE dll Respon JSON/XML R.E.S.T Client Server Architechture Style Exchange Resources Broadly Adapted Commonly Used Over HTTP 1 2 3 4
  6. 6. https://api.foursquare.com/v2/venues/explore? limit=5&radius=3000&client_id=XS31V2WUHH45OXFCVNOZWJHXSW2GHSLQK55N UXMP4PVOIXPV&client_secret=1IOYKRN5CYO54RFMYSPMQKZA3VGXEKJQG43B 0BJPEKRRV2L2&v=20130815&ll=-7.787874,110.367908&section=kuliner&time=any REST API example RESPON
  7. 7. REST vs Mobile website?
  8. 8. 1. Integration with platform 2. run in background 3. consistent UI 4. user prefer native apps Advantages Native Apps and REST
  9. 9. REST method implementation
  10. 10. Activity / UI thread Worker thread REST REQUEST Incorect REST method implementation
  11. 11. WHY INCORECT ??
  12. 12. Infromasi Lab .. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ac venenatis est,, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ac venenatis est,, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ac venenatis est,, Pengumuman Praktikum OS my shut down process => killed during transaction WHY ?? KILLED
  13. 13. Keyword : asynctaks, service, asyncadapter
  14. 14. ● an intelligent Thread that is advised to be used. Intelligent as it can help with it’s methods, and there are two methods that run on UI thread, which is good to update UI components. ● Call from UI thread ● Not for long brackground threat AsyncTaks
  15. 15. ● run in background ● no UI ● run on UI thread (steel need worker thread) Service
  16. 16. ● Plugin architechture ● Automated execution ● Automated network checking ● Improved battery performance ● Account management and authentication SyncAdapter
  17. 17. Good Pattern
  18. 18. good pattern using SERVICE– Activity-UI thread Service helper service-UI thread Workter thread Content observer respone handler parser notify CRUD Content provider
  19. 19. Activity + cursor loader Content provider Sync adapter Network layer CRUD Get Data for sync Update cache Content observer notification Server request good pattern using SYNCADAPTER–
  20. 20. Asyncatks : http://stackoverflow.com/questions/2531336/asynctask-wont-stop-even-when-the-activity-has-destroyed

×