Add and load images, videos and pdfs from a raw folder or an SDCard Android Tablet design? - android

Good day, I have a requirement to create a kind of book app with pdfs, images and videos worth up to 10gb and more on a tablet locally. Now there is no intention to sell it on the android market or any other store, its completely in house, so i think issue with apk size has been clarified. What am asking is, where is the best place to put all this contents so that i can readily load them up and use them accordingly?
Should i be using the raw folder and create sub-folders for each images, videos and pdfs?
Should i create folders on an sdcard(assuming there is one in place)? or
Please if you have any other solution or ideas on how to implement this, I would gladly like to hear this. Thanks for your responses in advance.
P.S by the way, since its a tablet specific app, is there any need to have a multi-pane layout fragment or ii can just use all the space. thank you

I suppose you can use a RAW folder, but it would also make the APK size huge from what I understand because all the files in the RAW folder need to be packaged with the application.
From what I've seen in the past, most applications, actually most games, that have lots of extra data will download the additional data on first launch. Basically:
The application launches
It checks whether or not you have all the additional data (Books, pdfs, images)
If not, it starts downloading that data to the SDCARD.
It may not make sense in your situation, but doing it this way gives you more finite control over how much data needs to be downloaded. If function A only requires package A of additional data, then you only need to download package A, you don't need to download everything. Or perhaps you could let the user choose what packages of additional data they want to download, which would also save bandwidth, time and resources.

Related

How can I use Android scoped storage to store large app specific files?

I have an old drawing app on Android, which stores drawings (.PNG files) out on a specific folder on external storage. With Scoped Storage in Android 11, I need to find a way to save files, but I can't seem to find a solution that meets my needs. My app has its own gallery UI, like many drawing apps, so that I can control the selection/view UX.
I've tried:
MediaStore: I inserted files with MediaStore. The issue I ran into here is that I couldn't figure out a way to query just the files that my app created. Querying mediastore always returns a bunch of stuff I don't want.
Storage Access Framework. My intuition with this framework, is that I would probably spend a lot of time and potentially regret going down that road. I don't like the idea of not controlling the file selector (gallery). I also don't like relying on intents for a critical part of my app.
MANAGE_EXTERNAL_FILES. Based on the criteria defined by Google, my app wouldn't qualify to use this, though it would be great (since I could keep my old code).
Use internal file storage. I coded this up, and it's really clean, but I hesitate to roll this out, because uninstalling would mean that users lose their documents. Note that i have a Share intent, so users can "export" files one at a time.
What I want:
To write files where they aren't removed when the user uninstalls my app.
To write my files somewhere that the user can back them up one way or another.
Simplicity. I don't want to confuse existing users by changing things drastically.
Am I missing something regarding my options here? Can Mediastore effectively partition my files so that I can show them in the gallery? Does internal storage seem like the best option for me?
Just create your files in the old fashioned way in your apps sub folder in public Documents directory.
No special permissions needed.

Where to store files for my Android App, Storage and Performance-wise

I am building an android app which requires to have >300 images and ca. 100 audio files for an apk size of around 50mb (after webp compression and proguard).
It is not huge and I could probably live with that. But since I am planning to add other features the size will get bigger and bigger.
I am still interested though, since I'm quite new to android development, if there is a better way to store all this files, perhaps remotely and access them when required.
When the app starts I would have to load all the images into a list and once an element of the list is tapped I would need to open a separate activity and load the sound. So there is no upload from the App, just a resource gathering.
I do not know if it is more efficient this way or to store all the files locally.
Either way I would like to know what my options are. what are the pros and cons of a server (and if it would be a viable solution for me at all) and what is the advantage of storing them locally instead.
Please keep in mind that I working by myself and haven't got money to invest on premium servers or stuff like that.
FILE STORAGE will be best for you. Performance depends on the type and amount of data you are using. You do not need too much of data manipulation so go for file storage if privacy is not your concern for the data as it will be available for all the applications.
Use SQLite Database if the files needs to be protected from other applications.
Use File Storage(internal/external memory) if other applications can also access your files.
Avoid Fetching data from server using JSON parsing/Http requests it will make your app rely on the internet all the time. Unless you are using it to update your database or file storage.

Best suited methods to include large number of images,videos,pdf in an offline application

I need to develop an offline application in which it has got around 700 images, around 100 videos, 100 pdf's need to be included along with apk.Currently i have put images in drawable folder,videos in raw folder, and pdf in asset folder.When i build the application including all this apk size goes upto 1.5gb.My question is
1.Is it appropriate to include images and video in res folder?Is there any other method to handle this situation
3.One peculiar error will get generated when you build the app that is "package r does not exist android studio".Even though apk gets generated,studio shows this error
It's best to make use of Google Play APK Expansion Library for handling large application data. Imagine having the user download/install a single 1.5GB APK file.
Possible reason: R is re-generated by your environment everytime you add a new resource, as you are using a lot of files this may take time and during the process you will get the error R doesn't exist
Best way would be if you keep the app light without images and videos, only download the files from the server after the user installs the app, on a per need basis. You can save these in the SD card and save users on phone storage space as well.
First of all, if there's gonna be so much data then it should not be in stored in the App (APK). Also google doesn't allow this big APK to be uploaded at once, the big apps are divided into parts. You must have seen for the big games it first downloads a game, it starts and then downloads big amount of data later. But in your case I think the standard way to handle this situation would be to keep all this data on the server and whenever you need it just request it from there.
The best suited for this is to use "facebook conceal"

What is an efficient way in terms of memory to store audio files and images in an android app?

I am going to build an app which has to play 300-400 songs and 1000-2000 images. What is most suitable way to implement this one. For my requirement I've two concerns
Storing all files into 'Resources' folder in app
Storing and retrieving from database using BLOB
But I think both the above procedures may take more memory.
Please suggest any other way to implement this one.

Android App to access locally stores files, PDF, HTML and video

We have a mobile workforce using Android Galaxy tabs and use the MobiControl MDM product to sync detailed briefing files to and from the devices on a constant basis.
Rather than having the user search through a sea of irrelevant briefs in order to find the one they want, and to provide a nicer more activity specific UI, I would like to create an app which allows a user to tap a client from a list and then show links to the relevant files plus custom content such as recent news and summaries of activity.
I started to create locally stored HTML files (saved on the internal sdcard) with the idea of creating an app to access them using webviewer but have ran into a few problems...
1) What is the best way to access files that are stored on the sdcard using webviewer? loadData? string?
2) Although the files will be stored in client specific folders, the file names will change on a ongoing basis and these ever changing file names should be the titles of the links to allow the user to identify what they need.
Still very much at the preliminary stages of thinking and r&d so suggestions on the best route to take to achieve my goal is very much appreciated.
Ad
1) What is the best way to access files that are stored on the sdcard using webviewer? loadData? string?
loadUrl() should work.
BTW, your item "2)" is not a question.

Categories

Resources