I have read all the documentation about APK Expansion for Android.
I have a simple question:
I have an application that is about 5mb of code and has 40mb of assets files. These assets files will be updated in further release of the app, so I have implemented the APK Expansion.
Now, I have to publish the apk and the obb files on the google play console.
Documentation says that "main" must be used for files necessary to run the app, and "patch" for optional files. In my case my assets file are optionals and will be updated togheter with the app apk code change, so what files I need to upload?
The apk and a file zip named main.<expansion-version>.<package-name>.obb ?
The apk and a file zip named patch.<expansion-version>.<package-name>.obb ?
Or the apk and file zip containing both the two files? In this case which name I had to use?
Thanks in advice
You need to upload the apk and the zip with .zip extension. Google play console will convert to .obb format, you don't need to care about it.
Related
According to https://stackoverflow.com/a/53458191/1635488 if we publish aab files, the mapping files will automatically be taken from there. What happens if we upload it anyway? Will it override the one from the aab file?
The place where I can upload it is here: "ReTrace mapping file"
I did an experiment and can confirm that if we upload only aab file, mapping file will be taken from the aab. If we also upload a separate mapping file, it will override the one in the aab.
Some time ago I've released a beta version of my app and connected it with an APK Expansion File. Then I wanted to update my APK without touching the files and did following:
The version code of my app was 7 and the provider also had this value. The provider looks like following in my manifest:
<provider
android:name=".expansion.MyApezProvider"
android:authorities="com.bla.blabla"
android:exported="false"
android:multiprocess="true"
>
<meta-data
android:name="mainVersion"
android:value="7">
</meta-data>
</provider>
And here is a snippet of my Downloader Activity:
private static final XAPKFile[] xAPKS = {new XAPKFile(true, // true signifies a main file
7, // the version of the APK that the file was uploaded
383989643L // the length of the file in bytes
)};
I've only incremented the version code value in the manifest from 7 to 8. Because I didn't wanted to touch the expansion file. Therefore the value in the provider and Downloader Activity were still 7.
I've uploaded the new APK File and did not choose the uploaded APK Expansion File again. But this did not work. After the Users updated to the new version the video files in the app are no more available.
So I uploaded the APK File again and re-upload the APK Expansion File and that works. But that's very strange because the user have to download the expansions for every single update.
My question is: When I upload the new apk to the Google Play Console do I have to choose always the stored apk expansion file or re-upload it again?
Is the behavior of APK Expansion Files different in beta and relased version?
In the following post Updating an APK in Google Play without changing the expansion file it says that this behavior only happens in draft mode but my app is not in draft mode. It is published as beta.
I would be very thankful for your help.
You have to upload both files as this is the normal way.
Each time you upload an APK using the Google Play Console, you have the option to add one or two expansion files to the APK. Each file can be up to 2GB and it can be any format you choose, but we recommend you use a compressed file to conserve bandwidth during the download. Conceptually, each expansion file plays a different role:
The main expansion file is the primary expansion file for additional resources required by your application.
The patch expansion file is optional and intended for small updates to the main expansion file.
While you can use the two expansion files any way you wish, we recommend that the main expansion file deliver the primary assets and should rarely if ever updated; the patch expansion file should be smaller and serve as a “patch carrier,” getting updated with each major release or as necessary.
However, even if your application update requires only a new patch expansion file, you still must upload a new APK with an updated versionCode in the manifest. (The Play Console does not allow you to upload an expansion file to an existing APK.)
Note: The patch expansion file is semantically the same as the main expansion file—you can use each file any way you want. The system does not use the patch expansion file to perform patching for your app. You must perform patching yourself or be able to distinguish between the two files.
You can find more details here https://developer.android.com/google/play/expansion-files.html
For example i have an android program which contains important files in the assets folder , can the user who installed the apk access the assets folder or not ? for hacking purpose
Anyone can open your .apk just by changing the extension to .rar, what you can do to protect your code is releasing it using proguard rules, but still in that case an image for instance in the drawable folder can be compromised, however an string in your strings.xml is bit more protected.
Anyone can decompile your app and can see a lot of things including your assets. .apk file is just an compressed file which can be extracted easily.
Hi guys I am new to android application. recently I am developing one application.It works well and fine. But my problem is application contains the audio's and sequence images(nearly 10000 images)by the end of the project apk size is 530 MB. how to create the expansion file for that project. i want to upload the project into play store. please guys anyone help me to create how the expansion files are created for that project.
I follow this website http://developer.android.com/google/play/expansion-files.html but I can not under stand properly. please any help me
An expansion file is typically just a zip archive of the things you want to have in it. Use your favorite ZIP tool to generate it.
Your expansion file name format should be : [main|patch]...obb
Gather all your contents inside a folder and rename the folder as per the naming format above and with .zip as extension.
For eg: main.1.com.your.packagename.zip.
Now you can upload this expansion file along with the apk.
Can I use main expansion file as optional download option in application? So I don't need download it with APK file but later when user would do it.
When you create an expansion file, it should be something like
[main|patch].<version>.<package_name>
main, is for files that you're app needs to run, so you choose patch. The version is the same apk version you are uploading the expansion file with. If your apk version is 7 you should name the expansion file as follow:
patch.7.com.yourpackagename
You then zip it, and upload to google play!