本文介绍了外部内部存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的,什么是不可移动(内部)外部存储之间的差异,内部存储?我不知道在哪里保存我的数据。我只需要保存游戏状态,一个人可以随时拉他们想要

In android, whats the difference between external storage that is nonremovable (internal) and the internal storage? I am not sure where to save my data. I just need to save a game stats that a person can pull anytime they want

感谢您

推荐答案

在许多较新的设备将不再是一个物理的区别,以内部和外部存储器共享同一个闪存芯片,而不一定甚至无需固定分配,这样的差异确实仍打算访问范例之一。

In many newer devices there will no longer be a physical distinction, with "internal" and "external" storage sharing the same flash chips without necessarily even having fixed allocation, so the difference really remains one of intended access paradigm.

上的文件的外部存储(真实或模拟的)的不可避免的一切共享,并修改与该清单许可任何东西。传统上,他们很容易看到,但随着近期MTP-接入设备的系统可能需要被告知他们所连接的PC之前,会看到他们。

Files on the external storage (real or simulated) are unavoidably shared with everything, and modifiable by anything with that manifest permission. Traditionally they are easily visible, though with the recent MTP-access devices the system may need to be told about them before a connected PC will see them.

在此相反,在内部存储文件是私有的应用程序,除任何以root身份运行或系统,或者如果应用程序已决定将他们普遍可见或可改变。即使访问,对内部存储的数据可以更难以所属应用程序外部访问 - 它不支持的消费者为目标的USB大容量存储设备或MTP机制,甚至对其他应用程序和开发工具,它是棘手找到,除非你知道去哪里找,因为虽然你可以检查哪些应用程序已选择共享文件夹,则无法通过父(一般/或数据/数据​​/应用程序)文件夹浏览。它可以是一个有点甚至一个应用程序的开发人员在调试期间(访问它创建的私有存储中的文件令人沮丧的时候,虽然将APK是可调试就可以与运行的工具,亚洲开发银行,或者你可以建立一个出口能力到应用程序,或运行在亚行有根模拟器)。

In contrast, files on the internal storage are private to an application, excepting anything running as root or system, or if the application has decided to make them generally visible or changeable. Even when accessible, data on the internal storage can be more difficult to access outside the owning app - it's not supported by the consumer-targeted USB Mass Storage or MTP mechanisms, and even for other apps and development tools it is tricky to locate unless you know where to look, as while you may be able to examine files folders which applications have chosen to share, you cannot browse through the parent (typically /data or /data/app) folders. It can be a bit frustrating even for the developer of an app to access the files it creates on private storage during debugging (though while the apk is debuggable it is possible with the run-as tool and adb, or you can build an export capability in to the app, or run on the emulator where adb has root).

有可能你的决策过程应该是这样的:是不是意味着是私有的,拥有的应用程序?如果是的话,把它的内部存储,除非它是太大,针对旧设备,在这种情况下,你可能需要加密和/或放置在外部存储之前签署保护。否则,如果它的意思是共享的,需要交给任意其他组件(电子邮件应用程序等),或者是大的,把它放在外部存储。

Likely your decisions process should be something like this: Is it meant to be private to the owning application? If so, put it on the internal storage, unless it's too big and targeted at older devices, in which case you may need to encrypt and/or sign it for protection before placing on the external storage. Otherwise, if it's meant to be shared, needs to be handed to arbitrary other components (email app, etc), or is big, put it on the external storage.

这篇关于外部内部存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 17:50