gson

Conversion de données JSON en objet Java

Je veux pouvoir accéder aux propriétés à partir d'une chaîne JSON dans ma méthode d'action Java. La chaîne est disponible en ... tentiel. Quelqu'un peut-il offrir une forme de conseils sur la façon dont je peux générer Java à partir de cette chaîne JSON?

Comment analyser un tableau JSON (pas un objet Json) dans Android

J'ai du mal à trouver un moyen d'analyser JSONArray. Cela ressemble à ceci: [{"name":"name1","url":"url1"},{"name":"name2", ... e besoin de quelque chose pour JSONArray. Quelqu'un peut-il me donner un indice, un tutoriel ou un exemple? Très apprécié !

Exemple d'API Skyscanner en Java

J'essaie de construire un exemple de demande pour Skyscanner API en Java - mais je fais quelque chose de mal - le lien pour s ... entity = response.getEntity(); return entity == null ? null : EntityUtils.toString(entity, ENCODING_UTF8); } } }

Java.lang.noClassDefFoundError sur Android 4.4.4, fonctionne sur 5.0+

Je reçois cette erreur: 12-17 03:59:18.767 7516-8610/io.ustube.ustube E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 ... e plus, je n'obtiens cette erreur qu'en dessous de 5.0. Mon fichier gradle comprend compile 'com.google.code.gson:gson:2.5'

Conversione dei dati JSON in oggetto Java

Voglio essere in grado di accedere alle proprietà da una stringa JSON all'interno del mio metodo di azione Java. La stringa è ... n potenziale plugin JSON. Qualcuno può offrire una qualche forma di guida su come posso generare Java da questa stringa JSON?

Come analizzare l'array JSON (non l'oggetto Json) in Android

Ho difficoltà a trovare un modo per analizzare JSONArray. Assomiglia a questo: [{"name":"name1","url":"url1"},{"name":"name ... bisogno di qualcosa per JSONArray. Qualcuno può darmi qualche suggerimento, o un tutorial o un esempio? Molto apprezzato !

Esempio di API Skyscanner in Java

Sto cercando di costruire un esempio di richiesta per Skyscanner API in Java - ma sto facendo qualcosa di sbagliato - il link ... entity = response.getEntity(); return entity == null ? null : EntityUtils.toString(entity, ENCODING_UTF8); } } }

Java.lang.noClassDefFoundError su Android 4.4.4, funziona su 5.0+

Sto ricevendo questo errore: 12-17 03:59:18.767 7516-8610/io.ustube.ustube E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 ... arattolo. Inoltre, ottengo solo questo errore sotto 5.0. Il mio file gradle include compile 'com.google.code.gson:gson:2.5'

Convert json to java class

How do I convert such a json to a Java class using GSON ? { "type": "success", "value": { "id": 61, "joke": "Chuck Norris o ... cake before his friends could tell him there was a stripper in it.", "categories": [] } } What will this class look like ?

GSON Android, well, I don't understand it at all

Hello. There are already 3,000,000,000 such questions. But I do not understand at all how to take and learn how to serialize ... ct.getJSONArray("p_item").toString()); } return new ArrayList<User>(); } And I can't even do it by analogy...

Getting values by a previously unknown key in JSON (Java Gson)

I support Java test code for processing requests from the server using the Gson library. Everything was fine, until recently. ... ere: How to parse a dynamic JSON key in a nested JSON result, but the code starts spitting excepshenami when trying to adapt.