Embed ArrayList in Android SQLite Database?

Hi

I have a list of geotomes

List<GeoPoint> geoPointsArray = new ArrayList<GeoPoint>();

I want to add a geoPointsArray array to a SQLite database, and then return the data as an array.

If anyone has a solution, I would be very grateful.

PS

Now I use ContentValues ​​to insert into the array as:

        ContentValues initialValues = new ContentValues();
        initialValues.put(KEY_TIME, time);
        db.insert(tableName, null, initialValues);
+3
source share
2 answers

I want to put a geoPointsArray array in a SQLite database, and then return the data back as an array.

Serialize the array GeoPointin JSON and save it in a column TEXT.

+3
source

: GeoPoint 2 , 2 "latitudeE6" 'longitudeE6', , JSON.

+1

Source: https://habr.com/ru/post/1764926/


All Articles