So I want to save an ordered set of double values, and I want to be able to insert, retrieve or delete any value from this easily. As of such, I\'m using a an ArrayList, whe
To Insert :
ArrayList inputArray=new ArrayList();
Add Values to inputArray
Gson gson = new Gson();
String inputString= gson.toJson(inputArray);
System.out.println("inputString= " + inputString);
Use "inputString" to save the value of ArrayList in SQLite Database
To retreive:
Get the String from the SQLiteDatabse what you saved and changed into ArrayList type like below:
outputarray is a String which is get from SQLiteDatabase for this example.
Type type = new TypeToken>() {}.getType();
ArrayList finalOutputString = gson.fromJson(outputarray, type);