Search code examples
androidandroid-sdk-toolsapk-expansion-files

How to create .obb file as main apk expansion file using jobb tool?


I have an apk of 80Mb and so am not able to upload it on google play store. I have googled a lot and found that I have to create .obb file as the main expansion file.

Also I have found that I can create a .obb file using the jobb tool which is inside sdk > tools > jobb.bat but unfortunately it closes just after it starts.

So am I missing something?


Solution

  • i have googled and found that we shold have to make .zip with 0% (No compression) that is mention in http://developer.android.com/google/play/expansion-files.html

    Tip: If you're packaging media files into a ZIP, you can use media playback calls on the files with offset and length controls (such as MediaPlayer.setDataSource() and SoundPool.load()) without the need to unpack your ZIP. In order for this to work, you must not perform additional compression on the media files when creating the ZIP packages. For example, when using the zip tool, you should use the -n option to specify the file suffixes that should not be compressed: zip -n .mp4;.ogg main_expansion media_files

    OR How to make 0% compression zip using winrar?

    enter image description here

    here see the compression method

    so we should have to upload this zip in play store.

    so you not need to use ZipHelper.java

    just simply use

    ZipResourceFile expansionFile=null;
    
                try {
                    expansionFile = APKExpansionSupport.getAPKExpansionZipFile(getApplicationContext(),3,0);
    
                         AssetFileDescriptor fd = expansionFile.getAssetFileDescriptor("test.mp4");
                         MediaPlayer mPlayer = new MediaPlayer();
                         mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
                         mPlayer.setDataSource(fd.getFileDescriptor(),fd.getStartOffset(),fd.getLength());
                         mPlayer.prepare();
                         mPlayer.start();
    
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }