Using Volley to request a JSON response

Since JavaScript Object Notation (JSON) is probably the most common data-interchange format, you'll likely find yourself needing to call a JSON web service. (If you are unfamiliar with JSON, review the link at the end of this recipe.) This recipe will demonstrate how to make a JSON Request using Volley.

Getting ready

Create a new project in Android Studio and call it JSONRequest. Use the default Phone & Tablet option and select Empty Activity when prompted for Activity Type.

This recipe will be using the Volley setup as described in Getting started with Volley for Internet requests. Follow steps 1-5 to add Volley to your new project.

How to do it...

With Volley added to your project as described previously, follow ...

Get Android Application Development Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.