WISHLIST: LIB: OBB and expansion pack downloads

jdiperla

Member
Licensed User
Longtime User
I recently have tried to figure out a way to use expansion packs. Generally, when you add an expansion pack, it will download along with your app automatically. However, there are also cases in which it wont and your app will need to download the expansion packs on its own.

I am hoping a library can be developed which would allow us to check to see if the expansion pack was downloaded, download the expansion pack if it wasn't and also have a function which can return the OBB File location and possibly extract it as well.

As a side note, I would probably even pay for a library like this(Between $15 and $25).
 

jdiperla

Member
Licensed User
Longtime User
If this is of any help to the Java/Library developers, I have a link to OBB Tutorials:

Android Development: APK Expansion Files in Android with Example

From what I am understanding from all the tutorials I read, there is a process:

1) Android attempts to download the expansion files. You can have up to two expansion files which are 2gb in size, max. The expansion files are OBB files, which are basically zips.

2) Your app needs to be able to locate the OBB files. If it cannot locate them, then it will need to download it from the google servers using an encryption key hash, which you wont get until you upload the expansion files first anyway.

3) Once you have determined that the OBB Files have been downloaded, you need to either use them as is, or extract them.

So from what I am gathering then, you would need a library that would work something like this:

B4X:
DIM DLexp as OBBPackageManager

If DLexp.checkobb1 = true & DLexp.checkobb2 = true  Then 'Checks if Expansion file one and two are downoaded
DLexp.ExtractContents(File.DirRootExternal)  'Extracts them to the location of your choice.
Else 
DLexp.DLOBB1   'Download Expansion 1
DLexp.DLOBB2   'Then 2

End If

Going down to where it detects that the file has been downloaded...

B4X:
Sub OBBDLFinish (OBBJob as OBBPackageManager) 
If OBBJob.DLBothSuccess = true Then    'If  both files were downloaded successfully.
DLexp.ExtractContents(File.DirRootExternal)
End If

End Sub

Once the files are extracted:

B4X:
Sub OBBExtractFinish 

DO WHATEVER...

End Sub

Hopefully this is a good starting point for motivation. I don't know. But I desperately need this turned into a library so that we can start putting expansion files with our apps.
 

jdiperla

Member
Licensed User
Longtime User
I want to put this back out there. Have we any news on OBB and expansions? Or even any tutorials?
 
Top