Android Extras (Micro Game Consoles/GPS/Keyboard/Audio)

Previous topic - Next topic

Ian Price

Code (glbasic) Select

IF (GameControllers("b5",0) OR GameControllers("PadR_Left", 0)>600 OR KEY(44)) THEN ...


- that's what I'm using (the KEY() bit is so that I can test on Windows and functions properly for other controls on OUYA).

Your Control code uses - CallJava$("JoySetButtonLayout:"+layout$)

Mine uses - JAVACALL$("JoySetButtonLayout:"+layout$)

But other than that they seem pretty much the same.






Am I missing something?
I came. I saw. I played.

spacefractal

#76
That due CallJava$ was used before FiveSprites renamed that to JAVACALL$ when he released the first version of AndroidExtras. Use JAVACALL$ of course, or you get a compile error instead.

But somewhere wierd, if you not using V1.0 Beta 5 if the GameController.java, due its did works correctly here. So im need the logcat eventuelly. Howover soon im will look on the back button issue again later today or tomorrow (im tired etc).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Ian Price

Perhaps that's the issue - not calling Java directly?

It's -

Quote// 1.6      15-oct-2013   SpaceFractal     New: NewAssets System.

according to the log system in AndroidExtras. Maybe my java bit is different and not upto date.
I came. I saw. I played.

spacefractal

#78
its about Check_Asset() function for loading assests. iIts have nothing to due with joy input at all.

Im just want to uses CallJava$ rather than correctly JAVACALL$ (both did do extractly the same). So dont worry about that.

Can you checkout and stdout ANDROIDKEYS$? in GameControllers()?

PS. Just updated AE to 1.6.2 to tryout and make sure its the version im have that working and also hopefully fixed back button (but require more checking).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Ian Price

How do I stdout  ANDROIDKEYS$ on the OUYA?

I'll check out the newer AE, but probably tomorrow now as I'm working on something completely different for someone else.

Cheers though :)
I came. I saw. I played.

spacefractal

open _logview.bat. im created a DEPRINT function for that (which either output to the IDE status or to the log). Not sure its in AndroidSample trought. Its a great thing when you want to debug thing when something went wrong.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Ian Price

Quote from: spacefractal on 2014-Jan-26
open _logview.bat. im created a DEPRINT function for that (which either output to the IDE status or to the log). Not sure its in AndroidSample trought. Its a great thing when you want to debug thing when something went wrong.

That just went right over my head. :P

I can't access my OUYA on my laptop (driver errors ahoy! so I use Dropbox for downloading), so how can I view the log view?

I think I might create a small test that only uses the right stick and see if it's something else in my code that's preventing them from being used.
I came. I saw. I played.

spacefractal

its still somewhere odd, since is works in Greedy Mouse when im tested it, so im hope you got it working. You need the ADB driver to work (when seen more stable in 4.1 than 2.2, which im never really got that to work), when you stdout strings. That im intersed is content in ANDROIDKEYS$ variable. That hold all button presses.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Ian Price

I couldn't get ADB to work, although tbf i didn't have a great deal of time to get it working and jumped quickly to Dropbox and I haven't given it a thought since.

Off to work soon (night shifts), so probably not going to have much time this week to sort things out. There's no rush as the game I'm working on needs a lot of graphics work doing - the bulk of the game code is already done.
I came. I saw. I played.

Ian Price

Quote from: spacefractal on 2014-Jan-25
its no reason doing that on OUYA, but on other android based console. So if you want to checks out, you can in GameControllers.java in around line 192 change this line:

if (motion==1) return false;

to

if (motion==1 && isOuya==false) return false;

This worked well in the fact that I no longer have to press a digital button first before accessing the left analog stick.

I'll have a look at the right stick tomorrow and create a simple test check, as it's still not working.
I came. I saw. I played.

MrPlow

Hi Ian,

How do I go about recording a fire using controller code for android extras ?

Hope u can help. :-)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Ian Price

QuoteHow do I go about recording a fire using controller code for android extras ?
Sorry?

Do you mean pressing a fire button with controllers?

I'm not at home at the moment, but you have to use something like -

Code (glbasic) Select

IF GameControllers("B1",0) THEN ...

B1 is button1, B2 is button 2 etc. the 0 indicates the first controller etc. I can't remember if the command above is accurate, but it's something like that. Look in the AndroidExtras section for B1 and you'll find the exact command.

If that doesn't answer your question, then please clarify.
I came. I saw. I played.

spicypixel

Quote from: spacefractal on 2014-Jan-25
im was not home, "Menu", should have been "Pause", which was mapped to the back button. Sorry for the confuction.

In newest version, Back when menu is enabled will quit, while back when menu is disabled will pause the app. Its property confuction how its works, so im changes that in the next version (very soon, im was just been home from my vacation).

PS. Look like its a bug in the latest SDLActivity.java, im got its fixed as important one. Im forget a "Return False;" in one place. Sorry SpicyPixel.

Awesome I shall implement the Pause instead of Menu and await the update fix ;) Much appreciated.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

MrPlow

Thanks Ian!
Much appreciated...is there a way to output what result is being generated by the function...
so if left the PRINT Control$,10,10 (and the result is shown?)

That way I could figure out all left / right etc...

Quote from: Ian Price on 2014-Jan-28
QuoteHow do I go about recording a fire using controller code for android extras ?
Sorry?

Do you mean pressing a fire button with controllers?

I'm not at home at the moment, but you have to use something like -

Code (glbasic) Select

IF GameControllers("B1",0) THEN ...

B1 is button1, B2 is button 2 etc. the 0 indicates the first controller etc. I can't remember if the command above is accurate, but it's something like that. Look in the AndroidExtras section for B1 and you'll find the exact command.

If that doesn't answer your question, then please clarify.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Ian Price

Right I'm not at work now so I can display all controller commands here. All info is in the Android Extras file -

Code (glbasic) Select

// "Left", "Right", "Up", "Down" - This is the main left analog stick
// "PadL_Left", "PadL_Right", "PadL_Up", "PadL_Down" - This is the D-pad
// "PadR_Left", "PadR_Right", "PadR_Up", "PadR_Down" - This is right analog stick
// "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8" - These are four face buttons and L1 and R1 (bumpers) on OUYA
// "TriggerLeft", "TriggerRight" - These are the lower two bumpers/triggers (L2 and R2)


Some controllers may differ, but shouldn't be too difficult to work out.
I came. I saw. I played.