To significantly scale back the amount of code you have to write and ensure an excellent user expertise during the download, we suggest you use the Downloader Library to implement your download habits. Most of the time, Google Play downloads and saves your enlargement information on the same time it downloads the APK to the device. However, in some cases Google Play can not download the enlargement information or the consumer may need deleted previously downloaded expansion information. To deal with these conditions, your app should be capable of download the information itself when the principle activity starts, using a URL provided by Google Play.
By increasing file dimension limit from 50 MB to one hundred MB, Google desires to encourage builders for creating richer apps and video games, in addition to help avoid the need for downloading extra recordsdata after the preliminary APK obtain. One of the great advantages to utilizing enlargement information on Google Play is the flexibility to replace your app without re-downloading all the authentic assets. Because Google Play permits you to present two enlargement files with every APK, you can use the second file as a “patch” that provides updates and new assets. Doing so avoids the need to re-obtain the main growth file which might be giant and expensive for users. If Google Play is ready to obtain the growth information (which is the case for many devices), it downloads them along with the APK.
Add logic to your app’s primary activity that checks whether or not the expansion files are on the gadget upon begin-up. If the recordsdata aren’t on the gadget, use Google Play’s app Licensing service to request URLs for the growth recordsdata, then obtain and save them.
As long as you don’t change the main expansion file that’s associated with the APK within the Play Console, users who previously installed your app won’t obtain the principle growth file. Existing customers obtain solely the up to date APK and the new patch enlargement file (retaining the previous primary enlargement file). By including the Downloader Library and some code hooks to your app, virtually all of the work to obtain the growth files is already coded for you. As such, so as to present the best user expertise with minimal effort on your behalf, we recommend you employ the Downloader Library to obtain your enlargement information.
The expansion files are saved to the system’s shared storage location (the SD card or USB-mountable partition; also referred to as the “exterior” storage) the place your app can access them. On most units, Google Play downloads the growth file(s) at the similar time it downloads the APK, so your app has every little thing it wants when the consumer opens it for the primary time.
Safe to Download
When potential, Google Play downloads growth files when apps are put in or up to date. In some circumstances, your app will need to obtain its growth files. Alternatively, or in case your app exceeds the a hundred MB APK restrict, you should use growth recordsdata. These are further information which are downloaded after your app has installed and may be as much as 4 GB (to be specific, you’ll be able to have two growth information of as much as 2 GB every).
If Google Play is unable to obtain the growth recordsdata, it downloads the APK only. My ane also takes care of loading the OBB files from Google Play within the case the person deleted them or they couldn’t get downloaded together with the APK.
If you decide to build your individual downloader service instead of using the Google PlayDownloader Library, you should nonetheless use the APKExpansionPolicy that is supplied within the License Verification Library. The APKExpansionPolicy class is sort of similar to ServerManagedPolicy (obtainable within the Google Play License Verification Library) but consists of additional dealing with for the APK expansion file response extras.
In some cases, nonetheless, your app must obtain the recordsdata from Google Play when your app begins. Google Play requires that the compressed APK that customers download be no more than 100MB. For most apps, this is loads of area for all of the app’s code and belongings. However, some apps need more space for top-fidelity graphics, media recordsdata, or other massive belongings. Previously, in case your app’s compressed obtain measurement exceeded 100MB, you needed to host and obtain the additional sources yourself when the person opens the app.
If your app is free (not a paid app), you then probably have not used the app Licensing service. It’s primarily designed for you to implement licensing policies on your app and be sure that the consumer has the right to use your app (he or she rightfully paid for it on Google Play). In order to facilitate the expansion file functionality, the licensing service has been enhanced to supply a response to your app that includes the URL of your app’s enlargement recordsdata which are hosted on Google Play. So, even if your app is free for users, you have to embody the License Verification Library (LVL) to use APK growth recordsdata. Of course, if your app is free, you don’t need to enforce license verification—you merely need the library to perform the request that returns the URL of your growth files.
Hosting and serving the additional information can be expensive, and the consumer experience is usually lower than perfect. To make this course of easier for you and extra pleasant for customers, Google Play lets you connect two large growth recordsdata that supplement your APK.
- Additionally, as a result of using app bundles defers APK era and signing to Google Play, users download optimized APKs with solely the code and sources they should run your app.
- You don’t need to build, sign, and manage a number of APKs or growth files, and customers get smaller, extra optimized downloads.
- In some circumstances, nevertheless, your app should obtain the information from Google Play when your app begins.
- Google Play hosts the expansion recordsdata for your app and serves them to the gadget for free of charge to you.
In most cases, Google Play downloads and saves your growth information to the gadget on the similar time it installs or updates the APK. This way, the growth recordsdata are available when your app launches for the first time. However, in some cases your app should download the expansion information itself by requesting them from a URL provided to you in a response from Google Play’s app Licensing service.
With this information, you then obtain the recordsdata and save them to the right storage location. When Google Play downloads your expansion recordsdata to a device, it saves them to the system’s shared storage location. To ensure proper behavior, you must not delete, move, or rename the expansion information. In the occasion that your app must perform the obtain from Google Play itself, you have to save the information to the very same location.
Do not delete or rename the .obb enlargement file (until you are performing an update). In order to obtain your growth information from Google Play, the user should have acquired your app from Google Play. Google Play won’t provide the URLs for your enlargement information if the app was installed by other means. when you addContent your app in the Google Play developer console, add enlargement information major and/or patch.
Additionally, because utilizing app bundles defers APK era and signing to Google Play, users download optimized APKs with only the code and sources they should run your app. You do not need to build, sign, and handle multiple APKs or expansion recordsdata, and users get smaller, more optimized downloads. Google Play hosts the enlargement recordsdata for your app and serves them to the gadget at no cost to you.
You should design your app to support the patch data. However, the Apk Expansion bundle features a library for utilizing ZIP files as expansion files, which merges the information from the patch file into the main enlargement file so you’ll be able to easily learn all the enlargement file information. There may be solely two enlargement files on your app at a time. One primary growth file and one patch expansion file. During an update to a file, Google Play deletes the earlier version (and so should your app when performing guide updates).
If the compressed measurement of your APK on the time of download (including growth information) is bigger than one hundred MB, customers see a warning dialogue suggesting that they use Wi-Fi to download your app. Please enjoy this pack of Fonts for Android flip fonts to give you the ability to change your gadget’s typeface for free. This font pack is a random choice of 50 typefaces which have been optimized for use on Samsung Galaxy and HTC Sense 6.zero Android units. Please flick through our FlipFont packs to seek out the perfect font types that fits your style. When including a patch growth file, the Android system doesn’t really patch your app or main expansion file.
Do not delete or rename the .obb enlargement recordsdata (even should you unpack the data to a special location). Doing so will cause Google Play (or your app itself) to repeatedly obtain the expansion file. For extra information about using this library for your expansion recordsdata, have a look at the pattern app’s SampleDownloaderActivity class, which includes extra code to verify the downloaded recordsdata using CRC. Beware that if you use this pattern as the premise in your personal implementation, it requires that you declare the byte dimension of your enlargement files in the xAPKS array. With both the License Verification Library and Downloader Library added to your app, you’ll be able to rapidly combine the ability to download enlargement recordsdata from Google Play.
The format that you simply choose for the expansion recordsdata and how you learn them from the shared storage is a separate implementation that you should contemplate primarily based on your app wants. This library downloads your growth files in a background service, reveals a person notification with the download standing, handles network connectivity loss, resumes the obtain when possible, and extra.
First decide whether or not your app’s compressed download size must be greater than 100MB. Space is valuable and you must keep your total download size as small as attainable. For the best results when publishing to Google Play, upload an Android App Bundle, which includes all your app’s compiled code and resources, but defers APK era and signing to Google Play. If no, your app should obtain the enlargement information over HTTP from Google Play. Your app must send a request to the Google Play client using the Google Play’s app Licensing service, which responds with the name, file size, and URL for each enlargement file.
You can study extra about enlargement files on this page on the Android Developers web site. The patch expansion file is technically the same as the main growth file and neither the Android system nor Google Play perform actual patching between your main and patch growth files. Your app code should perform any necessary patches itself.
Read more about here.