Author Topic: Source code location to add native HID joystick support?  (Read 13804 times)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Source code location to add native HID joystick support?
« Reply #30 on: October 03, 2012, 04:15:00 PM »
Turns out adding "implements View.OnGenericMotionListener" causes the app to crash on older versions of Android, with the following error:

Code: [Select]
E/AndroidRuntime(14234): java.lang.RuntimeException: Unable to start activity
ComponentInfo{paulscode.android.mupen64plusae.zeldamm/paulscode.android.mupen64plusae.GameActivityXperiaPlay}:
android.view.InflateException: Binary XML file line #7: Error inflating class paulscode.android.mupen64plusae.SDLSurface

We'll need to come up with another way to work around this problem.  Probably creating a separate OnGenericMotionListener that is attached only when the proper version of Android is running.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Source code location to add native HID joystick support?
« Reply #31 on: October 03, 2012, 05:01:21 PM »
Fixed the problem.  I just moved the listener to a separate class (JoystickListener.java), and only link with it if the Android build is high enough.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Source code location to add native HID joystick support?
« Reply #32 on: October 03, 2012, 05:15:41 PM »
Cool, I was wondering about that and was thinking the same solution.  Thanks for testing.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version