Suche senden
Hochladen
Android Network library
•
Als PPTX, PDF herunterladen
•
2 gefällt mir
•
1,560 views
Faren faren
Folgen
Android network library - retrofit - simple explanation how to use and best practice
Weniger lesen
Mehr lesen
Software
Diashow-Anzeige
Melden
Teilen
Diashow-Anzeige
Melden
Teilen
1 von 14
Jetzt herunterladen
Empfohlen
Facilite a vida com guava
Facilite a vida com guava
Romualdo Andre
Liquid Stream Processing Across Web Browsers and Web Servers
Liquid Stream Processing Across Web Browsers and Web Servers
Masiar Babazadeh
Android getting started
Android getting started
Uptech
Android webservices
Android webservices
Krazy Koder
Fault tolerant microservices - LJC Skills Matter 4thNov2014
Fault tolerant microservices - LJC Skills Matter 4thNov2014
Christopher Batey
LJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java Developers
Christopher Batey
Elasticsearch und die Java-Welt
Elasticsearch und die Java-Welt
Florian Hopf
Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2
VMware Tanzu
Empfohlen
Facilite a vida com guava
Facilite a vida com guava
Romualdo Andre
Liquid Stream Processing Across Web Browsers and Web Servers
Liquid Stream Processing Across Web Browsers and Web Servers
Masiar Babazadeh
Android getting started
Android getting started
Uptech
Android webservices
Android webservices
Krazy Koder
Fault tolerant microservices - LJC Skills Matter 4thNov2014
Fault tolerant microservices - LJC Skills Matter 4thNov2014
Christopher Batey
LJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java Developers
Christopher Batey
Elasticsearch und die Java-Welt
Elasticsearch und die Java-Welt
Florian Hopf
Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2
VMware Tanzu
Infinum Android Talks #18 - How to cache like a boss by Željko Plesac
Infinum Android Talks #18 - How to cache like a boss by Željko Plesac
Infinum
High Performance Python Microservice Communication
High Performance Python Microservice Communication
Joe Cabrera
VBA API for scriptDB primer
VBA API for scriptDB primer
Bruce McPherson
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Rick Copeland
Taking advantage of Prometheus relabeling
Taking advantage of Prometheus relabeling
Julien Pivotto
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Mike Nakhimovich
Node.js Stream API
Node.js Stream API
The Software House
Elk stack @inbot
Elk stack @inbot
Jilles van Gurp
Using script db as a deaddrop to pass data between GAS, JS and Excel
Using script db as a deaddrop to pass data between GAS, JS and Excel
Bruce McPherson
Building Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDB
MongoDB
人間では判定できない101すくみじゃんけんをコンピュータに判定させたい for Keras.js
人間では判定できない101すくみじゃんけんをコンピュータに判定させたい for Keras.js
KatsuyaENDOH
Diagnostics and Debugging
Diagnostics and Debugging
MongoDB
Testing Asynchronous Algorithms Exhaustively on node.js
Testing Asynchronous Algorithms Exhaustively on node.js
MaxMotovilov
Retrofit Technology Overview by Cumulations Technologies
Retrofit Technology Overview by Cumulations Technologies
Cumulations Technologies
Logic Equations Resolver J Script
Logic Equations Resolver J Script
Roman Agaev
Monitoring microservices with Prometheus
Monitoring microservices with Prometheus
Tobias Schmidt
Redis
Redis
Ptico
Mastering advanced concepts in Silverlight
Mastering advanced concepts in Silverlight
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
"The little big project. From zero to hero in two weeks with 3 front-end engi...
"The little big project. From zero to hero in two weeks with 3 front-end engi...
Fwdays
JSONSchema with golang
JSONSchema with golang
Suraj Deshmukh
Embracing the-power-of-refactor
Embracing the-power-of-refactor
Xiaojun REN
Client server part 12
Client server part 12
fadlihulopi
Weitere ähnliche Inhalte
Was ist angesagt?
Infinum Android Talks #18 - How to cache like a boss by Željko Plesac
Infinum Android Talks #18 - How to cache like a boss by Željko Plesac
Infinum
High Performance Python Microservice Communication
High Performance Python Microservice Communication
Joe Cabrera
VBA API for scriptDB primer
VBA API for scriptDB primer
Bruce McPherson
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Rick Copeland
Taking advantage of Prometheus relabeling
Taking advantage of Prometheus relabeling
Julien Pivotto
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Mike Nakhimovich
Node.js Stream API
Node.js Stream API
The Software House
Elk stack @inbot
Elk stack @inbot
Jilles van Gurp
Using script db as a deaddrop to pass data between GAS, JS and Excel
Using script db as a deaddrop to pass data between GAS, JS and Excel
Bruce McPherson
Building Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDB
MongoDB
人間では判定できない101すくみじゃんけんをコンピュータに判定させたい for Keras.js
人間では判定できない101すくみじゃんけんをコンピュータに判定させたい for Keras.js
KatsuyaENDOH
Diagnostics and Debugging
Diagnostics and Debugging
MongoDB
Testing Asynchronous Algorithms Exhaustively on node.js
Testing Asynchronous Algorithms Exhaustively on node.js
MaxMotovilov
Retrofit Technology Overview by Cumulations Technologies
Retrofit Technology Overview by Cumulations Technologies
Cumulations Technologies
Logic Equations Resolver J Script
Logic Equations Resolver J Script
Roman Agaev
Monitoring microservices with Prometheus
Monitoring microservices with Prometheus
Tobias Schmidt
Redis
Redis
Ptico
Mastering advanced concepts in Silverlight
Mastering advanced concepts in Silverlight
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
"The little big project. From zero to hero in two weeks with 3 front-end engi...
"The little big project. From zero to hero in two weeks with 3 front-end engi...
Fwdays
JSONSchema with golang
JSONSchema with golang
Suraj Deshmukh
Was ist angesagt?
(20)
Infinum Android Talks #18 - How to cache like a boss by Željko Plesac
Infinum Android Talks #18 - How to cache like a boss by Željko Plesac
High Performance Python Microservice Communication
High Performance Python Microservice Communication
VBA API for scriptDB primer
VBA API for scriptDB primer
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Taking advantage of Prometheus relabeling
Taking advantage of Prometheus relabeling
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Node.js Stream API
Node.js Stream API
Elk stack @inbot
Elk stack @inbot
Using script db as a deaddrop to pass data between GAS, JS and Excel
Using script db as a deaddrop to pass data between GAS, JS and Excel
Building Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDB
人間では判定できない101すくみじゃんけんをコンピュータに判定させたい for Keras.js
人間では判定できない101すくみじゃんけんをコンピュータに判定させたい for Keras.js
Diagnostics and Debugging
Diagnostics and Debugging
Testing Asynchronous Algorithms Exhaustively on node.js
Testing Asynchronous Algorithms Exhaustively on node.js
Retrofit Technology Overview by Cumulations Technologies
Retrofit Technology Overview by Cumulations Technologies
Logic Equations Resolver J Script
Logic Equations Resolver J Script
Monitoring microservices with Prometheus
Monitoring microservices with Prometheus
Redis
Redis
Mastering advanced concepts in Silverlight
Mastering advanced concepts in Silverlight
"The little big project. From zero to hero in two weeks with 3 front-end engi...
"The little big project. From zero to hero in two weeks with 3 front-end engi...
JSONSchema with golang
JSONSchema with golang
Ähnlich wie Android Network library
Embracing the-power-of-refactor
Embracing the-power-of-refactor
Xiaojun REN
Client server part 12
Client server part 12
fadlihulopi
servlets
servlets
Arjun Shanka
AJAX.pptx
AJAX.pptx
ssuser0a07a1
Ajax
Ajax
Yoga Raja
13 networking, mobile services, and authentication
13 networking, mobile services, and authentication
WindowsPhoneRocks
Android dev 3
Android dev 3
Aravindharamanan S
AJAX
AJAX
Gouthaman V
AJAX
AJAX
Gouthaman V
jQuery : Talk to server with Ajax
jQuery : Talk to server with Ajax
Wildan Maulana
Core Java tutorial at Unit Nexus
Core Java tutorial at Unit Nexus
Unit Nexus Pvt. Ltd.
Jason parsing
Jason parsing
parallelminder
Ajax - a quick introduction
Ajax - a quick introduction
Stefan Pettersson
Unit-5.pptx
Unit-5.pptx
itzkuu01
Ajax
Ajax
Svirid
Protocol-Oriented Networking
Protocol-Oriented Networking
Mostafa Amer
Writing and using Hamcrest Matchers
Writing and using Hamcrest Matchers
Shai Yallin
Connecting to the network
Connecting to the network
Mu Chun Wang
Qt Rest Server
Qt Rest Server
Vasiliy Sorokin
Василий Сорокин, Простой REST сервер на Qt с рефлексией
Василий Сорокин, Простой REST сервер на Qt с рефлексией
Sergey Platonov
Ähnlich wie Android Network library
(20)
Embracing the-power-of-refactor
Embracing the-power-of-refactor
Client server part 12
Client server part 12
servlets
servlets
AJAX.pptx
AJAX.pptx
Ajax
Ajax
13 networking, mobile services, and authentication
13 networking, mobile services, and authentication
Android dev 3
Android dev 3
AJAX
AJAX
AJAX
AJAX
jQuery : Talk to server with Ajax
jQuery : Talk to server with Ajax
Core Java tutorial at Unit Nexus
Core Java tutorial at Unit Nexus
Jason parsing
Jason parsing
Ajax - a quick introduction
Ajax - a quick introduction
Unit-5.pptx
Unit-5.pptx
Ajax
Ajax
Protocol-Oriented Networking
Protocol-Oriented Networking
Writing and using Hamcrest Matchers
Writing and using Hamcrest Matchers
Connecting to the network
Connecting to the network
Qt Rest Server
Qt Rest Server
Василий Сорокин, Простой REST сервер на Qt с рефлексией
Василий Сорокин, Простой REST сервер на Qt с рефлексией
Mehr von Faren faren
Design sprint slideshare
Design sprint slideshare
Faren faren
Microservices architecture
Microservices architecture
Faren faren
Functional Reactive Programming (FRP)
Functional Reactive Programming (FRP)
Faren faren
Java Play RESTful ebean
Java Play RESTful ebean
Faren faren
Java Play Restful JPA
Java Play Restful JPA
Faren faren
Product Design Sprint
Product Design Sprint
Faren faren
Mehr von Faren faren
(6)
Design sprint slideshare
Design sprint slideshare
Microservices architecture
Microservices architecture
Functional Reactive Programming (FRP)
Functional Reactive Programming (FRP)
Java Play RESTful ebean
Java Play RESTful ebean
Java Play Restful JPA
Java Play Restful JPA
Product Design Sprint
Product Design Sprint
Kürzlich hochgeladen
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
Safe Software
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
preethippts
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Matt Ray
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
Christoph Pohl
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Drew Moseley
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Stefano Stabellini
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
motivationalword821
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
ABSYZ Inc
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
Hanief Utama
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
Marharyta Nedzelska
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
31events.com
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
team-WIBU
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
Hr365.us smith
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
FerryKemperman
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
Andreas Kunz
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Rob Geurden
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
StefanoLambiase
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
BrainSell Technologies
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
vyaparkranti
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
qr0udbr0
Kürzlich hochgeladen
(20)
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
Android Network library
1.
Awesome Android Network Library
2.
Old Times -
Connect HTTP Protocol HttpParams httpParameters = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParameters, 10000); HttpConnectionParams.setSoTimeout(httpParameters, 5000); HttpClient client = new DefaultHttpClient(httpParameters); HttpGet post = new HttpGet(urlString); HttpResponse responseGET; try { responseGET = client.execute(post); HttpEntity resEntity = responseGET.getEntity(); if (resEntity != null) { String resEntityString = EntityUtils.toString(resEntity); return resEntityString; } } catch (Exception e) { e.printStackTrace(); }
3.
Old Times -
JSON Converter JSONObject jsonObject = new JSONObject(data); String questionId = jsonObject.getString(PARAMETER1); String questionName = jsonObject.getString(PARAMETER2); String questionOther = jsonObject.getString(PARAMETER3); JSONArray jarr = new JSONArray(jsonObject.getString(JSON_CONTENT)) ArrayList<ChoiceModel> choiceItem = new ArrayList<ChoiceItemModel>(); for (int i = 0; i < jarr.length(); i++){ JSONObject jo = jarr.getJSONObject(i); ChoiceItemModel item = new ChoiceItemModel(); item.setQuestionId(questionId); item.setChoiceName(jo.getString(JSON_CHOICE)); item.setChoiceOther(jo.getInt(JSON_CHOICE_OTHER)); surveyItem.add(item); }
4.
“Don’t reinvent the
wheel” — Naïve Man
5.
Butterknife Retrofit (Network) Picasso (Image
download and cache handler) RoboSpice (Asynchronous lib) Lombok RetroLambda Libs:
6.
Never again: HttpConnection Retrofit
7.
➢ Model (POJO) ➢
Interface Service ➢ Adapter / Call ➢ Converter such as GSON Retrofit
8.
public class Question
{ private String question; private String url; public String getQuestion() { return question; } public String getUrl() { return url; } } Retrofit (Model POJO)
9.
public interface RetrofitRequestService
{ @GET("/questions") Call<List<Question>> ques(); } Retrofit (Service Interface)
10.
Retrofit mRestAdapter =
new Retrofit .Builder() .baseUrl("http://private-9adb36-crashback.apiary-mock.com/") .addConverterFactory(GsonConverterFactory.create()) .build(); service = mRestAdapter.create(RetrofitRequestService.class); Retrofit (Adapter / Call)
11.
Call<List<Question>> call =
service.ques(); //call on another thread not in main thread call.enqueue(new Callback<List<Question>>() { @Override public void onResponse(Call<List<Question>> call, Response<List<Question>> response) { System.out.println("Question = " + response.body().get(0).getQuestion()); System.out.println("url = " + response.body().get(0).getUrl()); } @Override public void onFailure(Call<List<Question>> call, Throwable t) { } }); Retrofit (Adapter / Call)
12.
“Simple, it is
wrapped” — Naïve Man
13.
https://github.com/faren/Retrofit https://id.linkedin.com/in/farenfaren http://slideshare.net/farenfa attr
14.
faren.faren@gmail.com Dev Manager Tiket.com Ping
me
Jetzt herunterladen