My application is over 50MB because I use a lot of MP3 files. I typical do this ...
uri = Uri.parse("android.resource://red.cricket.RecordAlbum/" + R.raw.track_001_64kb );
... but if I have to use APK Expansion file I assume the above line of code has to change. But change to what? Any help is greatly appreciated!
Edit 1) Thanks for your answer Ted. I did create the expansion file like so:
red@ubuntu:~/android/workspace/Album/res/raw$ zip -n .mp3 main.1.com.redcricket.Album.obb *mp3
So what do I do now? rm -f *mp3; cd ../..; ant clean ; ant debug
rm -f *mp3; cd ../..; ant clean ; ant debug
Somehow I do not think that is going to work. Where do I put the main.1.com.redcricket.Album.obb
file?
The steps are pretty clearly laid out in the docs . In outline, the steps are:
Rewrite the app to look for the expansion file in the location
Context ctx = getContext(); String loc = ctx.getExternalStorageDirectory() + "/Android/obb/" + ctx.getPackageName();
Write code so that if the file is not there, your app will download it from Google Play, using the Application Licensing service as described in the docs. There's quite a bit of coding and configuration involved in this step.
Also see this thread for more details on how to do all this.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.