Questions tagged [android-json]

JSON stands for (Java Script Object Notation). It is a simple and light-weight data interchange format that can be easily read by humans and machines.Android includes the org.json library which allow working efficiently with JSON. This provides easy parsing of JSON data and creating JSON strings

577 questions
0
votes
0 answers

pass string on marker click

I'm trying to pass Strings comes from json array I tried this code mMap.setOnMarkerClickListener(new OnMarkerClickListener() { public void onInfoWindowClick(Marker marker) { Toast.makeText(Newtab.this,"MARKER clicked",…
0
votes
1 answer

Android get Wrong result using Json Post data

in this simple code i'm sending username and password to server. if those are correct i must be get this result : {"code":"1","credit":100000,"number":["500000072207"]} but i get: 10-02 14:16:52.280 2299-2318/com.ms.app.ms E/Content﹕…
user4001049
0
votes
1 answer

Android Estabilish Connection error for seng Json Request

i simple code to send requset data to server using Json Object with sample on web. after loading requet URL i get successfull result . but i can not send any request from andrid application and i get this error:Cannot Estabilish Connection My result…
user4001049
0
votes
1 answer

Posting Json object as parameter with http

I need to post some data to a server in this format dates: [{...},{...},{...}] So far I have done this for(RepeatEventItem item : selected_dates){ pEntity.addPart("dates[]", new StringBody(mapper.writeValueAsString(item))); } and the resulting…
0
votes
0 answers

How to convert Android Json String to json object in most efficient way

I have following two string with me String macId= "484487E3A0AC",484487E3FG55,484487E3A0FG,484487HJKL90,484487EKLJK9; String movieList="Cast Away"; I want to send it to my server as json Object, I am able to achieve it when I send it as single…
Android4Fun
  • 570
  • 4
  • 18
0
votes
0 answers

Android base64 String sending to servlet not working

My Android Code : HttpClient client=new DefaultHttpClient(); HttpPost request=null; for(StudentInfo stdInfo : stdInfoList) { JSONObject reqObject=dao.createjsonreq(stdInfo); StringEntity requestSet = new…
kks
  • 342
  • 5
  • 25
0
votes
1 answer

ListView Not Updating After Getting data and attaching it

I've a ListFragment, and in the class file, I retrieve a Database data and converted it to JSON. It's working fine and I even Log the result and it showed me the result, but nothing happens after the Log, it just wouldn't show me anything after…
user4054641
0
votes
0 answers

Issue with If-statement in getting data from MySQL

I'm trying to populate ListView with data from MySQL. I used this tutorial. Here I want to get data only when rating is equal to 3. I try this, but it doesn't work. I don't really understand how JSON works. Probably I can't get the same value from…
Bulva
  • 1,208
  • 14
  • 28
0
votes
1 answer

Separating JSONObjects with different values but same String Key. How do I separate them?

I am trying to separate the JSONObjects that come from the same String Key "serving_description" (that is what I believe it is called) into their own list item. There are 5 "serving_description"'s but they are all different. I have it displaying…
Eugene H
  • 3,520
  • 3
  • 22
  • 39
0
votes
2 answers

Getting all of the requested JSONObjects of a JSONArray. It is only displaying the last JSONObject

JSON is only displaying the last object '100 g' of "serving_description" in the JSON Formatted Data, See below. instead of all of the "serving_description" objects. The Array is serving If you look at the JSON Formatted Data below you will see…
Eugene H
  • 3,520
  • 3
  • 22
  • 39
0
votes
1 answer

Android Switch-Case Statement Performance

I am new to Android Development. I've been spending a lot of time trying to have my ExpandableListView checkbox states saved to the Sharedpreferences, but I am having so much trouble with it. I am coming to an end to the solution, and I think the…
YRTM2014
  • 165
  • 1
  • 8
0
votes
0 answers

android - read arabic from local json file

please someone help me , i try read arabic string from json file the code i use it , i try read multi-lines of arabic language public String loadJSONFromAsset() { String json = null; try { InputStream is =…
Mina Fawzy
  • 20,852
  • 17
  • 133
  • 156
0
votes
1 answer

String cannot be converted to JSON Object

When I am fetching data from local database, I am getting value in a Json object and its converting it into String and the result can be seen in local server. But..when i am executing the same code on the live database, the data cannot be converted…
Ashutosh
  • 125
  • 1
  • 11
0
votes
2 answers

Create JSON android

I want to have an output like this {"content":{ "A":["a1","a2","a3"], "B":"b1String", "C":["c1","c2"]}} As of now, I am getting this. {"content":{ "A":"[a1, a2, a3]", "C":"[c1, c2]", "B":"b1String"}} Below is my…
kads
  • 112
  • 1
  • 10
0
votes
1 answer

JsonArray to List in Java

I have a problem with parsing JsonArray response. I take JsonObject from JsonArray, parse it and set in entity message and then that message add to ArrayList. Problem is that in ArrayList that I want to return I always have only one message. This…
MalaAiko
  • 151
  • 4
  • 11