[java] creating Hashmap from a JSON String

creating a hashmap from a json string in java?

I have json string like {"phonetype":"N95","cat":"WP"} and want to convert into a standard Hashmap.

How can i do it?

This question is related to java android json hashmap

The answer is


You can use Google's Gson library to convert json to Hashmap. Try below code

String jsonString = "Your JSON string";
HashMap<String,String> map = new Gson().fromJson(jsonString, new TypeToken<HashMap<String, String>>(){}.getType());

No JSON libraries, just String and HashMap.
Keeps it simple!
Hope it suits to all.

// JSON Transform to HashMap example based on String

    String tempJson = "{\"incomePhone\":\"213121122\",\"clientId\":\"1001\",\"clientAccountManager\":\"Gestor de Conta 1\",\"clientRetailBranch\":\"100\",\"phoneAccountManager\":\"7800100\"}";
    System.out.println(tempJson);

    String[] parts = tempJson.split(",");
    HashMap<String,String> jsonHash = new HashMap<String,String>();

    for(int i=0;i<parts.length;i++){
        parts[i]    =   parts[i].replace("\"", "");
        parts[i]    =   parts[i].replace("{", "");
        parts[i]    =   parts[i].replace("}", "");
        String[] subparts = parts[i].split(":");
        jsonHash.put(subparts[0],subparts[1]);
    }

This worked for me:

JSONObject jsonObj = new JSONObject();
jsonObj.put("phonetype","N95");
jsonObj.put("cat","WP");

jsonObj to Hashmap as following using gson

HashMap<String, Object> hashmap = new Gson().fromJson(jsonObj.toString(), HashMap.class);

package used

<dependencies>
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20180813</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.6</version>
    </dependency>
</dependencies>

You could use Jackson to do this. I have yet to find a simple Gson solution.

Where data_map.json is a JSON (object) resource file
and data_list.json is a JSON (array) resource file.

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * Based on:
 * 
 * http://www.mkyong.com/java/how-to-convert-java-map-to-from-json-jackson/
 */
public class JsonLoader {
    private static final ObjectMapper OBJ_MAPPER;
    private static final TypeReference<Map<String,Object>> OBJ_MAP;
    private static final TypeReference<List<Map<String,Object>>> OBJ_LIST;

    static {
        OBJ_MAPPER = new ObjectMapper();
        OBJ_MAP = new TypeReference<Map<String,Object>>(){};
        OBJ_LIST = new TypeReference<List<Map<String,Object>>>(){};
    }

    public static void main(String[] args) {
        try {
            System.out.println(jsonToString(parseJsonString(read("data_map.json", true))));
            System.out.println(jsonToString(parseJsonString(read("data_array.json", true))));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static final Object parseJsonString(String jsonString) {
        try {
            if (jsonString.startsWith("{")) {
                return readJsonObject(jsonString);
            } else if (jsonString.startsWith("[")) {
                return readJsonArray(jsonString);
            }
        } catch (JsonGenerationException e) {
            e.printStackTrace();
        } catch (JsonMappingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static String jsonToString(Object json) throws JsonProcessingException {
        return OBJ_MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(json);
    }

    private static final Map<String,Object> readJsonObject(String jsonObjectString) throws JsonParseException, JsonMappingException, IOException {
        return OBJ_MAPPER.readValue(jsonObjectString, OBJ_MAP);
    }

    private static final List<Map<String,Object>> readJsonArray(String jsonArrayString) throws JsonParseException, JsonMappingException, IOException {
        return OBJ_MAPPER.readValue(jsonArrayString, OBJ_LIST);
    }

    public static final Map<String,Object> loadJsonObject(String path, boolean isResource) throws JsonParseException, JsonMappingException, MalformedURLException, IOException {
        return OBJ_MAPPER.readValue(load(path, isResource), OBJ_MAP);
    }

    public static final List<Map<String,Object>> loadJsonArray(String path, boolean isResource) throws JsonParseException, JsonMappingException, MalformedURLException, IOException {
        return OBJ_MAPPER.readValue(load(path, isResource), OBJ_LIST);
    }

    private static final URL pathToUrl(String path, boolean isResource) throws MalformedURLException {
        if (isResource) {
            return JsonLoader.class.getClassLoader().getResource(path);
        }

        return new URL("file:/" + path);
    }

    protected static File load(String path, boolean isResource) throws MalformedURLException {
        return load(pathToUrl(path, isResource));
    }

    protected static File load(URL url) {
        try {
            return new File(url.toURI());
        } catch (URISyntaxException e) {
            return new File(url.getPath());
        }
    }

    public static String read(String path, boolean isResource) throws IOException {
        return read(path, "UTF-8", isResource);
    }

    public static String read(String path, String charset, boolean isResource) throws IOException {
        return read(pathToUrl(path, isResource), charset);
    }

    @SuppressWarnings("resource")
    public static String read(URL url, String charset) throws IOException {
        return new Scanner(url.openStream(), charset).useDelimiter("\\A").next();
    }
}

Extra

Here is the complete code for Dheeraj Sachan's example.

import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.Scanner;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;

public class JsonHandler {
    private static ObjectMapper propertyMapper;

    static {
        final DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        propertyMapper = new ObjectMapper();
        propertyMapper.setDateFormat(df);
        propertyMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        propertyMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
        propertyMapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
    }

    private static class MyHashMap extends HashMap<String, List<Video>>{
        private static final long serialVersionUID = 7023107716981734468L;
    }

    private static class Video implements Serializable {
        private static final long serialVersionUID = -446275421030765463L;

        private String dashUrl;
        private String videoBitrate;
        private String audioBitrate;
        private int videoWidth;
        private int videoHeight;
        private long fileSize;

        @Override
        public String toString() {
            return "Video [url=" + dashUrl + ", video=" + videoBitrate + ", audio=" + audioBitrate
                    + ", width=" + videoWidth + ", height=" + videoHeight + ", size=" + fileSize + "]";
        }
    }

    public static void main(String[] args) {
        try {
            HashMap<String, List<Video>> map = loadJson("sample.json", true);
            Iterator<Entry<String, List<Video>>> lectures = map.entrySet().iterator();

            while (lectures.hasNext()) {
                Entry<String, List<Video>> lecture = lectures.next();

                System.out.printf("Lecture #%s%n", lecture.getKey());

                for (Video video : lecture.getValue()) {
                    System.out.println(video);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static <T> T parseUnderScoredResponse(String json, Class<T> classOfT) {
        try {
            if (json == null) {
                return null;
            }
            return propertyMapper.readValue(json, classOfT);

        } catch (JsonParseException e) {
            e.printStackTrace();
        } catch (JsonMappingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    public static URL pathToUrl(String path, boolean isResource) throws MalformedURLException {
        if (isResource) {
            return JsonHandler.class.getClassLoader().getResource(path);
        }

        return new URL("file:/" + path);
    }

    public static File load(String path, boolean isResource) throws MalformedURLException {
        return load(pathToUrl(path, isResource));
    }

    public static File load(URL url) {
        try {
            return new File(url.toURI());
        } catch (URISyntaxException e) {
            return new File(url.getPath());
        }
    }

    @SuppressWarnings("resource")
    public static String readFile(URL url, String charset) throws IOException {
        return new Scanner(url.openStream(), charset).useDelimiter("\\A").next();
    }

    public static String loadJsonString(String path, boolean isResource) throws IOException {
        return readFile(path, isResource, "UTF-8");
    }

    public static String readFile(String path, boolean isResource, String charset) throws IOException {
        return readFile(pathToUrl(path, isResource), charset);
    }

    public static HashMap<String, List<Video>> loadJson(String jsonString) throws IOException {
        return JsonHandler.parseUnderScoredResponse(jsonString, MyHashMap.class);
    }

    public static HashMap<String, List<Video>> loadJson(String path, boolean isResource) throws IOException {
        return loadJson(loadJsonString(path, isResource));
    }
}

Don't do this yourself, I suggest.
Use a library, e.g. the Gson library from Google.

https://code.google.com/p/google-gson/


Here is an example of an easy and simple way to create a Hashmap from a JSON string by only using the JSON simple library:

{"Collection":{"Item_Type":"Any","Name":"A","Item_ID":"000014"},"Object_Name":"System"}

import java.io.FileReader;
import java.util.HashMap;
import java.util.Iterator; 
import java.util.Map;  
import org.json.simple.JSONObject; 
import org.json.simple.parser.*;

public class JSONRead {

public static void main(String[] args) throws Exception {
    
    Object obj = new JSONParser().parse(new FileReader("D:\\other.json"));
    
    HashMap<String,String> map =new HashMap<String,String>();
    
    // typecasting obj to JSONObject 
    JSONObject jo = (JSONObject) obj;
    
    Map Item_Id = ((Map)jo.get("Collection"));
            
    Iterator<Map.Entry> itr1 = Item_Id.entrySet().iterator(); 
    while (itr1.hasNext()) { 
        Map.Entry pair = itr1.next(); 
        String key = (String) pair.getKey();
        String value = (String) pair.getValue();
        System.out.println( pair.getKey() + " : " + pair.getValue()); 
        map.put(key, value);
    }
    
    System.out.println(map)
    System.out.println(map.get("Item"));        
}

consider this json string

{
    "12": [
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/12/12_960x540_200k.mp4/manifest.mpd",
            "video_bitrate": "200k",
            "audio_bitrate": "32k",
            "video_width": 960,
            "video_height": 540,
            "file_size": 125465600
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/12/12_960x540_80k.mp4/manifest.mpd",
            "video_bitrate": "80k",
            "audio_bitrate": "32k",
            "video_width": 960,
            "video_height": 540,
            "file_size": 50186240
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/12/12_640x360_201k.mp4/manifest.mpd",
            "video_bitrate": "201k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 145934731
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/12/12_640x360_199k.mp4/manifest.mpd",
            "video_bitrate": "199k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 145800030
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/12/12_640x360_79k.mp4/manifest.mpd",
            "video_bitrate": "79k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 71709477
        }
    ],
    "13": [
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/13/13_960x540_200k.mp4/manifest.mpd",
            "video_bitrate": "200k",
            "audio_bitrate": "32k",
            "video_width": 960,
            "video_height": 540,
            "file_size": 172902400
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/13/13_960x540_80k.mp4/manifest.mpd",
            "video_bitrate": "80k",
            "audio_bitrate": "32k",
            "video_width": 960,
            "video_height": 540,
            "file_size": 69160960
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/13/13_640x360_201k.mp4/manifest.mpd",
            "video_bitrate": "201k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 199932081
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/13/13_640x360_199k.mp4/manifest.mpd",
            "video_bitrate": "199k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 199630781
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/13/13_640x360_79k.mp4/manifest.mpd",
            "video_bitrate": "79k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 98303415
        }
    ],
    "14": [
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/14/14_960x540_200k.mp4/manifest.mpd",
            "video_bitrate": "200k",
            "audio_bitrate": "32k",
            "video_width": 960,
            "video_height": 540,
            "file_size": 205747200
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/14/14_960x540_80k.mp4/manifest.mpd",
            "video_bitrate": "80k",
            "audio_bitrate": "32k",
            "video_width": 960,
            "video_height": 540,
            "file_size": 82298880
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/14/14_640x360_201k.mp4/manifest.mpd",
            "video_bitrate": "201k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 237769546
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/14/14_640x360_199k.mp4/manifest.mpd",
            "video_bitrate": "199k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 237395552
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/14/14_640x360_79k.mp4/manifest.mpd",
            "video_bitrate": "79k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 116885686
        }
    ],
    "15": [
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/15/15_960x540_200k.mp4/manifest.mpd",
            "video_bitrate": "200k",
            "audio_bitrate": "32k",
            "video_width": 960,
            "video_height": 540,
            "file_size": 176128000
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/15/15_960x540_80k.mp4/manifest.mpd",
            "video_bitrate": "80k",
            "audio_bitrate": "32k",
            "video_width": 960,
            "video_height": 540,
            "file_size": 70451200
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/15/15_640x360_201k.mp4/manifest.mpd",
            "video_bitrate": "201k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 204263286
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/15/15_640x360_199k.mp4/manifest.mpd",
            "video_bitrate": "199k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 204144447
        },
        {
            "dash_url": "http://mediaserver.superprofs.com:1935/vods3/_definst_/mp4:amazons3/superprofs-media/private/lectures/15/15_640x360_79k.mp4/manifest.mpd",
            "video_bitrate": "79k",
            "audio_bitrate": "32k",
            "video_width": 640,
            "video_height": 360,
            "file_size": 100454382
        }
    ]
}

using jackson parser

 private static ObjectMapper underScoreToCamelCaseMapper;

    static {
        final DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        underScoreToCamelCaseMapper = new ObjectMapper();
        underScoreToCamelCaseMapper.setDateFormat(df);
        underScoreToCamelCaseMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        underScoreToCamelCaseMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
        underScoreToCamelCaseMapper.setPropertyNamingStrategy(
                PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
}
    public static <T> T parseUnderScoredResponse(String json, Class<T> classOfT) {
        try {
            if (json == null) {
                return null;
            }
            return underScoreToCamelCaseMapper.readValue(json, classOfT);

        } catch (JsonParseException e) {
        } catch (JsonMappingException e) {
        } catch (IOException e) {
        }
        return null;
    }

use following code to parse

 HashMap<String, ArrayList<Video>> integerArrayListHashMap =
                JsonHandler.parseUnderScoredResponse(test, MyHashMap.class);

where MyHashMap is

 private static class MyHashMap extends HashMap<String,ArrayList<Video>>{
    }

This is simple operation no need to use any external library.

You can use this class instead :) (handles even lists , nested lists and json)

public class Utility {

    public static Map<String, Object> jsonToMap(Object json) throws JSONException {

        if(json instanceof JSONObject)
            return _jsonToMap_((JSONObject)json) ;

        else if (json instanceof String)
        {
            JSONObject jsonObject = new JSONObject((String)json) ;
            return _jsonToMap_(jsonObject) ;
        }
        return null ;
    }


   private static Map<String, Object> _jsonToMap_(JSONObject json) throws JSONException {
        Map<String, Object> retMap = new HashMap<String, Object>();

        if(json != JSONObject.NULL) {
            retMap = toMap(json);
        }
        return retMap;
    }


    private static Map<String, Object> toMap(JSONObject object) throws JSONException {
        Map<String, Object> map = new HashMap<String, Object>();

        Iterator<String> keysItr = object.keys();
        while(keysItr.hasNext()) {
            String key = keysItr.next();
            Object value = object.get(key);

            if(value instanceof JSONArray) {
                value = toList((JSONArray) value);
            }

            else if(value instanceof JSONObject) {
                value = toMap((JSONObject) value);
            }
            map.put(key, value);
        }
        return map;
    }


    public static List<Object> toList(JSONArray array) throws JSONException {
        List<Object> list = new ArrayList<Object>();
        for(int i = 0; i < array.length(); i++) {
            Object value = array.get(i);
            if(value instanceof JSONArray) {
                value = toList((JSONArray) value);
            }

            else if(value instanceof JSONObject) {
                value = toMap((JSONObject) value);
            }
            list.add(value);
        }
        return list;
    }
}

To convert your JSON string to hashmap use this :

HashMap<String, Object> hashMap = new HashMap<>(Utility.jsonToMap(response)) ;

In Java we can do it using the following statement . We need to use Jackson ObjectMapper for the same and provide the HashMap.class as the mapping class. Finally store the result as a HashMap object.

HashMap<String,String> hashMap = new ObjectMapper().readValue(jsonString, HashMap.class);

You could use Gson library

Type type = new TypeToken<HashMap<String, String>>() {}.getType();
new Gson().fromJson(jsonString, type);

HashMap<String, String> hashMap = new HashMap<String, String>();
String string = "{\"phonetype\":\"N95\",\"cat\":\"WP\"}";

try {
    JSONObject json = new JSONObject(string);

    hashMap.put("phonetype", json.getString("phonetype"));
    hashMap.put("cat", json.getString("cat"));
} catch (JSONException e) {
     // TODO Handle expection!
}

public class JsonMapExample {

    public static void main(String[] args) {
        String json = "{\"phonetype\":\"N95\",\"cat\":\"WP\"}";
        Map<String, String> map = new HashMap<String, String>();
        ObjectMapper mapper = new ObjectMapper();

        try {
            //convert JSON string to Map
            map = mapper.readValue(json, new TypeReference<HashMap<String, String>>() {});
            System.out.println(map);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Output:

{phonetype=N95, cat=WP}

You can see this link it's helpful http://www.mkyong.com/java/how-to-convert-java-map-to-from-json-jackson/


Best way to parse Json to HashMap

public static HashMap<String, String> jsonToMap(JSONObject json) throws JSONException {
            HashMap<String, String> map = new HashMap<>();
            try {
                Iterator<String> iterator = json.keys();

                while (iterator.hasNext()) {
                    String key = iterator.next();
                    String value = json.getString(key);
                    map.put(key, value);
                }

                return map;
            } catch (JSONException e) {
                e.printStackTrace();
            }
            return null;
        }

public Map<String, String> parseJSON(JSONObject json, Map<String, String> dataFields) throws JSONException {
        Iterator<String> keys = json.keys();
        while (keys.hasNext()) {
            String key = keys.next();
            String val = null;
            try {
                JSONObject value = json.getJSONObject(key);
                parseJSON(value, dataFields);
            } catch (Exception e) {
                if (json.isNull(key)) {
                    val = "";
                } else {
                    try {
                        val = json.getString(key);
                    } catch (Exception ex) {
                        System.out.println(ex.getMessage());
                    }
                }
            }

            if (val != null) {
                dataFields.put(key, val);
            }
        }
        return dataFields;
    }

Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to json

Use NSInteger as array index Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) HTTP POST with Json on Body - Flutter/Dart Importing json file in TypeScript json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 190) Angular 5 Service to read local .json file How to import JSON File into a TypeScript file? Use Async/Await with Axios in React.js Uncaught SyntaxError: Unexpected token u in JSON at position 0 how to remove json object key and value.?

Examples related to hashmap

How to split a string in two and store it in a field Printing a java map Map<String, Object> - How? Hashmap with Streams in Java 8 Streams to collect value of Map How to convert String into Hashmap in java Convert object array to hash map, indexed by an attribute value of the Object HashMap - getting First Key value The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files Sort Go map values by keys Print all key/value pairs in a Java ConcurrentHashMap creating Hashmap from a JSON String