If you are using android studio and want to make use of the downloader library don't just copy the package name and java files into your own app src directory. (adding an expansion file is only possible from the second apk you upload and up) So make sure you see the apk expansion file listed when you click the details in the developer publish section under APK. You have to upload a version to Alpha or Beta first with expansion file. You can't use draft anymore as the link to get the expansion file won't be active yet. Some helfull information for people that end up here in this post since there are some things that changed in the way apk expansions work and also if you are using Android Studio to make the libraries work. Have you read through the APK Expansion Files? It's pretty straightforward. If your package name is, you need to create theĭirectory Android/obb// on the shared storageĪfter successful testing, you can upload your Expansion ZIP along with your APK through Developer's Console. I think the location in which you placed your ZIP file is incorrect. For example, if you placed flower.png under a directory called background inside your ZIP archive, you can have an InputStream to that file as follows: InputStream fileStream = expansionFile.getInputStream("background/flower.png") Notice that in the code above, InputStream will point to the file inside your ZIP archive and not the ZIP file itself. InputStream fileStream = expansionFile.getInputStream(pathToFileInsideZip) Get an input stream for a known file inside the expansion file ZIPs ZipResourceFile expansionFile = APKExpansionSupport.getAPKExpansionZipFile(appContext, You can read all your PNGs within Expansion ZIP file with this: // Get a ZipResourceFile representing a merger of both the main and patch files My question is simple, how can I simply create an expansion file and use my images without interfering with the user experience ? I have not found so many tutorials on Expansion Files, and no sample projects, so I'm a bit lost. I have implemented the following library : "downloader_library","licencing_library","Sample_downloader" and "zip_file"īut I didn't really used it for the moment. (and if I use a buffer, it still take >20s to load my application) I can see in a file explorer that ~10 PNG images are unzipped and in the Logcat that 1 file is extracted every second. Then, I use this code to unzip all my data on the storage of the phone, but when I start the app, I only get a blank screen for like 10s, and then Android tells me that the application is not responsive. So I use this simple command on Linux: _zip_ -0 _main.1._ *_.png_ on my /res/drawable-mdpi to create my expansion file and then put it manually to /Android/data// So I am trying to implement an expansion file which will contain all my PNGs. The application works perfectly in local but I can't upload an apk > 50mo. I am trying to do an application which contain ~80mo of PNG (It's an offline app so I have to store them on the phone).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |