An easy adapter to map JSON data to views defined in an XML layout
Java
Latest commit 03a032c Mar 24, 2013 @jgilfelt Merge pull request #1 from pyro2927/master
Allowing strings to be pulled from nested JSONObjects
Permalink
Failed to load latest commit information.
res
src/com/readystatesoftware/android Allowing strings from nested JSONObjects Mar 24, 2013
.classpath
.gitignore
.project
AndroidManifest.xml
LICENSE
README.markdown
proguard.cfg first commit Aug 18, 2011
project.properties

README.markdown

JSONArrayAdapter

An easy adapter to map JSON data to views defined in an XML layout.

Basically a drop-in replacement for and wrapper around android.widget.SimpleAdapter that maps data from a org.json.JSONArray instance.

Usage:

ListAdapter adapter = new JSONArrayAdapter(this,
                data,                                                   // JSONArray data                           
                android.R.layout.simple_list_item_2,                    // a layout resource to display a row
                new String[] {"from_user", "text"},                     // field names from JSONObjects
                new int[] {android.R.id.text1, android.R.id.text2},     // corresponding View ids to map field names to 
                "id"                                                    // id field from JSONObjects (optional)
);

getListView().setAdapter(adapter);

The code in this project is licensed under the Apache Software License 2.0.

Copyright (c) 2011 readyState Software Ltd.