Page 1 of 1

Android apk and drawers

Posted: Sat Apr 23, 2016 3:18 am
by xabierpayet
is possible include some drawers with some hundreds of files inside an apk in android? is possible compress and uncompress archives directly from a hollywood application? (in android)

Re: Android apk and drawers

Posted: Sun Apr 24, 2016 11:38 am
by airsoftsoftwair
xabierpayet wrote:is possible include some drawers with some hundreds of files inside an apk in android?
No, only single files can currently be included directly as assets, not whole drawers.
is possible compress and uncompress archives directly from a hollywood application? (in android)
No, only single files using CompressFile() and DecompressFile().

Re: Android apk and drawers

Posted: Sun Apr 24, 2016 7:21 pm
by xabierpayet
ok, maybe is interesting update the compressfile and decompressfile comands, download 1000´s of files is not a good idea

Re: Android apk and drawers

Posted: Fri Apr 29, 2016 4:36 pm
by airsoftsoftwair
A plugin is planned for archive support.

Re: Android apk and drawers

Posted: Sun Apr 15, 2018 3:34 pm
by g0blin
Hello guys,

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

Re: Android apk and drawers

Posted: Mon Apr 16, 2018 10:37 pm
by airsoftsoftwair
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'd save data to the path returned by GetSystemInfo().Preferences.

Re: Android apk and drawers

Posted: Tue Apr 17, 2018 10:10 am
by g0blin
Thanks a lot mate,

you're the man!

The more I study Hollywood the more I like it!

Keep it up
Gianluca

Re: Android apk and drawers

Posted: Mon May 21, 2018 5:26 pm
by g0blin
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.

Finally, game saves are preserved during app update.

What can I say? Thanks, Andreas!

Re: Android apk and drawers

Posted: Wed May 23, 2018 7:55 pm
by airsoftsoftwair
Great, congratulations on your successful Android port!