BASIC

Author Topic: Android 6 Crashing  (Read 1735 times)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #15 on: 2017-Aug-29 »
which line?

if you also use a older SDK version as well, then im cant help. you need a least API 19 installed as well. The newest SDK the actuelly Android Extras using is API 22.

You might need to change you manifest to a least use that API as well. You should use this in your manifest.xml:

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="22" />

Recently im tested Greedy Mouse on a Samsung S8, which the game actuelly worked fine (im do not sure its crashed internally once?). Howover wide screen was not supported. Here im make sure we need a higher SDK version and few new lines to the manifest.

Also use PLATFORMINFO$("APPDATA") and not PLATFORMINFO$("DOCUMENTS") for saving data. And if the below fails, then its should now give a empty result:

Code: GLBasic [Select]
                try
                {

                        boolean ReadPermission = (getContext().checkCallingOrSelfPermission("android.permission.READ_EXTERNAL_STORAGE") == PackageManager.PERMISSION_GRANTED);            
                        boolean WritePermission = (getContext().checkCallingOrSelfPermission("android.permission.WRITE_EXTERNAL_STORAGE") == PackageManager.PERMISSION_GRANTED);
                        String ext_storage = "";
                        if (ReadPermission==true && WritePermission==true)
                        {       if (Build.VERSION.SDK_INT>18)
                                {       ext_storage = android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_DOCUMENTS).toString();
                                }
                                else
                                {       ext_storage = android.os.Environment.getExternalStoragePublicDirectory(android.os.      Environment.DIRECTORY_DOWNLOADS).toString();
                                }
                        }
                }
                catch(Exception e)
                {       ext_storage="";
                }
 

But you might not could write with hiscore on some devices.....

Property because its now so far in Android versions im property will set DOCUMENTS to been same as APP_DATA. Android is simply just strange sometimes.
« Last Edit: 2017-Aug-29 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #16 on: 2017-Aug-29 »
Thanks SF

I am using 19 SDK at present but my min="9" so I might change to 10.
That might help?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #17 on: 2017-Aug-29 »
Hi SF

My app crashes with the new try catch code - is it correct?
Spotted error with a gap below - will retry now

Code: GLBasic [Select]
android.os.      Environment.DIRECTORY_DOWNLOADS

« Last Edit: 2017-Aug-29 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #18 on: 2017-Aug-29 »
Hi

Still crashing with the new code - is there something I am missing?

I replaced the old code with this.

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

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #19 on: 2017-Aug-29 »
You should uses api-22, or its might crash on newer platforms. And also im wont reallt want to support mixed version of old and news, which can also cause to crash, if the newest version dosent.

DIRECTORY_DOWNLOADS is very dumb, its might crash on SOME devices, such as Ouya (when they updated it, then its crashed Greedy Mouse out too as im remember), while DIRECTORY_DOCUMENTS is more future proff, but is only exists from API-19 (Android 4.4) and up. But that require you have installed SDK 19 and is present that api in the Android SDK to get working. If you dont have that sdk.... then its will fails and you get a null pointer issue under compiling or code (etc that api present under \android-sdk-windows\platforms, you can have more than one api installed).

Also make sure the SDK using is also present, or you might get a null pointer issue under compiling. Is its Java issue you get from compiling or by runtime? If by compliing, its a too old SDK you using. Here im cant support you. The changes was happens since the issues on Ouya.

Also current target is Android 5.1 (Api-22) for Android Extras. Api 21 was required to get full screen support, which require some code as well. You should still could use Api 22 with a older Android Extras Versions as long you compile against Android 22 api. This to make sure DIRECTORY_DOCUMENTS works as intended.

You should also not use TRY, its was just a blind test.
« Last Edit: 2017-Aug-29 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #20 on: 2017-Aug-29 »
Ahh good. Without the try part is code works.

Will it still avoid crashing or less likely?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #21 on: 2017-Aug-30 »
If you uses 18 or older,  then it's might crash. Currently newest android extras uses 22. I'm shall uses newer version.... Mostly to support widescreen on newer android devices.

Android is sometimes also very strange and annoying.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #22 on: 2017-Aug-30 »
Also.... Ads might also crash out glbasic when resumed on some devices. This was why I'm gave up that, removed it and newer got er implemented to newest android again..... If ever? I'm don't have time yet to do that. I'm simply just got uninspired by now when I'm no longer uses android.

What I'm should have done is It's should have use the glbasic loop function really to avoid this kind of issues, example if you try to draw graphics while display a ads or such. Also it's would been more automatically too. But it's did newer happens.

But again I'm simply just not like that android anymore, due all those constantly issues. :-(. Now I know have succes with steam.....
« Last Edit: 2017-Aug-30 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #23 on: 2017-Aug-30 »
Hi SF,

I found your Admob implementation very stable and never get an feedback about crashing (when used with pause routine)
I mean that - its been working great!

here is the sdl and manifest.

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

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #24 on: 2017-Aug-30 »
It's not happens on all devices, but on some devices and some cases and not sure what happens. It's was happens here example due I ads. Soon I'm removed it, then it's worked nicely.

I'm also newer got Karma Miwa back to Google Play again due that and forgot all about it. Only Greedy Mouse. But for me I'm not using Android anymore (currently). Windows is the best platform. I'm also still using ios. Ios has a very great debugger.... Android.... You have none with glbasic and then hard to fix thing. I'm need a debugger some times.

Again I'm should reimplemented using the main loop function and not invoke it manually. Then it's would make sure nothing is draw in meantime.... I'm did few code, but got uninspired.

Property you can try out the newest version of Android extras and then copy back the I ads part back again?
« Last Edit: 2017-Aug-30 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #25 on: 2017-Aug-30 »
look like im did not really removed iads, but just dropped it. All code in  SDLActivity.java is still present in the newest Android Extras (but do more checking the service is used or not). So its the glbasic part that need recoded completly..... not the Java part. Its would been untouched.
« Last Edit: 2017-Aug-30 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #26 on: 2017-Aug-30 »
also... im also did indeeded fixed a crash issue when Ouya SDK is not used in 3.0.1 back in 2015. The Ouya code is simply just not used when the Ouya shop not used (its could crash if Ouya Shop could not find a key). You used 2.9.

Please note: Im have NOT removed iAds as im throught im did (dur crashed, im just leaved it)! Nor im have changed it. Only you can use more than one ads system and eventuelly the ads system will got removed when not used. So im have just slightly changed it. So you should been SAFE to use the newest version, even with glbasic 12.

Most thing was happens with improvement game controller support with better support to KEY() which was borked totally out. Etc to example get KEY(1) working and more.
« Last Edit: 2017-Aug-30 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #27 on: 2017-Aug-30 »
I will definitely think out up-ing my AE version.
I could create side folder for my GLB maybe in case it goes wrong.

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

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #28 on: 2017-Aug-30 »
but for me its no longer works with v14, due a compile error, but works with v12. Im need to talk with Gernot with that issue. Im have no clue here.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #29 on: 2017-Aug-30 »
Just noticed an error I never usually see

 native: pc 000000000009463c  /data/app/com.gazzappergames.centiplode.centipedeshooter-1/lib/arm/libmain.so (_ZN14OpenGLRainbows8DrawRectEiiiim+208)
  native: pc 0000000000072390  /data/app/com.gazzappergames.centiplode.centipedeshooter-1/lib/arm/libmain.so (_ZN11__GLBASIC__8DRAWRECTEiiiii+80)

Seems to caused when doing a Drawrect?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs