Lines Matching full:your
2 page.metaDescription=If your app needs more than the 100MB APK max, use free APK expansion files from Google Play.
46 <li><a href="#Testing">Testing Your Expansion Files</a>
52 <li><a href="#Updating">Updating Your Application</a></li>
66 <p>Google Play currently requires that your APK file be no more than 100MB. For most
69 Previously, if your app exceeded 100MB, you had to host and download the additional resources
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
77 SD card or USB-mountable partition; also known as the "external" storage) where your app can access
79 downloads the APK, so your application has everything it needs when the user opens it for the
80 first time. In some cases, however, your application must download the files from Google Play
81 when your application starts.</p>
94 primary expansion file for additional resources required by your application.</li>
104 <p>However, even if your application update requires only a new patch expansion file, you still must
112 not use the patch expansion file to perform patching for your app. You must perform patching
143 <dd>Your application's Java-style package name.</dd>
146 <p>For example, suppose your APK version is 314159 and your package name is com.example.app. If you
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
158 <p>The specific location for your expansion files is:</p>
167 <li>{@code <package-name>} is your application's Java-style package name, available
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
177 in the same directory. You should save your unpacked files in the directory
181 project called the <a href="#ZipLib">APK Expansion Zip Library</a> that reads your data directly
191 need to unpack your ZIP. In order for this to work, you must not perform additional compression on
200 <p>Most of the time, Google Play downloads and saves your expansion files at the same time it
203 files. To handle these situations, your app must be able to download the files
209 <li>User selects to install your app from Google Play.</li>
215 <li>When the user launches your application, your app must check whether the expansion files are
218 <li>If yes, your app is ready to go.</li>
219 <li>If no, your app must download the expansion files over HTTP from Google Play. Your app
230 device when your application starts. As discussed in the following section about <a
240 <p>Here's a summary of the tasks you should perform to use expansion files with your
244 <li>First determine whether your application absolutely requires more than 100MB per installation.
245 Space is precious and you should keep your total application size as small as possible. If your app
246 uses more than 100MB in order to provide multiple versions of your graphic assets for multiple screen
250 <li>Determine which application resources to separate from your APK and package them in a
253 the main expansion file. However, if your resources exceed the 2GB limit for the main
254 expansion file, you can use the patch file for the rest of your assets.</p>
256 <li>Develop your application such that it uses the resources from your expansion files in the
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
269 Library</a> to implement your download behavior.</p>
270 <p>If you build your own download service instead of using the library, be aware that you
275 <p>Once you've finished your application development, follow the guide to <a href="#Testing">Testing
276 Your Expansion Files</a>.</p>
285 <p>Adding APK expansion files is a feature available when you upload your application using the
286 Developer Console. When uploading your application for the first time or updating an
291 <li>In order to download your expansion files from Google Play, <strong>the user must have
292 acquired your application from Google Play</strong>. Google Play will not
293 provide the URLs for your expansion files if the application was installed by other means.</li>
294 <li>When performing the download from within your application, the URL that Google Play
296 to your application.</li>
297 <li>If you update your application with a new APK or upload <a
309 <li>You cannot issue an update to your application by changing the expansion files
310 alone—<strong>you must upload a new APK</strong> to update your app. If your changes only
311 concern the assets in your expansion files, you can update your APK simply by changing the <a
315 <li><strong>Do not save other data into your <code>obb/</code>
319 performing an update). Doing so will cause Google Play (or your app itself) to repeatedly
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
336 application launches for the first time. However, in some cases your app must download the
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>
352 href="{@docRoot}google/play/licensing/index.html">Application Licensing</a> to get your
359 <p class="note"><strong>Note:</strong> The URL that Google Play provides for your
361 your application.</p>
370 <p>If your application is free (not a paid app), then you probably haven't used the <a
373 licensing policies for your application and ensure that the user has the right to
374 use your app (he or she rightfully paid for it on Google Play). In order to facilitate the
376 to your application that includes the URL of your application's expansion files that are hosted
377 on Google Play. So, even if your application is free for users, you need to include the
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>
382 <p class="note"><strong>Note:</strong> Whether your application is free or not, Google Play
383 returns the expansion file URLs only if the user acquired your application from Google Play.</p>
387 As you build this procedure into your application, there are several issues you should take into
394 interaction and allow the user to leave your app while the download completes.</li>
401 your application when selected.</li>
407 performs all of the tasks listed above, and even allows your activity to pause and resume the
408 download. By adding the Downloader Library and a few code hooks to your application, almost all the
410 user experience with minimal effort on your behalf, we recommend you use the Downloader Library to
411 download your expansion files. The information in the following sections explain how to integrate
412 the library into your application.</p>
414 <p>If you'd rather develop your own solution to download the expansion files using the Google
418 APKExpansionPolicy}</a> class (included in the License Verification Library) as your licensing
425 <p>To use APK expansion files with your application and provide the best user experience with
426 minimal effort on your behalf, we recommend you use the Downloader Library that's included in the
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
440 <li>Implement a callback interface with a few methods in your main activity that
444 <p>The following sections explain how to set up your app using the Downloader Library.</p>
450 download two packages from the SDK Manager and add the appropriate libraries to your
485 <p>Or, from a command line, update your project to include the libraries:</p>
489 LVL and the Downloader Library to your project. For example:
498 <p>With both the License Verification Library and Downloader Library added to your
501 from the shared storage is a separate implementation that you should consider based on your
509 using ZIP files for your expansion files, we suggest you also add the APK Expansion Zip Library to
510 your application. For more information, see the section below
518 requires several permissions that you must declare in your application's manifest file. They
567 <li>Allows your application to manually pause and resume the download.</li>
573 <p>All you need to do is create a class in your application that extends the {@code
578 <dd>This must return a string that is the Base64-encoded RSA public key for your publisher
585 Obfuscator}</a>. The salt ensures that your obfuscated {@link android.content.SharedPreferences}
586 file in which your licensing data is saved will be unique and non-discoverable.</dd>
589 your application that should receive the alarm indicating that the download should be
597 // You must use the public key belonging to your publisher account
622 to be the public key belonging to your publisher account. You can find the key in the Developer
623 Console under your profile information. This is necessary even when testing
624 your downloads.</p>
626 <p>Remember to declare the service in your manifest file:</p>
640 delivers an {@link android.content.Intent} to a {@link android.content.BroadcastReceiver} in your
666 in your service's {@code getAlarmReceiverClassName()} method (see the previous section).</p>
668 <p>Remember to declare the receiver in your manifest file:</p>
680 <p>The main activity in your application (the one started by your launcher icon) is
722 <li><code>context</code>: Your application's {@link android.content.Context}.</li>
723 <li><code>notificationClient</code>: A {@link android.app.PendingIntent} to start your main
728 <li><code>serviceClass</code>: The {@link java.lang.Class} object for your implementation of
742 same and you normally don't need to be concerned about them. In your main activity that calls {@code
745 the Downloader Library begins the download and you should update your activity UI to
747 NO_DOWNLOAD_REQUIRED}, then the files are available and your application can start.</p>
784 downloaderService)}. The {@code IStub} provides a binding between your activity to the downloader
785 service such that your activity receives callbacks about the download progress.
786 <p>In order to instantiate your {@code IStub} by calling {@code CreateStub()}, you must pass it
787 an implementation of the {@code IDownloaderClient} interface and your {@code DownloaderService}
789 the {@code IDownloaderClient} interface, which you should usually implement in your {@link
792 CreateStub()} to instantiate your {@code IStub} during your activity's {@link
814 <p>After the {@link android.app.Activity#onCreate onCreate()} method returns, your activity
816 call {@code connect()} on the {@code IStub}, passing it your application's {@link
818 {@code disconnect()} in your activity's {@link android.app.Activity#onStop onStop()} callback.</p>
836 <p>Calling {@code connect()} on the {@code IStub} binds your activity to the {@code
837 DownloaderService} such that your activity receives callbacks regarding changes to the download
855 <dd>After you instantiate the {@code IStub} in your activity, you'll receive a call to this
856 method, which passes a {@link android.os.Messenger} object that's connected with your instance
880 <p>To provide a useful message to your users, you can request a corresponding string
919 <p>If you decide to build your own downloader service instead of using the Google Play
944 href="{@docRoot}google/play/licensing/adding-licensing.html">Adding Licensing to Your App</a>,
955 <p>Once your APK expansion files are saved on the device, how you read your files
956 depends on the type of file you've used. As discussed in the <a href="#Overview">overview</a>, your
961 <p>Regardless of how you read your files, you should always first check that the external
965 <p class="note"><strong>Note:</strong> When your application starts, you should always check whether
968 that represent the state of the external storage. In order for it to be readable by your
974 <p>As described in the <a href="#Overview">overview</a>, your APK expansion files are saved
981 <p>To get the location and names of your expansion files, you should use the
983 android.content.Context#getPackageName()} methods to construct the path to your files.</p>
985 <p>Here's a method you can use in your application to get an array containing the complete path
986 to both your expansion files:</p>
1028 <p>You can call this method by passing it your application {@link android.content.Context}
1049 <p>If you're using your expansion files to store media files, a ZIP file still allows you to
1063 helps you read your expansion
1065 your ZIP expansion files as a virtual file system.</p>
1088 file system based on your ZIP files. You can get an instance using {@code
1090 path to your expansion file. This class includes a variety of useful methods, but you generally
1116 <p>When using the APK Expansion Zip Library, reading a file from your ZIP usually requires the
1129 <p>The above code provides access to any file that exists in either your main expansion file or
1131 need to provide the {@code getAPKExpansionFile()} method is your application {@code
1146 <p>For more information about using this library for your expansion files, look at
1149 your own implementation, it requires that you <strong>declare the byte size of your expansion
1155 <h2 id="Testing">Testing Your Expansion Files</h2>
1157 <p>Before publishing your application, there are two things you should test: Reading the
1163 <p>Before you upload your application to Google Play, you
1164 should test your application's ability to read the files from the shared storage. All you need to do
1165 is add the files to the appropriate location on the device shared storage and launch your
1169 <li>On your device, create the appropriate directory on the shared storage where Google
1170 Play will save your files.
1171 <p>For example, if your package name is {@code com.example.android}, you need to create
1173 your test device to your computer to mount the shared storage and manually create this
1176 <li>Manually add the expansion files to that directory. Be sure that you rename your files to
1188 <li>Now that the expansion file(s) are on the device, you can install and run your application to
1189 test your expansion file(s).</li>
1195 the data to a different location). Doing so will cause Google Play (or your app itself) to
1197 <li><strong>Do not save other data into your <code>obb/</code>
1206 <p>Because your application must sometimes manually download the expansion files when it first
1207 opens, it's important that you test this process to be sure your application can successfully query
1210 <p>To test your application's implementation of the manual download procedure,
1213 If everything works as expected, your application should begin downloading the expansion
1223 <h2 id="Updating">Updating Your Application</h2>
1226 update your application without re-downloading all of the original assets. Because Google Play
1232 the Android system nor Google Play perform actual patching between your main and patch expansion
1233 files. Your application code must perform any necessary patches itself.</p>
1235 <p>If you use ZIP files as your expansion files, the <a href="#ZipLib">APK Expansion Zip
1237 your
1247 in the Developer Console, users who previously installed your application will not
1254 <li>There can be only two expansion files for your application at a time. One main expansion
1256 previous version (and so must your application when performing manual updates).</li>
1257 <li>When adding a patch expansion file, the Android system does not actually patch your
1258 application or main expansion file. You must design your application to support the patch data.