Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - MrPlow

Pages: 1 2 [3] 4 5 ... 19
Space Fractal:

Im diddent split this thread correctly, but its was me that tried to property implements admob to glbasic, so we could use java calls to show the ads. Its turned out its was impossible to call java that ways, but required to been inside the Activity. So im have chosen to remove it again and let the original MrPlow implemented stays as its was 100% legit post about it and possible way.


Thanks SF

I will try your file!!

Also updated steps above to include dependancy for build.gradle file.

Hi All,
For GLB users that are interested in Android Studio development and want controller and in-app Ads.

ANDROID ADMOB with Android Studio

Requires the *New* versions of and AStudio files. The new update from SF (Im also might edit this post) works perfectly for instant placement of Interstitial Ads in your Apps. This update is still not pushed to steam.

First at all you need a newer version of Android Studio glbasic build, that is now on steam as a beta:

Step 1

AndroidManifest.xml - add meta info

            android:value="ca-app-pub-3940256099942544~3347511713" />
<!-- replace testid with own id -->

            android:theme="@android:style/Theme.Translucent" />


Step 2

Open string.xml in the res > values folder
Add the following:

<string name="MobileAds_setAdUnitId">ca-app-pub-3940256099942544/1033173712</string>

Note: When live you can replace testid with your own app advert id provided by Admob console

Step 3
open build.gradle file within the "app" folder in Android Studio
add the bolded item to dependancies, so its look like this (its near the bottom of it and the old one can been replaced):

Code: (glbasic) [Select]
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation ''

in the soon steam update, then the lines has allready been added for new projects, but admob just commented out.

Step 4

Open Android Studio, right click on and then let it Open in Explorer from the file you have downloaded from the top of the post.

Those 3 files should been placed and eventuelt replace the Java files in that folder.

Open in AStudio

 ** New version of is being pushed to Steam soon, so you can skip this step over **

Step 5

In GLBASIC when invoking the ads there is no need to re-load ads - the admob listener takes care of that.

Code: (glbasic) [Select]
IMPORT "C" const char* android_JAVACALL(const char* string)

FUNCTION JavaCall$: callStr$
res$ = android_JAVACALL(callStr$)

The above function let you call Java function from Glbasic.

// Run after a command press or touchscreen to start a gameloop / next level / or jump back to main menu
// This call the ads its self and also load a new one.
// Also if a ads has been failed, no ads will been shown, but will try again next time you using it.


// This returns the current status of ads, if something is happens, fails or succes.

Good luck!

Thanks to SF for sticking it out and getting it sorted in the end!


SPACE FRACTAL: This works DOES work now, and im ends with to use tilt, keys and touch events to pickup the JavaCalls from a Activity.


Space Fractal: This section is heavy edited as its now much better implemeted and now can use all the JOY() commands for all officiel Google supported JoyPads. Those is controllers that works its self on the system navigation as well ouya. Im have tested successful with PS4 and Microsoft One wired controllers on a Android 9 based Android TV. Im do of course cannot guarantee any joypads works of course.

Now you can use GETJOYNAME$(ID) to get a kind of joystick, if there is any of them. GETJOYNAME$(0) is allways to been used by like a TV Remote as well for TILT. GETJOYNAME$(1) when connected is used by the first connected gamepad controller. Howover with wired controllers on a Android TV might have ID as Player 3, not as Player 1. Be aware of that!

Currectly back, menu and start buttons is NOT supported, howover they do returns a KEY() value throught.

when using Gamecontrollers with KEY():

You can also uses KEY() command for checking values as well. You can respons to controller by KEY() values using the image seens here. Also if you do a remapping/rebind feature, then you could support even more controllers. But this is for single player only as its will been checked by all game controllers by once!

The values a game controller would return, would have those values seens on the image. Sticks can also return a float to the KEY() commands as well. Been beware of that. Howover this is disabled by default, and can been enabled by editing the strings.xml.

You can also uses Tile (using the accelerator sensor), which is routed to the GETJOYX(0) and GETJOYY(0) commands, while Orientation is routed to GETJOYRX(0) and GETJOYRY(0). The later one is the orientation (360 degree) converted to axis.

Check it out...

- USB Game Controller (please let me know if this works for you)
- Classic Asteroids Gameplay
- In Game Ads on Pause or Home buttons.

Feedback welcome...Make sure version 1.08 or more


I am using stopsound to help create a audio effect in my app but notice this affects other channels as well as my intended sound.
Any idea of how to improve or guarantee a sound playing?
BTW - only happening so far with the mobile version

Announcements / Book
« on: 2019-Nov-08 »
Hi Guys

For any of you that like to read! *prepare for shameless plug*

My book is available on all the best online bookstores :) And is a popular Gift Item in the Game Programming categories...

Aimed at those who grew up with Micros...

Bug Reports / Netwebget$
« on: 2019-Oct-31 »
For those that might experience this issue in v16

I notice strange block chars appearing in my highscore tables at the start and end of a netwebget$.
It must be unicode issue or something...

Below is my fix for the issue..

Code: (glbasic) [Select]

// cleanup string
LOCAL mstr$
FOR x = 1 TO LEN(scoretable$)
  IF ASC(mstr$)<32 OR ASC(mstr$)>96
      IF mstr$="|" THEN newscore$=newscore$+mstr$

Bug Reports / Enable Mouse Pointer
« on: 2019-Aug-13 »
I get this when I compile:

!!! EnableMouseInPointer() not found in user32.dll. If this is >=Win8, you get no mouse messages.

Is there a simple fix for this?

GLBasic - en / GLB Editior Styles
« on: 2019-Aug-11 »

Is there a simple way to copy styles from GLB vX to GLB v16.?

GLBasic - en / Android - has anyone tried yet?
« on: 2019-Aug-03 »

Just wondering if anyone has tried the android studio update to build 32/64 versions of GLB apps for mobile?

Can't seem to find any docs on it - how to start / steps involved / etc.

Hi Guys

Looking for one that works without needing seedrnd?


Bug Reports / GLB v12.308 and v14.01 SEEDRND
« on: 2019-Jul-29 »
I know I am using an older versions of the GLB at the moment - I need to for my android apps (for now)
But my issue is that SEEDRND seems to be broken on it.

Is that the case or is there a workaround for it?

both version generate completely differently results for a seed.
Is it possible I am placing it in the wrong position in the code - does that factor into it?

Off Topic / Goodreads reviews
« on: 2019-Jul-28 »
Hi Guys,

For anyone that ready any of my books, I am looking for reviews on goodreads - they don't require anything other than reviewers are goodreads members. If you add to the shelf-tag of "Video Games" - that would be a bonus.


GLBasic - en / IDE question
« on: 2019-Jul-05 »
Does anyone know how to disable the 'clean project' icon?
I just clicked on it and undid tons of custom changes for me...

Luckily I had a backup but I want to avoid doing this again...

I have managed remove dy disabling the 'toolbar' panel - but ideally I just want the 'cleanup' icon removed.

GLBasic - en / A bit rusty!
« on: 2019-Jul-05 »
Hi Guys

I am having problems getting shift+wasd keys working to detect if shift was depressed...It must be something painfully simple that i am doing wrong....

my code looks like so

keyLeft =key(30)
keyshift = key(42)

if keyleft and keyshift then do something

GLBasic - en / Error compiling...
« on: 2019-Jul-04 »
Hi Guys

Anyone know why this is appearing...what could cause it?
The app in question was compiling fine recently.

     [echo] Project Name: glbasic
  [gettype] [Fatal Error] :39:1: Content is not allowed in trailing section.

C:\GLBasic_v123\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:407: org.xml.sax.SAXParseException; lineNumber: 39; columnNumber: 1; Content is not allowed in trailing section.

Pages: 1 2 [3] 4 5 ... 19