I am currently porting my game to create an apk package and, after some experimenting, I'm finally getting some decent results.

However, since the project is rather complex, I have some issues to raise, hoping to find some work around.

1) I do appreciate the fact that the compiler can wrap "external" files to the package by using the "GetAsset" command. Nonetheless, despite the compiler GUI can link files coming from subdirectories (eg: C:\Users\Gianluca\Desktop\TSMC_And\Data\Stills\entry-credit03.tif), they need to be put in a single directory at executable level. What I mean is that the original code:

LoadBrush(503,"Data/Stills/entry-credit03.tif")

must now become:

LoadBrush(503,GetAsset("entry-credit03.tif"))

It is not a big deal, yet it forces to modify the entire original code, something that it is not error-safe in a project with over 40K lines of code.
I'll try to deal with that a little bit at the time, but I think it should be nice if in the future such a feature could be implemented, since I think it is easier to code a project where resources are grouped into meaningful drawer (Backgrounds, Sprites, Props, Sounds etc...) rather then putting all of them in a single one.

2) At present resouces can be linked to the code by using the "Assets" tab of the APK Compiler. I found no other way to do it than loading them one by one, since the "Add.." button accept only a single selection at the time. Again, the game holds hundres of resources divided in graphics and sounds, and it really takes forever (besides not being error free). Saving the project as ".acp" is sure a very good help (thanks guys, I really mean it) but again, I hope to see an improvement in the future for this matter as well.

3) Finally, the game needs to save and load progress and system data. How does this work on Android? I mean, how does the "GetAsset" command works in this case? Does it sport a behaviour similar to any other file-related instruction? In other words, can i transform these lines ....

If Exists("Saved_game/my_global_variables.bin") And Exists("Saved_game/world.bin")
p_LoadData()
........

in something like ....

If Exists(GetAsset("my_global_variables.bin")) And Exists(GetAsset("world.bin"))
p_LoadData()
......

Thanks for your time and thanks for making this possible.
Gianluca aka g0blin

g0blin wrote:1) I do appreciate the fact that the compiler can wrap "external" files to the package by using the "GetAsset" command. Nonetheless, despite the compiler GUI can link files coming from subdirectories (eg: C:\Users\Gianluca\Desktop\TSMC_And\Data\Stills\entry-credit03.tif), they need to be put in a single directory at executable level. What I mean is that the original code:

LoadBrush(503,"Data/Stills/entry-credit03.tif")

must now become:

LoadBrush(503,GetAsset("entry-credit03.tif"))

It is not a big deal, yet it forces to modify the entire original code, something that it is not error-safe in a project with over 40K lines of code.
I'll try to deal with that a little bit at the time, but I think it should be nice if in the future such a feature could be implemented, since I think it is easier to code a project where resources are grouped into meaningful drawer (Backgrounds, Sprites, Props, Sounds etc...) rather then putting all of them in a single one.

2) At present resouces can be linked to the code by using the "Assets" tab of the APK Compiler. I found no other way to do it than loading them one by one, since the "Add.." button accept only a single selection at the time. Again, the game holds hundres of resources divided in graphics and sounds, and it really takes forever (besides not being error free). Saving the project as ".acp" is sure a very good help (thanks guys, I really mean it) but again, I hope to see an improvement in the future for this matter as well.

Yes, you're right. For huge projects this is of course very cumbersome. I'll see if I can improve the APK Compiler to allow importing whole asset folders. This should make it much easier for you then.

3) Finally, the game needs to save and load progress and system data. How does this work on Android? I mean, how does the "GetAsset" command works in this case? Does it sport a behaviour similar to any other file-related instruction? In other words, can i transform these lines ....

I just finished to adapt the original TSMC code to make it work with the Android compiler (usage of "GetAsset()" etc).

The code works just fine and the only "bugs" I had to correct were related to upper case/lower case syntax, due to the Unix nature of some part of the apk compiler.

In the interest of the community I'd like to report that, despite it being a huge project, I didn't encounter any particular issue. Even the save/load part of the code worked just out of the box, without any need to exploit the path returned by GetSystemInfo().Preferences.

I finished the port, I thouroghly tested it on my devices an I was ready to upload it on Play Store.
Sadly ... I found out the max package size is 100MB, and my game is above 200MB!

Lowering graphics resolution and/or color depth is, unfortunately, not an option, so I need to find a work around.
According to Android Devs page there is the possibility to link the main app with so-called "expansion files" but, as far as I understand, it's something possible only if you are using Android Studio (and its APIs) to develop the software.

I searched Hollywood docs but I did not find constructs like "getExternalFileDirs()", "Manifest.permission.WRITE_EXTERNAL_STORAGE" and so on.