且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

决定Android应用程序的内部和外部图像存储选项?

更新时间:2023-09-28 18:18:10

如果您使用本地存储,即保存在设备上的图像,那么每次发布更多漫画你将不得不推出一个新版本的应用程序。此外,应用程序可能会变得太大,甚至不适合某些旧设备。



我的建议是使用网络/云存储和批量预取图像。例如,一次获得10个图像,然后当用户观看图像#6获得另一个批次时,当用户到达图像#10时,另一个批次将准备好显示,并且对于用户来说,似乎图像是永远在那里。为此,您需要在后台进程中下载图像。换句话说,让你的图像下载程序在一个单独的线程上运行,这样它就不会影响UI。此外,可能会在本地存储您***的漫画,然后当用户查看那些从网络/云下载其他图像
If you go with local storage, i.e. images saved on the device itself then every time you release more cartoons you will have to roll out a new version of the app. Also the app may become too big and not even fit on some older devices.

My advice is go with web/cloud storage and pre-fetch images in batches. For example get 10 images at a time, then when a user views image #6 get another batch, that way by the time user gets to image #10 another batch will be ready to display and it will seems to the user like the images were always there. In order to do this you will nee to download the images in a background process. In other words let your image downloader run on a separate thread so that it does not impact the UI. Additionally maybe store your best cartoons locally and then while users are viewing those download additional images from the web/cloud


可能你正在谈论Android设备的闪存片;通常,一个焊接在机器内部,另一个可以插入槽中。如果你的意思是别的,请纠正我。



想象一下,用户就是你。如果您强制用户使用内部,则此人可能需要尽快将图像保存在其他位置。不幸的是,Android中典型的工作方式面向那些几乎不了解文件系统文件位置的用户,许多人甚至不了解文件的概念,他们只是点击图像,等等。定位文件并通过网络从卡到卡传输对许多人来说都很尴尬,但有些只是有更大的外部存储空间。



所以,这是否意味着答案是:外部存储?没有。用户没有? Android设备通常在没有外部卡的情况下销售。



因此,结论是:不要做出这个选择,留给用户。给用户一个明确的选择。



-SA
Probably you are talking about the piece of flash memory of an android device; usually, one is soldered inside the machine, and another one can be inserted in the slot. If you mean something else, please correct me.

Imagine the user is you. If you force the user to use the internal, this person may face the need to save your images elsewhere soon enough. And unfortunately, the typical style of work in Android is oriented to the users who hardly understand where in the file system the files are, many don't even understand the concept of files, they just click on images, and so on. Locating the file and transmitting them over network of from card to card would be awkward for many, but some just have a bigger external storage.

So, does it mean that the answer is: external storage? No. How about the user not having any? The Android device is typically sold without external card.

So, the conclusion is: don't make this choice at all, leave it to the user. Give the user a clear choice.

—SA