Author Topic: Android - has anyone tried yet?  (Read 8373 times)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3918
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #45 on: 2019-Aug-19 »
there Opengl issue is more like this one:
https://discourse.libsdl.org/t/sdl2-2-0-7-android/23547

But its does run as its seen, that the matter. anyway the Android Crashes was more about connection in the emulator and not the app its self. but just make sure to close it down before launch a new one.

We are howover on SDL version 2.0.9 (required due Google Play requirements).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1716
    • View Profile
Re: Android - has anyone tried yet?
« Reply #46 on: 2019-Aug-19 »
API-22 using Pixel 3 emu - fails
API-27 on Pixel is fine

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3918
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #47 on: 2019-Aug-20 »
im found the reason for that, but still not sure to  fix it. Its fails when loading your sprite and its try to load them in bmp, png, jpg versions. you cant do that. So here we required to check the extension of the file and then load the image directly, then the game will run.

etc its fails on this line in c++:
Code: (glbasic) [Select]
    if (!image.LoadImageBMP(szFileName, colorkey) && !image.LoadImagePNG(szFileName, colorkey) &&
        !image.LoadImageJPG(szFileName)) {
        g_debug("Image can't be loaded: %s\n", szFileName);
        return false;
    }

if im remove the BMP and JPG lines and only load them in PNG, then the game launch and works.

Code: (glbasic) [Select]
    if (!image.LoadImagePNG(szFileName, colorkey)) {
        g_debug("Image can't be loaded: %s\n", szFileName);
        return false;
    }

im thinks if the file does not exist here as its will happens on bmp or jpg, then glbasic would simply just shutdown on some devices.

Also you dont need to use Check_Assests() commands at all anymore, this happens automatic when loading files.
« Last Edit: 2019-Aug-20 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1716
    • View Profile
Re: Android - has anyone tried yet?
« Reply #48 on: 2019-Aug-20 »
Thanks! Yes - I did an immediate "return" within checkassets to ignore it.

Great! I never use jpg or bmp anyways...which file do i replace this in? nevermind: did a search and found in lib_glbasic.cpp
« Last Edit: 2019-Aug-20 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3918
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #49 on: 2019-Aug-20 »
    if (!image.LoadImageBMP(szFileName, colorkey) && !image.LoadImagePNG(szFileName, colorkey)) {
          g_debug("Image can't be loaded: %s\n", szFileName);
          return false;
    }

do also still works too (bmp and png), so there is something monkey with the JPG loader that might crash for some reasons on some devices.

So until then do NOT use jpg in your android project.
« Last Edit: 2019-Aug-20 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1716
    • View Profile
Re: Android - has anyone tried yet?
« Reply #50 on: 2019-Aug-20 »
What is best way to refresh - reload the GLBASIC editor version to the A Studio - so that I don't run older version?

 - Refresh linked C++ files
- Rebuild Project
- Build app

*takes long time*
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3918
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #51 on: 2019-Aug-20 »
you should only need to build once, which is what im have do (but here im also have not touched glbasic when testing your projects). So its should only been the first time that might take anything from 3-10 minuttes to create the build folder.

If you change something, AS should automatic reflect to that. But its mightbeen a good idea to rebuild just before the releaase version.
« Last Edit: 2019-Aug-20 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1716
    • View Profile
Re: Android - has anyone tried yet?
« Reply #52 on: 2019-Aug-20 »
4.197 4576-4576/? D/hidapi: Initializing Bluetooth
08-20 11:59:54.198 4576-4576/? D/hidapi: Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH
08-20 11:59:54.221 4576-4576/? I/glbasic: SDK: 22
08-20 11:59:54.221 4576-4576/? I/glbasic: dataDir is /data/data/com.gazzappergames.breakerbricksprem/files
08-20 11:59:54.221 4576-4576/? I/glbasic: External data dir is not found or not got permissions. Im using internal data dir instead
08-20 11:59:54.221 4576-4576/? I/glbasic: ext_storage is /data/data/com.gazzappergames.breakerbricksprem/files/
08-20 11:59:54.223 4576-4576/? I/glbasic: Java_org_libsdl_app_SDLGlbasic_setFilesPath
08-20 11:59:54.224 4576-4576/? I/glbasic: Running on a non-TV Device
08-20 11:59:54.225 4576-4576/? I/glbasic: deadzone is: 500
08-20 11:59:54.727 4576-4576/? I/glbasic: OnResume()

Some reason looking for Bluetooth and file directory problems then further down...

08-20 11:59:56.011 4576-4597/com.gazzappergames.breakerbricksprem I/glbasic: =   /data/data/com.gazzappergames.breakerbricksprem/files/Media/Media

Also java call size is still running when I removed the checkasset code from source GLB editor - so not resetting correctly.



Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3918
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #53 on: 2019-Aug-20 »
Im do mean im just checkling you have the permission of not. Its should gracefull skip if not used.

The java calls size and copy is still called, but this is just called internal when you want to access a file, but this is happens automatic rather than manual.

its still required in order to copy the files from the apk to the internal memory.

This was added years ago when im got the source code first time and intergrated the javacalls from some of the official file commands.
« Last Edit: 2019-Aug-20 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1716
    • View Profile
Re: Android - has anyone tried yet?
« Reply #54 on: 2019-Aug-20 »
also, libs_glasic.cpp has many more JPG related references...so if the JPG type is crashing  - are they okay to use?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1716
    • View Profile
Re: Android - has anyone tried yet?
« Reply #55 on: 2019-Aug-20 »
checkassets is taken out of my project (ignored by code)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3918
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #56 on: 2019-Aug-20 »
yes, but dont worry about those jpg references. They only used when loading them. im not sure why its happens. Hopefully fixing it later (etc taking a look into that function).

you just dont need to checkassets manually anymore, so remove them from LOADSPRITEz as glbasic calls them automatic by any file access. This was fixed since im got the source code as im integrated that in some glbasic commands. Same with screen orientation.
« Last Edit: 2019-Aug-20 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3918
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #57 on: 2019-Aug-20 »
until im got it fixed, you can just after this function:

bool OPENGL_IMAGE::LoadImageJPG(const char *szFileName)

just do a return false right after the function. then any load reference will not use jpg loader.

Hopefully im can get its to gracefull return its correctly and just dont try to read the file if its not a jpg.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1716
    • View Profile
Re: Android - has anyone tried yet?
« Reply #58 on: 2019-Aug-20 »
until im got it fixed, you can just after this function:

bool OPENGL_IMAGE::LoadImageJPG(const char *szFileName)

just do a return false right after the function. then any load reference will not use jpg loader.

Hopefully im can get its to gracefull return its correctly and just dont try to read the file if its not a jpg.

Cool - now it runs - but the media directory is not found or in wrong place - no assets loading.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3918
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #59 on: 2019-Aug-20 »
dont change the java file with size/copy, howover how should the game title look like?
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.