In my Android application, I am trying to preserve the map structure, for example: Map<String, Map<String, String>> using internal storage. I studied the use of SharedPreferences , but as you know, this only works when saving primitive data types. I tried to use FileOutputStream , but that only allows me to write in bytes ... Do I need to serialize the Hashmap somehow and then write to a file?
I tried reading through http://developer.android.com/guide/topics/data/data-storage.html#filesInternal , but I can not find my solution.
Here is an example of what I'm trying to do:
private void storeEventParametersInternal(Context context, String eventId, Map<String, String> eventDetails){ Map<String,Map<String,String>> eventStorage = new HashMap<String,Map<String,String>>(); Map<String, String> eventData = new HashMap<String, String>(); String REQUEST_ID_KEY = randomString(16); .
What is the best way to store this type of data structure inside an Android application? Sorry if this seems like a dumb question, I'm very new to Android. Thanks in advance.
source share