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
3 answers

How to get the value form json object inside form another json object where keys aye dynimic

I want to get the value from below json response. I am able to get the value from first key but not anther key object. I want to get the value of all url but no of url is dynamic and key too. Below is json response: I am able to get the value of…
user3154663
  • 291
  • 1
  • 2
  • 18
0
votes
1 answer

Adding values to Json Object

My JsonArray structure is like this: resultArray = [ { "key1": [], "key2": "keyval", "key3": "keyVal" }, { "key1": [], "key2": "keyval", "key3": "keyVal" }, { "key1": [], "key2": "keyval", "key3": "keyVal" } ] I…
brig
  • 3,721
  • 12
  • 43
  • 61
0
votes
0 answers

How to get subscription expiry date in android?

I am trying to get subscription expiry date using purchase status API (https://www.googleapis.com/androidpublisher/v1.1/applications/packageName/subscriptions/subscriptionId/purchases/token) but getting below response.May I know what is the correct…
0
votes
0 answers

AsyncTask not working when fetching data from server

I am working on a project.. when i have run my project in 2.2 version avd its work fine in my way.... but when i used AsyncTask in my code and run on 4.0 version avd its not work properly... i have found following errors in my logcat Error parsing…
Amardeepvijay
  • 1,626
  • 3
  • 17
  • 47
0
votes
1 answer

Trouble calling REST ws from android app

I'm calling a web service using the following code: protected Boolean doInBackground(Void... params) { int resCode; String uri = "http://myServer:8080/api/activities/post"; HttpPost request = new HttpPost(uri); …
GVillani82
  • 17,196
  • 30
  • 105
  • 172
0
votes
4 answers

Retrieving contact number from JSON to send SMS

I have contact numbers in local JSON file. And I have to send SMS by retrieving the contact number from JSON. I have no idea how to make it work, please help me. My JSON file: {"Person Name": "abc", "Person Phone": "1234567890"} Here is my method…
0
votes
1 answer

Download information efficiently in android , Service

What is the best way to download updated in JSON format information, I am using a service in android which every 4 seconds will be downloading a JSON, and then this information is displayed in a listview but my problem is that this service consumes…
user3236034
  • 463
  • 3
  • 6
  • 14
0
votes
1 answer

GSON how do I test for an key/value pair without throwing a null pointer exception

I have a JsonArray of elements and I want to check each object in the array for a field "video" some items in the array will not have the key, some will have the key and it will be null, I want to only find the elements that have the key and it is…
Brian
  • 4,328
  • 13
  • 58
  • 103
0
votes
1 answer

Json-Android Getting error while calling values

My Json Array of object is looks as [{"Temp_Password":"arun111","Password":""}] In my Android code I have been used AsyncTask task to execute HTTP request, In preexecute method() by using toast I can get this as…
arun
  • 3,497
  • 3
  • 14
  • 9
0
votes
2 answers

Android and jsonParsing using api did not work

I am trying to do some android simple jsonParsing app using the jsonObject and jSONArray to display some data on the emulator. But the problem is that the system force close and give an can anyone help me ???? Log Cat 03-07 08:57:58.781:…
user3006788
  • 165
  • 1
  • 14
  • 30
0
votes
2 answers

How do I access this JSON Array in Java?

This is what I have, but the number of children never prints out. I'm getting the raw JSON, then making a JSONArray, accessing the second member's children. What am I missing here? I have similar code that works perfectly, only difference is in the…
sanghas26
  • 161
  • 1
  • 2
  • 10
0
votes
1 answer

Open and edit value in JsonObject

I have local Json file in asset folder. I use this code to open file try { is = getAssets().open("data.json"); int size = is.available(); byte[] buffer = new byte[size]; is.read(buffer); is.close(); …
0
votes
2 answers

Passing this URL to my httpget is returning null. Tried every way

I have been trying for hour every possible method on this forum but no luck. PLEASSE help I have the following server url String url =…
Snake
  • 14,228
  • 27
  • 117
  • 250
0
votes
4 answers

HTTPPOST returns 404 ANDROID

Im trying to post to a REST API json object but i keep getting responce 404 but the url is working fine. Can anyone tell me why is this happeninig? Here is my code: new AsyncTask() { @Override protected…
Darko Petkovski
  • 3,892
  • 13
  • 53
  • 117
0
votes
1 answer

Send data to server and handle response - Android

I'm trying to post data to a this webservice, but seems I cannot get this right! So Im trying to post json to the server but I dont know how to do that. I need to send this example json in order to get a json responce: Content-Type :…
Darko Petkovski
  • 3,892
  • 13
  • 53
  • 117