Enviar búsqueda
Cargar
Android Network library
•
Descargar como PPTX, PDF
•
2 recomendaciones
•
1,560 vistas
Faren faren
Seguir
Android network library - retrofit - simple explanation how to use and best practice
Leer menos
Leer más
Software
Denunciar
Compartir
Denunciar
Compartir
1 de 14
Descargar ahora
Recomendados
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
Recomendados
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
Más contenido relacionado
La actualidad más candente
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
La actualidad más candente
(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
Similar a 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
Similar a 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 с рефлексией
Más de 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
Más de 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
Último
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
vyaparkranti
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
Christoph Pohl
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
31events.com
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Ahmed Mohamed
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
Christian Birchler
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Drew Moseley
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
andrehoraa
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
Lionel Briand
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
Dinusha Kumarasiri
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
confluent
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
rcbcrtm
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
OnePlan Solutions
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
smiwainfosol
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
Łukasz Chruściel
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
Devintelle Consulting Service Pvt Ltd Odoo OpenERP
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Natan Silnitsky
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
Tier1 app
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Mater
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
kalichargn70th171
Último
(20)
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
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
Descargar ahora