插入ArrayList到Android SQLite数据库?

插入ArrayList到Android SQLite数据库?,第1张

概述嗨,我有数组的地理位置List<GeoPoint>geoPointsArray=newArrayList<GeoPoint>();我想将geoPointsArray数组放入SQLite数据库,然后将数据作为数组取回.如果有人有解决方案,我将不胜感激.附言现在,我使用ContentValues将数组插入为:ContentValuesinitialValues

嗨,

我有数组的地理位置

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

我想将geoPointsArray数组放入sqlite数据库,然后将数据作为数组取回.

如果有人有解决方案,我将不胜感激.

附言

现在,我使用ContentValues将数组插入为:

        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_TIME, time);        db.insert(tablename, null, initialValues);

解决方法:

I want to put geoPointsArray array in to sqlite database and then fetch the data back as an
array.

将GeoPoint数组序列化为JsON并将其存储在TEXT列中.

总结

以上是内存溢出为你收集整理的插入ArrayList到Android SQLite数据库?全部内容,希望文章能够帮你解决插入ArrayList到Android SQLite数据库?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1210436.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-04
下一篇2022-06-04

发表评论

登录后才能评论

评论列表(0条)

    保存