GLBasic forum

Main forum => GLBasic - en => Topic started by: S.O.P.M. on 2012-Feb-17

Title: Android compiling / Included graphics
Post by: S.O.P.M. on 2012-Feb-17
Hello,

there are 2 things I worry about. First I wanted to compile for an Android phone and another is somewhat special.

1. The Android compiling problem: As I've understand GLB does not only compile for it, it also installs the App on the Android device after that. Step 2 was not working for me so I copied the apk file to the device manually and installed it. I was able to get it to run but there were no sprite and font files loaded. What's the reason, aren't they included in the apk file?

2. I want to create an executable with graphic files for sprites and fonts included. I remember there was a demo that showed the trick but I can't find it anymore. Can someone please tell me how to do that?

Thanks in advance!
Title: Re: Android compiling / Included graphics
Post by: MrTAToad on 2012-Feb-17
QuoteWhat's the reason, aren't they included in the apk file?
They should be - check to see if they are in assets/media

QuoteI want to create an executable with graphic files for sprites and fonts included
I presume you are talking about my routine for creating sprites (and only sprites) from DATA statements - the idea is posted here : http://www.glbasic.com/forum/index.php?topic=4821.msg36656#msg36656 (http://www.glbasic.com/forum/index.php?topic=4821.msg36656#msg36656)
Title: Re: Android compiling / Included graphics
Post by: S.O.P.M. on 2012-Feb-17
QuoteThey should be - check to see if they are in assets/media
GLB creates all these folders while compiling but there were nothing inside assets/media. Do I have to copy the sources there and then compile again?

QuoteI presume you are talking about my routine for creating sprites (and only sprites) from DATA statements - the idea is posted here : http://www.glbasic.com/forum/index.php?topic=4821.msg36656#msg36656

Unfortunately no. I just found the right topic: http://www.glbasic.com/forum/index.php?topic=3408 but I still miss the example. I'm sure there was one.
Title: Re: Android compiling / Included graphics
Post by: MrTAToad on 2012-Feb-18
QuoteDo I have to copy the sources there and then compile again?
The latest versions of GLBasic will copy the stuff for you, so you shouldn't need to.
Title: Re: Android compiling / Included graphics
Post by: Gurumeditation on 2012-Feb-18
Yes it obvious, but it doesn't work. The mediafiles are not included in the apk
Title: Re: Android compiling / Included graphics
Post by: MrTAToad on 2012-Feb-18
And you are either moving to the Media directory before loading them or using the subdirectory name in with the filename ?
Title: Re: Android compiling / Included graphics
Post by: S.O.P.M. on 2012-Feb-18
Ok, second question is now cleared up.

http://www.dream-d-sign.de/forum/index.php?topic=9.0

This is what I was looking for.
Title: Re: Android compiling / Included graphics
Post by: S.O.P.M. on 2012-Feb-22
QuoteAnd you are either moving to the Media directory before loading them or using the subdirectory name in with the filename ?
As far as I remember, no. The problem is still unsolved.

Please, can anyone here verify to have successfully compiled for Android?

In my case, GLBasic does not copy the media files automatically and it shows an error while installing the App on the phone. By modifying the final apk file to have the media files in the res folder, the App cannot be installed manually too. All this is really annoying.
Title: Re: Android compiling / Included graphics
Post by: spacefractal on 2012-Feb-22
you cannot modify a compiled package, since there is a hash check included. That mean the default signature file would fail and you cannot install. That happens on iOS too. Which file structor do you have for your project?

Also are you sure the media folder is spelled Media and not media?
Title: Re: Android compiling / Included graphics
Post by: MrTAToad on 2012-Feb-23
My assets are certainly in Media - just testing on the Android emulator to make sure everything is displayed properly.

And yes it does...

This is with the latest version of GLBasic

If you want to make the project available we'll compile for Android and see what happens...

Or TeamView...