How to Create and Read JSON Data Files in Android SDK


show more Creating and reading JSON data files provides you with in-depth training on Developer. Taught by David Gassner as part of the Android SDK: Local Data Storage show less
please wait ...

Creating and reading JSON data files

JSON, or JavaScript Object Notation, is a concise structured data format. It's used in Android to move data around the web from server to device, but can also be used to save structured data locally to persistent storage. I'll show you how to use JSON in the Android SDK in this project: JSONDataFiles. The user interface for this version of the project has a very minimal set of controls: two buttons for creating and reading a file and one TextView object to display text.

I'll go to my MainActivity class and scroll down toward the bottom of the code and find the method createFile. In this version of my createFile method I already have code to create a file in internal storage--that is, a file that's local to the current application. But I'll add code here to create a JSON data packet. I'll place the cursor above any of the other code in the method, and I'll start by creating an instance of the class JSONArray. It's spelled J-S-O-N, in all uppercase, and then...

Creating and reading JSON data files
Video duration: 9m 48s 3h 41m Intermediate

Viewers:

Creating and reading JSON data files provides you with in-depth training on Developer. Taught by David Gassner as part of the Android SDK: Local Data Storage

Subject:
Developer
Software:
Android Java
Author:
please wait ...