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

How to Fetch Records from JSON Having the Same Name into Android's java file

[{"UserID":"vishi"},{"UserID":"vish"}] this is the json data that I am sending from php... how can i get these values with same name in android Thanks,
Vishvas
  • 5
  • 4
0
votes
2 answers

JSON parse Android - object in object

How to parse this json? I want get data from title, field_place and brothers fields. { "events": [ { "event": { "title": "BITUMIX Martyna Jastrz\u0119bska", "field_place": "Nowe Miejsce Al Jerozolimskie 51 lok.2", "field_zdjecie":…
0
votes
2 answers

JSON Parsing issue with android program

I have android class to parse a JSON array like this, Now the problem is it is only parsing 'image_first' index i want to parse 'image_second' too. But when i try to parse image_second it will throw some exceptions code import…
Hybrid Developer
  • 2,320
  • 1
  • 34
  • 55
0
votes
1 answer

Populate Custom Calendar with json data

I need to get some json data from my server that contains data about the assistence of the company employees. I'm using an example of CalendarView I need to change the data origin from: Cursor cursor = context.getContentResolver() …
0
votes
3 answers

Caching JSON file to internal storage on each load

I have an Android app that loads a remote JSON feed every 5 seconds. The payload of the JSON file is about 240kb. I would also like to cache this data so that users can view the last loaded feed when they are offline. Is it advisable to write the…
mushroom
  • 1,909
  • 3
  • 16
  • 33
0
votes
2 answers

Services in android consumes me much battery

I'm using a service in android which every 3 seconds will be downloading a JSON. My problem is that this service consumes me much battery and mobile data plan. How to download information to only if there really is a new data or update data?
user3236034
  • 463
  • 3
  • 6
  • 14
0
votes
1 answer

JSON Parsed Data not showing in ListFragment

I have used a MYSQL Database and connected it to my Android App using PHP. I added a sample row in the table and the PHP Script is returning JSON. I have tried my best in parsing the JSON and displaying it in a list. But it does not seem to be…
Bhargav
  • 227
  • 1
  • 11
0
votes
0 answers

Android JSON parsing does not fetch the complete string

I am seeing a problem if the JSON string is very big in that it simply does not fetch everything. So I have a JSONparsing class based on popular example: public String makeServiceCall(String url, int method, List params) { …
drlobo
  • 2,139
  • 5
  • 32
  • 42
0
votes
1 answer

Multiple Get Request not working properly

I am using following function but having AsyncTask Exception although I am getting valid response why is that so. public static void LoadServer(SharedPreferences prefs) { InputStream inputStream = null; String json = ""; String urlStr =…
0
votes
1 answer

how to detect elements of 2 arraylists combined into one arraylist and listViewAdapter

Sorry for the confusing Title (there is no why to explain my problem in few words) This is my situation: I'm developing an app to collect Stamps I have JSON that contains 2 JSONArray for "collectedStamp" and "unCollectedStamp" those 2 JSONArrays…
ahmadssb
  • 95
  • 2
  • 13
0
votes
0 answers

nothing is displayed when the button is pressed

I'm developing an android application, the idea is that when you press the button, the application will connect to a database and for a result, display the DB contents. The problem here is that nothing is coming. This is the onclick() method Button…
user3474889
0
votes
0 answers

HTTP Illegal state exception

I have the following code, which in general works without problems: HttpPost post = new HttpPost(sendURL); StringEntity se = new StringEntity( postJSON.toString(), "UTF-8"); se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE,…
Aharon Manne
  • 712
  • 3
  • 11
  • 34
0
votes
0 answers

Target host must not be null error

I'm having an issue with fetching a JSON from a URL with Android, and have the error stated in my titles with my URL. I have posted relevant code below. If more is required, I can provide it. At the moment, I have provided the snippets of code that…
Nate
  • 392
  • 3
  • 5
  • 17
0
votes
3 answers

How to know and check a given string is a proper JSON or not?

As straightforward we can check a given string is a proper JSON format or not? as we can use http://jsonlint.com/ http://jsonviewer.stack.hu/ etc etc. but if the same task we wants to do programatically how we can write a validator method in…
Jitesh Upadhyay
  • 5,244
  • 2
  • 25
  • 43
0
votes
3 answers

Android and json parsing

I have an android application which gets a json string. [ { "apellidos": "seguro", "edad": 2, "idninos": 1, "nombre": "antonio", "padres": "n1" }, { "apellidos": "martinez", "edad": 2, "idninos": 2, "nombre":…
Emmanuelguther
  • 1,039
  • 4
  • 19
  • 29