Android 仅在服务器上保存文件

发布于 2024-12-16 20:26:27 字数 359 浏览 1 评论 0原文

我是 Android 新手,想问一下是否可以将应用程序中创建的文件(包括图像、文本等)直接保存到 php 服务器?不将其保存在任何内部或外部存储(如 SD 卡)中?

这是因为用户一旦离线就不允许访问数据。除了通过登录在线访问数据之外,用户不得在个人设备上保留任何东西。

我已经阅读了Android开发者网站中数据存储的段落。这里提到的只是数据存储的方式。 Web 服务器作为最后一个选项,没有任何示例。

如果可能的话,请提供建议并给出一个片段。

另一个问题是,在这种情况下(保存在服务器中而不保存在SD卡中)。如果互联网连接中断,您知道如何将创建的数据保持临时状态吗?我不想丢失任何数据?

如果您有任何问题,请给出一些建议。

I'm new to Android and would like to ask is it possible to save the files (incl. image, text etc) created within a app directly to the php server? Without saving it in any internal or external storage like SD card?

This is due to users are not allowed to access to the data once they offline.Users shall not kept anything to their personal device other than accessing it online by login in.

I have read through the passage of Data Storage in Android developer website. What was mentioned there is just the ways for data storage. Web server as the last options without having any examples.

Please advise and give a snippet if possible.

Another questions will be, in such a situation(save in server without saving in SD card). Any idea on how to keep the created data temporary if let's say the internet connection is down? And I do not wish to lost any data?

Please give some suggestion, if you have any for the problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抹茶夏天i‖ 2024-12-23 20:26:27

您绝对可以将数据保存到服务器,而不是将其写入本地磁盘:Google 是您的朋友,将提供诸如 this 如果您搜索android POST http

You can definitely save data to a server and not ever write it to the local disk: Google is your friend and will provide examples such as this if you search for android POST http.

凉栀 2024-12-23 20:26:27

没有示例,因为这里没有 Android 特定的内容。

创建 Web 服务来存储文件,将数据从设备发送到 Web 服务。如果是图像,则发送其 ByteStream 。 示例在这里

No exampele because nothiong is android specific here .

create webservice to store file send the data to webservices from device . in case of images send its ByteStream . example is here .

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文