Receiving json from twitter api,I am using the http protocol ...Below is the code.I have a text view to receive the information
public class JsonSample extends Activity {
TextView httpStuff;
HttpClient client;
JSONObject json;
final static String URL = "http://api.twitter.com/1/statuses/user_timeline.json?screen_name=twitter";
@Override
protected void onCreate(Bundl
i'm having a problem getting the json from pinterest it always error on the JSONArray part.
code
JSONArray bodyarray = null;
JSONParser jParser = new JSONParser();
JSONObject json = jParser.getJSONFromUrl(url);
Log.i("url",""+url);
Log.i("json",""+json);
try{
bodyarray = json.getJSONArray(TAG_body); <---- this is the error here "NullPointerException"
Log.i("JSON", ""+bodyarray);
I have a problem. I don't set JSONArray to Spinner. My JSON look ["category1","category2","category3"]
How to get this JSONArray to spinner?
I'm writing an android app I use a background thread to pull a JSONArray from a web service. I then need to interact with that JSONArray inside the main activity.
I have recently settup a php page on my server that runs through my database and outputs this onto the page.
JSONObject json = JSONfunctions.getJSONfromURL("http://abc.com/getjson.php");
try{
JSONArray myArray = json.getJSONArray("date");
for(int i=0;i<myArray.length();i++){
HashMap<String, String> map = new Hash
I am getting a JSON array from server, something like:-
[{"0":"13177","id":"13177",other key value pairs},{another object with key value},{ other JSON objects}]
Now I am taking this as a string variable text(by input stream), and doing something like:-
jsonpropertyarray=new JSONArray(text.trim());//jsonproperty is JSONArray variable
I have a method in this class to return JSONArray:
pu
Im pretty much a newbie at this so i could use some help to know why does my app keep crashing ?
I'm new here and with Android development.
I'm trying to make a slide gallery with ViewPager.
This is my main activity:
public class HomeActivity extends AbstractActivity {
ArrayList<ImageView> imagens = new ArrayList<ImageView>();
ViewPager slideshow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
i have a trouble with Json array, and I really hope there is someone can help me.
Lets say I have a class with json data and iam sending "intent putextra" to another activity.
how i can change the value of null before i send it to another activity?