Lines Matching refs:files
2 page.metaDescription=If your app needs more than the 50MB APK max, use free APK expansion files fro…
13 <li>Google Play hosts and serves the expansion files at no charge</li>
14 <li>The files can be any file type you want and are saved to the device's shared storage</li>
68 However, some apps need more space for high-fidelity graphics, media files, or other large assets.
70 yourself when the user opens the app. Hosting and serving the extra files can be costly, and the
72 for users, Google Play allows you to attach two large expansion files that supplement your
75 <p>Google Play hosts the expansion files for your application and serves them to the device at
76 no cost to you. The expansion files are saved to the device's shared storage location (the
80 first time. In some cases, however, your application must download the files from Google Play
88 add one or two expansion files to the APK. Each file can be up to 2GB and it can be any format you
99 <p>While you can use the two expansion files any way you wish, we recommend that the main
113 yourself or be able to distinguish between the two files.</p>
121 of resource files and subsequent patches for that set. Regardless of the file type, Google Play
122 considers them opaque binary blobs and renames the files using the following scheme:</p>
153 <p>When Google Play downloads your expansion files to a device, it saves them to the system's
155 expansion files. In the event that your application must perform the download from Google Play
156 itself, you must save the files to the exact same location.</p>
158 <p>The specific location for your expansion files is:</p>
171 <p>For each application, there are never more than two expansion files in this directory.
173 versions are overwritten when you update your application with new expansion files.</p>
175 <p>If you must unpack the contents of your expansion files, <strong>do not</strong> delete the
176 {@code .obb} expansion files afterwards and <strong>do not</strong> save the unpacked data
177 in the same directory. You should save your unpacked files in the directory
184 <p class="note"><strong>Note:</strong> Unlike APK files, any files saved on the shared storage can
187 <p class="note"><strong>Tip:</strong> If you're packaging media files into a ZIP, you can use media
188 playback calls on the files with offset and length controls (such as {@link
192 the media files when creating the ZIP packages. For example, when using the <code>zip</code> tool,
200 <p>Most of the time, Google Play downloads and saves your expansion files at the same time it
202 cannot download the expansion files or the user might have deleted previously downloaded expansion
203 files. To handle these situations, your app must be able to download the files
210 <li>If Google Play is able to download the expansion files (which is the case for most
212 <p>If Google Play is unable to download the expansion files, it downloads the
215 <li>When the user launches your application, your app must check whether the expansion files are
219 <li>If no, your app must download the expansion files over HTTP from Google Play. Your app
223 download the files and save them to the proper <a href="#StorageLocation">storage location</a>.</li>
229 download the expansion files from Google Play in the event that the files are not already on the
240 <p>Here's a summary of the tasks you should perform to use expansion files with your
256 <li>Develop your application such that it uses the resources from your expansion files in the
258 <p>Remember that you must not delete, move, or rename the expansion files.</p>
259 <p>If your application doesn't demand a specific format, we suggest you create ZIP files for
260 your expansion files, then read them using the <a href="#ZipLib">APK Expansion Zip
263 <li>Add logic to your application's main activity that checks whether the expansion files
264 are on the device upon start-up. If the files are not on the device, use Google Play's <a
266 for the expansion files, then download and save them.
271 must not change the name of the expansion files and must save them to the proper
285 <p>Adding APK expansion files is a feature available when you upload your application using the
287 application that uses expansion files, you must be aware of the following rules and limitations:</p>
291 <li>In order to download your expansion files from Google Play, <strong>the user must have
293 provide the URLs for your expansion files if the application was installed by other means.</li>
299 application, you can select expansion files that you've uploaded for a previous APK. <strong>The
302 <li>If you use expansion files in combination with <a
304 provide different expansion files for different devices, you still must upload separate APKs
309 <li>You cannot issue an update to your application by changing the expansion files
311 concern the assets in your expansion files, you can update your APK simply by changing the <a
334 <p>In most cases, Google Play downloads and saves your expansion files to the device at the same
335 time it installs or updates the APK. This way, the expansion files are available when your
337 expansion files itself by requesting them from a URL provided to you in a response
341 <p>The basic logic you need to download your expansion files is the following:</p>
344 <li>When your application starts, look for the expansion files on the <a
348 <li>If the expansion files are there, you're all set and your application can continue.</li>
349 <li>If the expansion files are <em>not</em> there:
354 <li>Use the URLs provided by Google Play to download the expansion files and save
355 the expansion files. You <strong>must</strong> save the files to the <a
360 expansion files is unique for every download and each one expires shortly after it is given to
376 to your application that includes the URL of your application's expansion files that are hosted
378 License Verification Library (LVL) to use APK expansion files. Of course, if your application
380 library to perform the request that returns the URL of your expansion files.</p>
385 <p>In addition to the LVL, you need a set of code that downloads the expansion files
391 <li>The device might not have enough space for the expansion files, so you should check
406 which requests the expansion file URLs through the licensing service, downloads the expansion files,
409 work to download the expansion files is already coded for you. As such, in order to provide the best
411 download your expansion files. The information in the following sections explain how to integrate
414 <p>If you'd rather develop your own solution to download the expansion files using the Google
425 <p>To use APK expansion files with your application and provide the best user experience with
427 Google Play APK Expansion Library package. This library downloads your expansion files in a
437 <li>Add some logic to your main activity that checks whether the expansion files have
480 <li>Right-click the Android project in which you want to use APK expansion files and
500 application, you'll be able to quickly integrate the ability to download expansion files from
501 Google Play. The format that you choose for the expansion files and how you read them
510 using ZIP files for your expansion files, we suggest you also add the APK Expansion Zip Library to
518 <p>In order to download the expansion files, the Downloader Library
527 <!-- Required to download files from Google Play -->
530 <!-- Required to keep CPU alive while downloading files
542 <!-- Required to read and write the expansion files on shared storage -->
557 addition to downloading the expansion files for you, the {@code DownloaderService} also:</p>
569 <li>Verifies that the shared storage is mounted and available, that the files don't already exist,
570 and that there is enough space, all before downloading the expansion files. Then notifies the user
682 responsible for verifying whether the expansion files are already on the device and initiating
689 <li>Check whether the files have been downloaded.
699 whether the expansion files already exist on the device:</p>
735 <li>{@code NO_DOWNLOAD_REQUIRED}: Returned if the files already
748 NO_DOWNLOAD_REQUIRED}, then the files are available and your application can start.</p>
754 // Check if expansion files are available before going any further
777 startApp(); // Expansion files are available, start the app
903 <dd>Sets user preferences for network types on which its OK to download the files. The
906 expansion files. You might want to provide a user preference to enable downloads over
933 expansion files:</p>
956 <p>Once your APK expansion files are saved on the device, how you read your files
958 expansion files can be any kind of file you
962 <p>Regardless of how you read your files, you should always first check that the external
975 <p>As described in the <a href="#Overview">overview</a>, your APK expansion files are saved
982 <p>To get the location and names of your expansion files, you should use the
984 android.content.Context#getPackageName()} methods to construct the path to your files.</p>
987 to both your expansion files:</p>
990 // The shared path to all app expansion files
999 // Build the full path to the app's expansion files
1049 <h3>Reading media files from a ZIP</h3>
1050 <p>If you're using your expansion files to store media files, a ZIP file still allows you to
1054 this to work, you must not perform additional compression on the media files when creating the ZIP
1065 files when they're saved as ZIP files. Using this library allows you to easily read resources from
1066 your ZIP expansion files as a virtual file system.</p>
1072 <dd>Provides some methods to access expansion file names and ZIP files:
1077 files.</dd>
1089 file system based on your ZIP files. You can get an instance using {@code
1109 android.content.ContentProvider} that marshals the data from the ZIP files through a content
1111 expect {@link android.net.Uri} access to media files. For example, this is useful if you want to
1121 // Get a ZipResourceFile representing a merger of both the main and patch files
1131 patch expansion file, by reading from a merged map of all the files from both files. All you
1147 <p>For more information about using this library for your expansion files, look at
1149 verify the downloaded files using CRC. Beware that if you use this sample as the basis for
1151 files</strong> in the {@code xAPKS} array.</p>
1159 expansion files and downloading the files.</p>
1165 should test your application's ability to read the files from the shared storage. All you need to do
1166 is add the files to the appropriate location on the device shared storage and launch your
1171 Play will save your files.
1177 <li>Manually add the expansion files to that directory. Be sure that you rename your files to
1193 <p>Here are some reminders about handling the expansion files:</p>
1195 <li><strong>Do not delete or rename</strong> the {@code .obb} expansion files (even if you unpack
1207 <p>Because your application must sometimes manually download the expansion files when it first
1209 for the URLs, download the files, and save them to the device.</p>
1215 files as soon as the main activity starts.</p>
1226 <p>One of the great benefits to using expansion files on Google Play is the ability to
1228 allows you to provide two expansion files with each APK, you can use the second file as a "patch"
1234 files. Your application code must perform any necessary patches itself.</p>
1236 <p>If you use ZIP files as your expansion files, the <a href="#ZipLib">APK Expansion Zip
1252 <p>Here are a few issues to keep in mind regarding updates to expansion files:</p>
1255 <li>There can be only two expansion files for your application at a time. One main expansion
1260 However, the Apk Expansion package includes a library for using ZIP files
1261 as expansion files, which merges the data from the patch file into the main expansion file so