Android Tablet Internal Storage - android

1)I am converting an ipad project to android.In doing so,in ipad
version ,I can save the internal files in bundle (called Bundle
directory) and all the files are stored under Documents which is
internal to app.
In android we have /data/data/{package name}/files
My Question is I should be able to store large data inside the
internal storage.Does tablet have large internal space(atleast latest version) ?I dont want to save the files in sdcard either because it can be replaced or something.
Is the device RAM used for internal storage of files?I am facing a memory problem where as in ios we can have sufficient data stored in application sandbox...I need to copy files from assets to in internal storage during run time(by files I mean large files).
Can somebody throw light on this.Thx in advance

Internal storage is separate from RAM in android.
The amount of internal storage varies from device to device
Its not entirely uncommon to copy large assets (like pre-made databases) onto the tablets internal storage for applications to function properly so it shouldn't be a problem for you.

Related

Is it good to keep dictionary database files on internal storage in android?

I have successfully accessed WordNet dictionary data files on external storage using JAWS APIs. But now I want to keep these files on internal storage in order to make them private to my app. The dictionary files are about 35MB in size. My question is, Is it possible or good practice to use internal storage for this purpose and to keep a file as large as 35MB on it? Thanks.
Yes definitely you can but you should not.
From the compatibility definition for Android 6.0
Device implementations(Android phone) MUST have at least 424 of non-volatile storage available for user data. That is, the /data partition MUST be at least 424mb.
Which mean all app can store internal data upto 424 mb. But keeping database scale and older os (lesser space) in consideration i would not suggest to store 35 mb data internally.

Does assets/ folder reside in device's RAM?

When I launch the app, where do the assets/ folder contents go?
Are they loaded into RAM?
Or maybe AssetsManager always reads from inside /sdcard/?
Am I safe to assume that any Android device handles assets/ folder in the same manner?
My concern comes from the fact that some devices that I target are very limited in the amount of RAM they can provide, while all of them have a decent /sdcard/ storage, therefore I must decide if the assets should be downloaded at runtime or if they can safely be included into the apk file.
Assets are not saved in the "external files" directory (a.k.a the SD card). They're saved in the main app storage.
You can encourage your app to be installed on the SD card via android:installLocation="preferExternal". Your app will use this less valuable storage for everything, not just assets.
To have just assets on external storage consider expansion files like #pskink mentioned in a comment, or downloading them yourself and caching them in external storage.
I have successfully launched a 587 MB application on a device that comes with 512 MB available RAM, so it turns out that at least some of the devices indeed avoid pulling the whole assets/ folder to RAM upon launching the application.

Store video files on internal or sd card memory with protection?

I have an issue with my app .I want some video files to be stored in sdcard or internal memory in such a way that it could be read only by my app.
And other app may not read or copy the videos.Is there any simple way to do this?
The most protection you're going to get is through packaging the data with your app. Even this won't protect the files if the device is rooted. All other storage areas are exposed to browsing by the user.

Android – Where to store downloaded content, internal versus external storage?

A number of separate, but related, questions concerning where to store downloaded content within my application.
I have an application that downloads content from a central server. This content is sometimes premium content, or at least content where the publisher does not want it freely distributed. I understand that the “external” storage is readily accessible whereas the “internal” storage is protected, unless the phone is rooted.
If the application is installed on the SDCARD (as mine is configured to be) then is the “internal” storage also physically on the SDCARD? Thus if my SDCARD installed application downloads, say, 100MB of content to internal storage then is it actually ending up on the SDCARD, or is it ending up in the device’s physical on-board storage?
If the application is installed on the SDCARD, and the “internal” storage with the downloaded content is on the SDCARD then is it physically stored in an open format or is it encrypted? I seem to remember reading that an application stored on an SDCARD is encrypted. Does this also apply to the “internal” storage?
(Deleted question about storing files in a single directory as Context.getDir() implies that a directory system can be created and maintained in the internal storage)
Is there a better approach?
Did a bunch of experimentation and came to the following conclusions with Android 2.2 on a Motorola Droid 2:
When an application is installed/moved to the SDCARD then it is stored as an .asec file in the hidden /.android_secure directory on the SDCARD. This is an encrypted and compressed file.
When the application creates data files in the "internal storage" they are stored within the internal memory of the device, not on the SDCARD.
The Settings / Manage Applications details dialog for the application has a value for "Data" - this is the amount of data the application is using within its internal storage, that is in the internal memory not on the SDCARD
The external storage does end up on the SDACRD under the /Android/data directory
Clearing the data from the Settings / Manage Applications details dialog does indeed wipe everything, which means that the installed application needs to have enough knowledge/logic to handle the "no data" situation.
My app is a download content app. What this all means to me is that:
There is little real value in storing my small app on the SDCARD given that the bulk of the storage it will consume on the phone will be in the device's internal memory. Except of course that its always good to allow the application to install on the SDCARD.
The installation package needs to be able to recover the user's downloaded content if it is wiped by the user.
The concept of storing a unique installation id in the internal memory works well until a user deletes the application's data and hence causes a new installation id to be computed. Thus to be able to remember what content has been downloaded to a device requires a user account on a central server that the user creates/logs into whenever the application starts from scratch.

Android, SD-card and resource path

I have a read only SQLite database that's about 40mb uncompressed, and I'd like to add this to a resource path on the SD card. (In the same way I might have /res/drawable or /assets etc.)
Can I do this as part of the project's file structure on all versions of Android (2.2 or later say) and on all devices?
(I don't want to do this within code, that's not an option. And I've set the manifest to declare prefersExternal.)
Installing a program with such a large asset size will be an issue on a large number of mobiles with small internal storage and no SD card, however, tablets do tend to have large internal storage. I believe moving the file from the RAW folder will be your only way (/res/raw)
Have a look at this approach to spilting a database file into multiple sub files and then merging them on 1st run, but this does require code to access and create the usable database file.
Also consider compressing the file beforehand as well and then remember to decompress later as well. High compression rates can be obtained with database files. This will have the extra bonus of meaning your application's installer won't be quite as big.

Categories

Resources