android中无网络访问时将数据存储在本地
我想使用 httppostrequest 发送数据库中的数据。但是,当没有网络访问时,如何在本地存储数据以及当我的应用程序接收到网络时将其发布到服务器
I want to send data in my database using httppostrequest.But when there is no network access how to store data locally and when my application receives network post it to server
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在数据库中可能是一个很好的解决方案。 记事本教程很好地介绍了如何在 Android 应用程序中使用数据库进行编程。
此外,值得花必要的时间阅读并熟悉 http://developer.android.com/guide/topics/data/data-storage.html
In a database might be a good solution. The notepad tutorial is a decent introduction to programming with databases in an Android app.
Also, it's worth spending the time necessary to read and become familiar with the topics covered in http://developer.android.com/guide/topics/data/data-storage.html
使用它来检查连接:
关于将数据存储到 SQLite,请检查本教程:
http://p-xr.com/android-tutorial-simple-but-persistent-data-storage/
Use this to check for connection:
On storing data to SQLite check this tutorial:
http://p-xr.com/android-tutorial-simple-but-persistent-data-storage/
我同意 Mark Mooibroek 的回复,并建议使用一些数据库助手而不是原始 SQLite,因为它需要大量样板代码。
上次我很高兴使用 Realm 数据库库。它在效率和编码时间方面都比 SQLite 更快。
I approve Mark Mooibroek response and advise to use some DB helper instead of raw SQLite, as it needs a lot of boilerplate code.
Last time I was glad with using Realm database library. It's faster than SQLite in terms of both efficiency and coding time.