How to Get Data From RESTful Webservice in Android Using JSON and OKHTTP

How to Get Data From RESTful Webservice in Android Using JSON and OKHTTP

Subscribe To My Channel and Get More Great Tutorials
http://www.youtube.com/subscription_center?add_user=sandeepbhandari1

This tutorial describes how to receiving JSON data from REST service in android.

We used OKHTTP instead of built in Http client as it has a lot of benefits and lots of functionality over the built in Http client. This is an open source library from the giant company “Sqaure”.
OKHTTP is an open source project designed to be an efficient HTTP client. It supports the SPDY protocol. SPDY is the basis for HTTP 2.0 and allows multiple HTTP requests to be multiplexed over one socket connection.

There are alternative libraries to OKHTTP, such as Volley. Volley is an open source library form Google and officially supported. As they mentioned on their website Volley offers the following benefits:

• Automatic scheduling of network requests.
• Multiple concurrent network connections.
• Transparent disk and memory response caching with standard HTTP cache coherence.
• Support for request prioritization.
• Cancellation request API. You can cancel a single request, or you can set blocks or scopes of requests to cancel.
• Ease of customization, for example, for retry and backoff.
• Strong ordering that makes it easy to correctly populate your UI with data fetched asynchronously from the network.
• Debugging and tracing tools.

OKHTTP Website: “http://square.github.io/okhttp/”
Volley Website: “https://developer.android.com/training/volley/index.html”

The code sample can be downloaded from following link:
http://www.indragni.com/android/GetJsonDataFromRestService.rar

►Android Developer Figurine◄
►Android Mini Collectible Figure (India): http://amzn.to/2CQRMXp
►Android Mini Collectible Figure (US): http://amzn.to/2CNO8Kk
►Android Mini Collectible Figures (India): http://amzn.to/2CRanmh
►Android Mini Collectible Figures (US): http://amzn.to/2CN6bmI

►New and Updated Android ASO Book◄
►Ultimate Guide to Android ASO: Boost android app (India): https://www.amazon.in/Ultimate-Guide-Android-ASO-android-ebook/dp/B0156P9YEQ
►Ultimate Guide to Android ASO: Boost android app (US): https://www.amazon.com/Ultimate-Guide-Android-ASO-android-ebook/dp/B0156P9YEQ

►Android Developer Books◄

►For Beginners◄
►Head First Android Development (India): http://amzn.to/2CQlZpB
►Head First Android Development (US): http://amzn.to/2lNRjtC
►Android Programming for Beginners (India): http://amzn.to/2CR6dKU
►Android Programming for Beginners (US): http://amzn.to/2F8zZsg
►Mastering Android Development with Kotlin (India): http://amzn.to/2m9R8tp
►Mastering Android Development with Kotlin (US): http://amzn.to/2F5ATFX
►Learning Java by Building Android Games (India): http://amzn.to/2CRaX3r
►Learning Java by Building Android Games (US): http://amzn.to/2CYYS8W

►For Experts◄
►Expert Android Programming (India): http://amzn.to/2D4MCUD
►Expert Android Programming (US): http://amzn.to/2CXf8qV
►Android Programming: The Big Nerd Ranch Guide (India): http://amzn.to/2Fbb7Qw
►Android Programming: The Big Nerd Ranch Guide (US): http://amzn.to/2F4LbWJ
►Android Cookbook (India): http://amzn.to/2COhzys
►Android Cookbook (US): http://amzn.to/2CHSmG3
►Murach’s Android Programming (India): http://amzn.to/2AB7GPL
►Murach’s Android Programming (US): http://amzn.to/2F4n76a
►Mastering Android NDK (India): http://amzn.to/2CMLY0S
►Mastering Android NDK (US): http://amzn.to/2F4M3KZ
►Android High Performance Programming (India): http://amzn.to/2Fc2Vzh
►Android High Performance Programming (US): http://amzn.to/2qAruCQ
►Advanced Android Application Development (India): http://amzn.to/2D3uvhv
►Advanced Android Application Development (US): http://amzn.to/2CzoBDM

►Android Developer Gadgets◄

►USB C Cable (India): http://amzn.to/2ACjEIw
►USB C Cable (US): http://amzn.to/2F2dZ22
►Anker Micro USB to USB C Adapter (India): http://amzn.to/2F9SFrD
►Anker Micro USB to USB C Adapter (US): http://amzn.to/2CzEFFH
►Samsung Gear S3 Frontier (India): http://amzn.to/2COVfWm
►Samsung Gear S3 Frontier (US): http://amzn.to/2D1A4gL
►Sony Android Auto Media Receiver (India): http://amzn.to/2m9ripv
►Sony Android Auto Media Receiver (US): http://amzn.to/2Ef7SX9

How to Get Data From RESTful Webservice in Android Using JSON and OKHTTP

How I Learned to Code – and Got a Job at Google!

How to learn to code: This is a story of how I learned to code and eventually became skilled enough to get a job at Google.

My Python tutorials for complete beginners: https://www.youtube.com/watch?v=Z1Yd7upQsXY&list=PLBZBJbE_rGRWeh5mIBhD-hhDwSEDxogDg
Keep in touch on Facebook: https://www.facebook.com/entercsdojo
Support me on Patreon: https://www.patreon.com/csdojo

Channel: CS Dojo
Published: 2017-11-30 04:05:22
Duration: 4M58S
Views: 623246
Likes: 22142
Favorites: 0

REST API concepts and examples

This video introduces the viewer to some API concepts by making example calls to Facebook’s Graph API, Google Maps’ API, Instagram’s Media Search API, and Twitter’s Status Update API.

/********** VIDEO LINKS **********/

Youtube’s Facebook Page via the Facebook Graph API
http://graph.facebook.com/youtube

Same thing, this time with filters
https://graph.facebook.com/youtube?fields=id,name,likes

Google Maps Geocode API call for the city of Chicago
http://maps.googleapis.com/maps/api/geocode/json?address=Chicago

Apigee Instagram API console
https://apigee.com/console/instagram

HTTP Request Methods
http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods

Postman Chrome Extension
https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en

Twitter’s Status Update documentation.
https://dev.twitter.com/docs/api/1.1/post/statuses/update

Channel: WebConcepts
Published: 2014-07-14 07:18:31
Duration: 8M53S
Views: 1876881
Likes: 21914
Favorites: 0

REST API & RESTful Web Services Explained

********************New Video*********************
Responsive Navbar with Bootstrap 4
https://youtu.be/L0uNai3XyKQ
****************************************************
What is REST API? REST stands for Representational State Transfer and API stands for Application Programming Interface.

Representational – the resource (image, page, video, profile) is represented by the web server to the client in any format like HTML, Image, JSON, XML etc.

State – the state of the application (web site) on a client’s computer changes as the client clicks from one link to the next. Ask the client clicks on the link, they request additional resources, and the application “state” changes.

Transfer – the transfer of resources from the web server to the client in a “representational” state which can be read by the client or implemented in the application program by the programmer. The transfer may also refer to the application state transfer as the client browses a web site.

API – application programming interface provides useful methods/functions which a programmer can implement into his own application in a chosen programming language like PHP. The API makes it easy for programmers to implement. It’s important to note that the response we get when sending REST API request will usually be in JSON, XML or other format which makes it easy to implement in the code and it’s not meant to be read immediately by a human being.

https://clevertechie.com/guides/96/what-is-rest-api-restful-web-services

*********************************************

( New Video! ) How to Create Transparent Drop Down Navigation Menu with CSS and HTML

https://youtu.be/8x1mO1d6-4w

*********************************************
“““““““““““““““““““““““““““““““““““““““““““““““

( Website ) https://clevertechie.com – PHP, JavaScript, WordPress, CSS, and HTML tutorials in video and text format with cool looking graphics and diagrams.

( YouTube Channel ) https://www.youtube.com/c/CleverTechieTube

( Google Plus ) https://goo.gl/J71p6f – clever techie video tutorials.

( Facebook ) https://www.facebook.com/CleverTechie/

( Twitter ) https://twitter.com/theclevertechie

“““““““““““““““““““““““““““““““““““““““““““““““

Channel: Clever Techie
Published: 2017-02-14 20:59:21
Duration: 15M33S
Views: 110161
Likes: 2095
Favorites: 0

Android REST web service tutorial with JSON

Android REST web service tutorial with JSON

Subscribe To My Channel and Get More Great Tutorials
http://www.youtube.com/subscription_center?add_user=sandeepbhandari1

This video tutorial shows how to consume a REST web service in an #android application. The REST web service returns JSON response. We display the JSON response from server and also parse the JSON string in Android application. This is the best example on how to consume RESTful #webservice in Android applications. The source code is available at http://www.indragni.com/android/RestfulWebServiceExample.zip
Subscribe To My Channel and Get More Great Tutorials
http://www.youtube.com/subscription_center?add_user=sandeepbhandari1

—————————————-­————
:

Google+: https://plus.google.com/u/0/b//posts?pageId=114543155372255472922

Android REST web service tutorial with JSON

Channel: Indragni Soft Solutions
Published: 2015-04-15 10:44:00
Duration: 25M32S
Views: 135682
Likes: 256
Favorites: 0

Consuming a RESTful WebService in Java

Video on Creating RESTful webservice in java

https://www.youtube.com/watch?v=EfEUDAHgrGQ

Creating a Java Client to consume RESTful webservice using Jersey Library.

Steps involved :
1. Download Jersey Library ( 2.x at the time of this video )
2. Copy Jersey client jars to your project and build path
3.Create a client using Client and ClientBuilder class
4.Set WebTarget ( WebService Resource URI) to the client
5. Get the response by specifying request type ( XML,JSON etc)
and HTTP Request Type ( GET,POST,PUT,DELETE)

Channel: yrrhelp
Published: 2015-06-23 14:53:08
Duration: 10M3S
Views: 90196
Likes: 317
Favorites: 0

Leave a Reply

Your email address will not be published. Required fields are marked *