Android app update, assets update - android

I have an app and it uses .txt files from assets folder. In assets folder are more directories in some depth.
Later I will want to add new files to this assets folder so I'll have a new apk(cause files in assets are part of the apk).
The question: So what happens when someone, who is using my app, wants to update my app(with new files in assets) through Google Play, will it uninstall his old version and install the new one or how he receive these new files?
Or simpler: What happens during an app update?
Could someone make me keen vision in this a little? Thanks.

The old app is just replaced by the new app.
You don't have to worry about that. Apps are always installed completely without loosing data. That is, the .apk file is just replaced. So your assets will be also updated automatically.
Here an example:
Google Play Store downloads the new .apk file.
Next, it replaces the old apk file in /data/app/ by your new apk file.
That means that all the stuff that is in your new app is now available.
In this way the whole application is replaced.

Related

Renamed .apk package still overwrites old filename app when installing on my Android phone

Note that this question does not concern Google Playstore - I am downloading and installing this apk package from my own website.
I have an existing apk file that I can install and open on my Android phone.
Now I want to use the functionality of that old app in a new and similar app, but one that uses a different app name and logos.
I no longer have the old app source code, and I didn't create it in the first place (I subcontracted the app development to a coder who is no longer available).
So I opened the apk file using apktool and located the png image files that are used. I edited these and saved them in the same location and using the same filenames.
Then I edited the strings.xml file to change the app name text to the new file name.
Then I rebuilt the app, re-signed it using uber-apk-signer and uploaded to my website with a file name that is different from the old apk file.
When I download this new apk file to my Android phone, it prompts that it will replace the old app, even though I have changed the app name and apk filename. When I install this new app, indeed it does overwrite the old app, and I can successfully open the new app with the new logo.
My question is: What parameter/file do I need to edit in the decompiled original apk so that the new apk doesn't overwrite the original app when I install it on my Android phone? I want to be able to install both these apps, because they have similar characteristics, but will be used in different industry sectors (one is for the educational sector and one for the agricultural sector - both are simple charity apps to be used in the country of Myanmar (Burma).
The original apk is at www.teachersimon.org/simon.apk and the new app is at www.teachersimon.org/farmersimon.apk
Thanks!
For this too work, you need to change the package name e.g com.example.appname and the applicationId stored in the app's build.gradle file. Good luck!

Changing assets between releases

Does anyone know if the old assets get removed from the assets folder when an app is re-released / updated on the Play Store? I want to include an new and updated database with my re-releases, but really don't want the out of date ones taking up space on the users' phones.
It doesn't get removed if you made any changes in assets folder, while creating the release APK delete the build folder and create the APK.

Can Android replace the contents of the assets folder when an app is updated?

I am developing an app using android studio that delivers information in text files stored in the assets folder. The app works, but if I change the text in the files, I have to uninstall and then reinstall the app to make the changes permanent. However, if I make changes to the app code, the changes take place when the app is updated. I want the assets folder to update in the same way. Is there some way to avoid reinstalling the program to update both code and assets, especially when updating apps to the playstore?
Thanks.

How to update my game made with Unity running on Android?

My game have 100M asset bundles, I put the budle files into the StreamingAssets folder(I want to release my apk as one whole app, not the downloading when playing style), then I built my project into one apk file, then I installed the apk file to my device.
But how can I update my bundles when my game find one new update is available? The StreamingAssets folder on Android is read-only.
One solution is that: copy the bundles in the StreamingAssets folder to somewhere like the Android's External Storage, then use bundles in the External Storage. But this will increase my game size from 100M bundles to 200M.
So on Android when I install one apk, can I install some files meanwhile into somewhere writable?
Anyone can help me? Thanks.
Not sure if I understood: you shouldn't use asset bundles if you are not, at some point, going to update them or have new assets to download in-game.
So just use regular prefabs and use the regular Android update process to update the application.
But if you want to have asset updates in-game then you use asset bundles, put them on StreamingAssets and use WWW.LoadFromCacheOrDownload(string url, int version) to load them; when a new version of your asset is available you change the version in that call and it will just download and cache the new version.

Will the expansion files be deleted when an user removes your application from there phone / tablet?

Google just gave us a new option to add expansion files to our android apps. Very great idea!
But something is bugging me for a long time in Android and I'm wondering if the Google developers have solved that issue with this solution.
When I'm downloading application with extra assets (without this solution), they will be downloaded to my sdcard. No problem as long as I'm using that app. But when I remove that app the assets remain there.
So, my question is will the expansion files be deleted when a user uninstalls / removes the app from there phone or tablet with this new solution?
The files will be deleted if they are on API Level 8 or higher, this is not specific to the new expansion files support but is due to where the expansion files are stored (in the app specific external storage location). From Accessing files on external storage:
If the user's device is running API Level 8 or greater and they
uninstall your application, this directory and all its contents will
be deleted.

Categories

Resources