Skip to content
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
Failed to load latest commit information.
res first commit Aug 18, 2011
src/com/readystatesoftware/android
.classpath update for tools r14 Oct 30, 2011
.gitignore first commit Aug 18, 2011
.project
AndroidManifest.xml first commit Aug 18, 2011
LICENSE first commit Aug 18, 2011
README.markdown
proguard.cfg first commit Aug 18, 2011
project.properties update for tools r14 Oct 30, 2011

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.

Something went wrong with that request. Please try again.