Author Topic: Various Android Studio issues (tilt, assets, joy)  (Read 1207 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1691
    • View Profile
Hi Guys

I am using GETJOYX(0) to get Tilt working on Android - but no JOY so far (sorry for the pun!)

I tried to do a keycode scan on it too but no luck either.

checking for GETJOYX(0)>.5 and  GETJOYX(0)<-.5
« Last Edit: 2020-Feb-20 by spacefractal »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3893
    • View Profile
    • Space Fractal
Re: Tilt on Android
« Reply #1 on: 2020-Feb-18 »
use KEY(240) -> KEY(243), and is disabled by default, so dont forget to enable it in strings.xml
« Last Edit: 2020-Feb-18 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1691
    • View Profile
Re: Tilt on Android
« Reply #2 on: 2020-Feb-18 »
Super! i forgot about the values.xml setting.   :)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3893
    • View Profile
    • Space Fractal
Re: Tilt on Android
« Reply #3 on: 2020-Feb-18 »
its was so remapping dont touched it for games that doesent not or not needs to use it. Ads still shows, regaardless what status its have. that was the main reason. Im do should add a java feature to possible to disable/enable code wise.....

PS. Its in Strings.xml settings, not values.xml. All manual settings is being doing in that file. Im more want to use that file ind to insert its in the code.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1691
    • View Profile
Re: Tilt on Android
« Reply #4 on: 2020-Feb-18 »
Just set the value and still no key change or detection of the tilt using Android 6.0 on Nexus 2

    <string name="UseTilt">1</string>

Am I missing something or should this work?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3893
    • View Profile
    • Space Fractal
Re: Tilt on Android
« Reply #5 on: 2020-Feb-18 »
im checking what happens. etc with the KEY() function.

Its seens working here fine with this code:

Code: (glbasic) [Select]
LOCAL X%=(KEY(240)+KEY(241))*1000
LOCAL Y%=(KEY(242)+KEY(243))*1000
« Last Edit: 2020-Feb-18 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1691
    • View Profile
Re: Tilt on Android
« Reply #6 on: 2020-Feb-18 »
Also, not sure if its down to SDL file code changes but now with the new ads code - using Gamepad is crashing app.

Did the Gamepad code change?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3893
    • View Profile
    • Space Fractal
Re: Tilt on Android
« Reply #7 on: 2020-Feb-18 »
im havent touched it, but im do can see JOY() using all completly wrongs values which still uses the old version before Android Studio.

For any crash, there should been some Logcat, where it crash. Im do also sends to the ads when gamepad is used. Im do might need to disable the ads thing for that throught as its might can been same issue with admob as not all possible functions might work.

You can remove the ads calling from

public static void reportkeycode(int position, float value

for checking.
« Last Edit: 2020-Feb-18 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1691
    • View Profile
Re: Tilt on Android
« Reply #8 on: 2020-Feb-18 »
Cool - will try that so...

BTW - On another note - just seen you and Rusty Pixels mentioned in my Retro Gamer magazine, talking about the ZX Spectrum Next.

Mine will be the last batch to be delivered - cause I asked for all the upgrades.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3893
    • View Profile
    • Space Fractal
Re: Tilt on Android
« Reply #9 on: 2020-Feb-18 »
Then im should purchase it, hehe. its very late, but nice they finally begin to send out, and all 3 games is also on presale.

Im have updated the values in JOY, Gernot was just using the scancodes, but should really use the SDL code, but its would been do extractly same thing in the end anyway. The JOY commands was not working due using the old scancodes from before AS. Im today using the standard values used by Google, except the analoge sticks, but wanted to hold it under <255.

And eventuelly move it up to the KeyDown() function instead, where its should works.

Updated the dropbox, which now removed the link and using attachments directly (as its only 260kb), which im remove when a day pushed to steam (im waiting it a bit, which was a good idea).
« Last Edit: 2020-Feb-18 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1691
    • View Profile
Re: Tilt on Android
« Reply #10 on: 2020-Feb-18 »
hmm, hope it wont affect the nice default Keycode values for Gamepads / Controllers?  :O
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3893
    • View Profile
    • Space Fractal
Re: Tilt on Android
« Reply #11 on: 2020-Feb-18 »
not at all for the KEY() part, its was values for the JOY() commands that was wrong. you do still consider do a remap feature for your app. Gamepads is really threated as a keyboard on Android. Its mostly the right stick and the analoge triggeres that sometimes can been swapped around.
« Last Edit: 2020-Feb-18 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1691
    • View Profile
Re: Tilt on Android
« Reply #12 on: 2020-Feb-19 »
Hi SF

Still not working with your new values on my tablet

https://www.dropbox.com/s/2o0lnx8n72i0mop/app-release.apk?dl=0

Does the app above work and show values for the tilt?
K: 0, 0

On my tablet the values remain at zero
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3893
    • View Profile
    • Space Fractal
Re: Tilt on Android
« Reply #13 on: 2020-Feb-19 »
better to get thh Android Studio project. then im can better checkout. (no, im dont need the glbasic part, only a cleaned Android Studio project).

Its works nicely here on Greedy Mouse testing using this code:

Code: (glbasic) [Select]
LOCAL X%=(KEY(240)-KEY(241))*1000
LOCAL Y%=(KEY(242)-KEY(243))*1000

with those values in values/strings.xml

Code: (glbasic) [Select]
    <string name="Analog_Keys">1</string>
    <string name="UseTilt">1</string>

Analog_Keys does not automatic enabled when UseTilt is used, a deadzone mightbeen used.

PS. The JOY code is still slightly wrong, but can first fix it on tomorrow or afternoon.
« Last Edit: 2020-Feb-19 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3893
    • View Profile
    • Space Fractal
Re: Tilt on Android
« Reply #14 on: 2020-Feb-19 »
Im have currectly a very sitty day, so im might not want to do anything more today.

This is not just techincal (A Moga joypad refused to work and there was no help to find due, thier homepage was now locked behind a forced account) issues, but also other none techincal issues as well.

Now im need to find a purchase a another android joypad that is NOT a Moga. Howover im do soon get a Android TV, so im should checking xbox and ps controllers works as intended.

PS. Im still have a OUYA controller, that works fine and have no shitty connection issues.
« Last Edit: 2020-Feb-19 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.