简体   繁体   English

Android的离线存储管理

[英]Offline storage management for android

Theme : Newspaper updates in android application.

How to fetch or retrieve data from server and post updates on android application . 如何从服务器获取或检索数据并在Android应用程序上发布更新。 How to manage offline storage means whenever there is no internet connection how the data gone be updated on android application , atleast how it consider showing updates on android application . 如何管理离线存储意味着无论何时没有互联网连接如何在Android应用程序上更新数据,至少它如何考虑在Android应用程序上显示更新。 If any one known this issue please answer about it . 如果任何人知道这个问题,请回答一下。

I am actually using php or json as intermediate files for fetching data from server and send updates to android application but its seems to be more complex and if i wont get the permission to access the server side files , how do i manage for updates ? 我实际上使用phpjson作为中间文件从服务器获取数据并发送更新到Android应用程序,但它似乎更复杂,如果我不会获得访问服务器端文件的权限,我如何管理更新? whether is it necessary to have permission to access the server files ? 是否有必要获得访问服务器文件的权限?

More about the topics : if i want to syncronise the update with website , 有关主题的更多信息:如果我想将更新与网站同步,
how do i handle it or implement it ? 我该如何处理或实施呢? i am not asking any sort of coding here . 我不是在这里要求任何编码。

  1. How to fetch or retrieve data from server and post updates on android application 如何从服务器获取或检索数据并在Android应用程序上发布更新

    use HTTPClient . 使用HTTPClient

  2. How to manage offline storage means whenever there is no internet connection how the data gone be updated on android application 如何管理离线存储意味着无论何时没有互联网连接如何在Android应用程序上更新数据

    I think you don't understand what offline storage means. 我想你不明白什么是离线存储意味着什么。 If there is no internet connection, that's it. 如果没有互联网连接,那就是它。 You are not able to update your content. 您无法更新内容。 Offline storage is useful if you have internet connection, but not everytime. 如果您有Internet连接,则脱机存储很有用,但不是每次都有。 The content you downloaded when you had internet connection can be saved to SQLLite to be loaded when you don't have internet connection. 当您没有互联网连接时,您在连接互联网时下载的内容可以保存到SQLLite以便加载。

  3. I am actually using php or json as intermediate files for fetching data from server and send updates to android application but its seems to be more complex and if i wont get the permission to access the server side files , how do i manage for updates ? 我实际上使用php或json作为中间文件从服务器获取数据并发送更新到Android应用程序,但它似乎更复杂,如果我不会获得访问服务器端文件的权限,我如何管理更新? whether is it necessary to have permission to access the server files ? 是否有必要获得访问服务器文件的权限?

    Create WebService as an interface. 创建WebService作为接口。 Do not let other system to be able to directly access your files. 不要让其他系统能够直接访问您的文件。 Or just create a PHP files that basically return Json or XML Data. 或者只是创建一个基本上返回Json或XML数据的PHP文件。 Other option : create an RSS. 其他选项:创建RSS。

  4. More about the topics : if i want to syncronise the update with website , how do i handle it or implement it ? 有关这些主题的更多信息:如果我想将更新与网站同步,我该如何处理或实施? i am not asking any sort of coding here . 我不是在这里要求任何编码。

    Create an event to start sync using HTTPClient. 创建一个事件以使用HTTPClient开始同步。 If there is new update, save it to SQLLite(for offline storage) and display the content. 如果有新更新,请将其保存到SQLLite(用于脱机存储)并显示内容。 The event can be triggered during the start of your application or clicking refresh button and if Internet exist. 可以在应用程序启动期间触发事件,也可以单击“刷新”按钮以及是否存在Internet。

Update : 更新

There is a new framework called couchbase mobile . 有一个名为couchbase mobile的新框架。 You can sync the local mobile db from a couch server. 您可以从沙发服务器同步本地移动数据库。 You can insert/update the data locally(offline mode) and then the data can be synced also to the couch server, whenever you have internet connection. 您可以在本地插入/更新数据(离线模式),然后只要您有互联网连接,数据也可以同步到沙发服务器。 This means the need to create HTTPClient is no longer necessary. 这意味着不再需要创建HTTPClient。

For the database, try cloudant . 对于数据库,请尝试cloudant

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM