Google Play requires that the size of your games and applications does not exceed 50 MB. For most applications and games, this size is enough. Alternatively, you may want to have fantastic graphics for your projects and other huge media files that can take up a lot of space. Google Play makes a developer's life simpler and easier by expanding an APK file by large expansion files. Extension files are kept in a shared folder storage of the device where your game has enough access rights.
Each file cannot be larger than 2 GB, and you can choose any format for it. Of course, the best way is to use only compressed files in order to conserve bandwidth while the downloading process is active. You can add only one or two expansion files to your APK. Behind each expansion file lies its meaning:
You should know that the Developer Console does not allow you to update your existing APK file by uploading only a new expansion file.
In most cases, Google Play will do all jobs automatically for you. So, very often, you don't need to do anything while users will download or upload your expansion files on their devices. However, sometimes your game has to download these files itself by receiving a URL from Google Play's application licensing service.
On the game start event, you should look for the expansion files in the
In the first step, if you will find that your expansion files are already in that directory, then you can continue playing your game further.
In the event that the expansion files are not in that directory, you should perform the next two steps.
You have to receive URLs, names, and sizes for your game's expansion files. Before downloading anything, you should know where and what to download.
After having all the required information to download the expansion files, you can get your files and put them into the
Android/obb/<package-name>/directory with the same name as Google Play told you.
The following notes that are listed are taken from the official Android Developers Documentation page at http://developer.android.com/google/play/expansion-files.html:
The URL that Google Play provides for your expansion files is unique for every download, and each one expires shortly after it is given to your application.
Whether your application is free or not, Google Play returns the expansion file URLs only if the user acquired your application from Google Play.
A variety of errors may occur during the request and download that you must gracefully handle.
Network connectivity can change during the download, so you should handle such changes. If interrupted, resume the download when possible.
While the download occurs in the background, you should provide a notification that indicates the download progress, notifies the user when it's done, and takes the user back to your application when selected.
Navigate to the Player Settings | Publishing Settings menu, and at the bottom you will see an option called Split Application Binary. When this option is enabled, your project will be divided into the
.apk file for code, and for all other assets and data, it will be the
Let's look at a list of key aspects related to the loading of the expansion files (
The expansion files do not need to be uploaded to the server Google Play.
If you have decided to publish
.obbfiles on Google Play, then you need to include the code to download the expansion files.
In the Unity Asset Store, you can find a great plugin for downloading and extracting your expansion files in the right location. The URL of this plugin is http://u3d.as/content/unity-technologies/google-play-obb-downloader/2Qq.
Before testing the .
obbfiles, you need to be logged in your Google account.