deploy extra data files to deployed android app - android

Consider an app with a set of data files (could be music or pictures or locations or indeed anything at all) embedded in the apk.
I now want to provide to the user additional data files , either to replace or add to the original data files - the user should be able to select which files to download and not have to reinstall the whole app.
So the question is it possible to do this non-programmatically - like by providing extra apk files for the app but which only contain single data files?

This is a good use case. A simple idea could be, ask the user to check for updates, you download a XML file which defines your updates. Parse this XML file and show what the user needs to download. Then you download and save it to desired locations. Always version the XML file so that you know if updates are avialble or not!

Related

How to ensure a file is preserved, after android app update

I have a xml file which contains editable patterns (these patterns represent audio rhythms). When the application is first installed, it comes with a default xml file, the user can edit the patterns in this file through the android application. If an user updates his android application, is there a way to ensure that the edited xml file is preserved?
You can copy the editable file to your application's internal storage (or download it there directly) the first time your app runs.
Post that, as long as the user does not clear data or uninstall and reinstall your app, this copy of your file will persist across updates.

Downloading (paid-for) content into an Android application

I have a simple application that should handle (display, play...) data downloaded by users. I.e. when the user downloads the application (for free), it is empty, or filled just with some sample data, but then the user can download the actual content of their preference (and potentially pay for it via Android billing system). Each item is a folder with an xml file plus several sub-folders (such as audio and images). In the development phase the data are stored in the assets directory.
The payment itself is not a subject of the question at this point. I am actually interested in the following:
where can I store the downloaded data in the phone so that it would be accessible for the application but so it could not be copied manually by the user (for example to another phone). It would be ideal if I could store the downloaded data in the assets directory but I'm afraid once the apk file is generated, assets are "locked" and cannot be easily extended (or can they?) If I store them on the phone's card (or in the built-in memory), they will be accessible by other applications such as media player or galleries, too, won't they?
it would be great if I could download the package as a single single file - is it possible to upack it by an built-in method and store it as a folder with upacked (and thus readable) sub-folders and files?
when the application is downloaded, it is an apk file. Therefore it should be possible to have the sample data (i.e. downloaded with the application) at the same location as the data that will be downloaded later. How can I ensure this.
the data can be pretty large and therefore it is not an option to have all of them included in the assets folder immediate after the download and unlock it on basis of the user's actions
once the data are downloaded, they must work off-line (i.e. the user must be able to display them without internet access; thus it is not possible to check identity of the user on the server - they can simply display anything they have previously downloaded)
Example (for clarification purposes): have an application able to display recipes. It does not contain any or just a few after installation. You should be able to download recipes (one by one) from a server (each having a certain file structure stored in a seperate directory). Once they are downloaded, they become an integral part of the application and always accessible for the user even if the use the airplane mode of their phone.
Hope it makes at least some sense (I can clarify the question further if it doesn't). I've found several tutorials on how to work with data stored in assets and on how to handle data on an sd card but none concerning this particular topic.
you may store your date in your application data folder, basically it's available to your application only. if you want to prevent your data to be copied to another phone, generate a random UUID on the first run, and then use it to encrypt your data stored in the data folder. another phone will have different UUID and different encryption key, making it pointless trying to copy encrypted data. you may even use non-symmetrical encryption and send your generated (public) key to the server and have the server to encode your data and send it back in encrypted form, thus preventing your data to be exposed at all.
the assets/ folder is generally read-only, you may put your data there only during the build step.
make your file a .zip file -- these are compact and you may easily read files and folders and whatever you need using java.util.zip.ZipFile
sample data goes into assets folder, you may copy it out to the data folder on the first run.
once you download the data and save it to the device, i don't see any reason why your application won't work offline

android downloading files

I have an application that will mail users attachments of text files. Receiving users can upload the file using this application. My question is
1) Is download folder the default location for downloading files?
2) Is it necessary for me to provide a folder exploring options before the files can be uploaded?
Any suggestions?
Jai
1)It depends on your actual call and how you are receiving the data / storing it. From what I've seen it will download to one static location however it's probably not a good idea to lean on that. There is always a possibility for that file to be moved by the user which could result in a crash or strange errors.
2)I would look into that or having the application create a temp folder to store the aforementioned text file in.
Good luck!
!k

Is it possible to remove unused files within my android app

I am currently programming an "One time after first login tutorial" and since it should be only shown one time after the user starts the application for the first time, I would like to remove all the unnecessary files like for example pictures which I only use in this tutorial.
So is there a way to remove some of these files which are shipped within the .apk ?
The Android apk is a read only file, so once a file is part of an apk, it cannot be removed.
An option would be to download the files from the network the first time the user installs the app and then put it on the sd card or locally and then delete it when you want it.

Distribution a file with my android project that will be updated in the future

I'm creating a simple Android App, it will be a map with a number of points marked on it. These points will sometimes change, based on an XML file hosted on the internet.
To reduce the initial load time my intention is to distribute a serialized List of these points with the application that can be updated in the future.
At first my intention was to distribute this serialized file as an 'asset'. This way I could just generate the file and drop it in to 'assets'. However, this does not work because (from what I can see) it is not possible for me to overwrite these assets.
The second option was to use the internal storage, however (from what I can see) I can't distribute this file as 'internal storage'.
Is my only option to distribute my serialized List as an asset and then on the initial load copy it to the internal storage? The files only going to be around 50kb but it seems unnecessary to have 2 copies of the same file (1 of which will eventually become outdated) as part of the same application.
How about always first checking the internal storage and if your data does not exist there read the 'asset' version.
Then you will have a syncronization job that will download the updated file (when available/updated) and put it in internal storage. But yes I guess you will be stuck with always having the original file there.

Categories

Resources