Application that use a lot of MP3 files? - android

I have a general doubt about how to design Android apps that use a lot of MP3 (or other audio) files. My problem is that I do not know what is the best way/location to store such files.
I know that these options are available:
Store them on a remote server and fetch via gprs/wifi on demand (like, on a button click)
Store them locally inside the app (taking care they do not exceed the max size)
Store them locally on the sdcard (a user could delete them)
Store them both remote and locally
Could you tell me what is the best way to do? Also, if you store these files locally, do you download them after a user installs an app or you use some other method?
For example, my last app had approx 400MB of MP3 files and I was in a deep doubt where to store them. I chose remote web server, but I am not sure that was the right choice.
Thanks in advance

I'm interested in how you convince people to download 400MB of Music-files. You should compress them.
I would store them on the SDcard. If the user deletes them -> His problem (you could give him a message). But streaming them is a bad idea because if the user has no connection, he can't hear anything.
Downloading the files after the user installed the App (like the "Need for Speed Shift"-App) would be an option, too. In this case, you would save them on the SDcard, too.

Related

Android: Add audio and image files downloaded from server to app data

I am creating an app where the user will find a topic of interest, and download audio and images related to this topic stored using NoSQL database. I don't want the user to have direct access to the file after downloading, since the content should belong to the creator. The data should be downloaded, not streaming, as in some cases the user may not have internet access.
I wasn't sure how to go about this. I thought the files could be downloaded to the resources folder for each instance of the app. First, I could not find how to do this, and I also wasn't sure if I would reach a maximum memory limit.
An alternative I thought of was to encrypt the files then decrypt them within the app.
Thanks!
Alex

how can i keep a folder in my mobile storage and a folder in my dropbox space in Sync?

i have developed a android app for farmers. it is a informative app for indian farmer.The users will be sending me the images and video files to me through my app. here i used (integrated) dropbox to receive those files directly to my dropbox space. whatever the image or video taken by the user, it will be stored on a folder in my mobile storage. Here what i want is, i want the folder in my mobile storage to be in sync with the folder in my dropbox.
How can i do this?
there is a app in market called Foldersync which exactly fulfil my requirement. how they are doing it? How can i keep a folder in my mobile storage and a folder in my dropbox to be in Sync?
Note :
i have gone through drop-box api and created a simple app to send files directly to my dropbox space and i know how to download a entire folder from dropbox.
But here my question is unique from that... pls don't answer the above points which i already know..
Please help!
Thank You
You can use the Dropbox API to keep a local client in sync with Dropbox. There are two main pieces to this:
1) Metadata:
Assuming you're using the Core API, the best way to get information about all of the file and folders in an account (or optionally under a specific path) is to use /delta:
https://www.dropbox.com/developers/core/docs#delta
With this, you can get information about everything your app can see, and then easily stay up to date with changes. There are some useful blog posts on using /delta here:
https://blogs.dropbox.com/developers/2013/12/efficiently-enumerating-dropbox-with-delta/
https://blogs.dropbox.com/developers/2013/12/filtering-dropbox-delta-results-by-path/
2) File content:
Using the metadata retrieved from #1, you can download any files you need access to locally using /files (GET):
https://www.dropbox.com/developers/core/docs#files-GET
You can upload locally changed files using /files_put:
https://www.dropbox.com/developers/core/docs#files_put
Or, for larger files, use chunked uploading:
https://www.dropbox.com/developers/core/docs#chunked-upload
https://www.dropbox.com/developers/core/docs#commit-chunked-upload
The main work here will involve programming the logic in your app to correctly receive changes from the server as well as upload local changes, in order to keep everything in sync.
Also, be aware that on mobile devices, bandwidth can be limited and/or expensive, so be careful to not accidentally automatically download a lot of data the user doesn't want or need.

What is the proper way to write a mobile app that updates itself by downloading data instead of doing an app store update?

I've seen several apps where the initial app is a few dozen megabytes but, once you start the app, they need to download "extra data." Sometimes this data is hundreds of megabytes (eg. The Simpsons Tapped Out).
What is the proper way to do this? I know that modifying the contents of your app is a no-no, as doing so will invalidate your app's signature. So, are you just supposed to write this data to the sdcard? Is Apple ok with apps that have no initial content of their own and need to download everything? I assume Android would be fine.
Also, if the data I need to download contains assets (such as images and even HTML files for web views), is there an easy way to keep these files from prying users?

Private storage folder to store paid app specific content in Android?

I'm developing an app that would have an In-app purchase and download Videos from my server and store them on the device.
The problem is, the Videos are paid videos and are to be maintained in a highly secure place inside the app itself.
What are the possibilities of doing it? I had a look at setting android:exported="false", but it just restricts other apps to access my app's data. But how do I store the videos in a place which are restricted to be viewed by default even when connecting the device to a PC?
Are the apps allowed to store data in the device's \data folder? If so, please tell me how!
You can store files in your app's data folder, and as long as the phone isn't rooted, only your app should be able to access them.
However. The local storage on phones is generally limited, so storing videos there is a bad idea. Also, unless you're integrating your own video player, you might have issues trying to get the phone to play videos in your private folder.
To speak to the security issue, I'd suggest trying to keep them on the sd card, and experiment with either encrypting them, so they can't be read raw from disk, or (possibly) experimenting with file permissions, although I doubt the latter would work.
To do the encryption, I'd download the video, encrypt it and save it to the sd card. When you want to watch, decrypt and temporarily save to local storage for viewing. Not sure what kind of performance that will get, though. Plus, if you're relying on the OS to play your videos, you could have the same permission issues mentioned above. Depending on how critical this all is, you could explore something where the file/folder structure is obscured, so getting at them manually is more complex. Won't prevent all grab attempts, but will deter casual users.

How to handle 150 Mb of raw videos and music files in Android

I've been developing this content-based app for Android which includes over 120 MB of video .mp4-files saved on the raw folder and in addition it includes over 20 MB of sound files also saved in the raw folder.
The problem is I cannot install the app on my Android phone due to limited internal memory to handle all those files. Also, I read somewhere that the app size limit on the Android market is 50MB so I won't be able to even upload the damn thing.
I've saved the videos on the raw folder as I was able to play them fine (using VideoView).
My question is how do i cope with such size, do I have to go through making the user download the content after installing the app or is there any other way of dealing with such sizes (~140 MB).
You cannot distribute an APK through the market that is more than 50MB. Its not a good idea to take up 120MB of the internal storage for a single app as many phones don't have a lot of internal storage space.
You should consider stripping out all of the large files, hosting them on a server and then having the application download the files on the first launch. I would also recommend you save the files to the SD card so you don't use up too much of the precious internal storage.
Edit: I will admit that any time an app tries to download a lot of data on the initial launch I get really frustrated. Make sure you do it in a way that doesn't require the activity to be open the entire time the file is downloading. Do the downloading through a service so the user can at least use their phone while your app is downloading the media files.
Well, if you're sure you need all this content inside your application, the only solution I see is to download the content from a server when the application is opened for the first time. But as a user I think I won't be very happy to have a 150 Mb application on my phone. Do you really need all this data?

Categories

Resources