The implementation of Play Store is mostly done. The downloading works along with the download progress and cancel functions. These functions need to be implemented on the java side since we use the Play Asset SDK for Java. I also needed to call these functions from C++ and vice versa. So, for this, JNI comes into play. The current code for Android also uses JNI extensively for some of its functions. So, the base work was already done. I had to check the current implementation of one of the JNI functions and follow the steps used. The other thing I needed to do was create simple functions that handle Playstore SDK on the Java side.
In Playstore SDK, there is an interface called
AssetPackManager that contains the functions used in managing the downloads for the DLCs from Playstore. For starting a download, we can use the
fetch() method. It only needs a
packname, which is a unique string to identify a game package. I also had to create a listener that keeps track of the download progress, completion, and cancel events to call required functions.
To support the download of the DLCs, Play Store requires us to bundle the base APK (ScummVM) together with all the on-demand assets in an AAB format. I had previously created a Python script to bundle the AAB (containing only base APK) with games. The workflow for creating the final ready-to-upload AAB should be: extract games somewhere, fill some file (JSON or something else), and run gradle to generate the full AAB. The current workflow is more involved. I will also simplify this process next week.
Now only one week is remaining. I will focus on completing the Play Store support and simplifying the process of the AAB build. And, of course, writing proper documentation.