question

S.Denis avatar image
S.Denis asked

Using FireTV game controller aware app on an Kindle Fire HD

Hello; Is it possible to have an APK that will works on Kindle Fire and automatically detect FiretV enable GameController I have my project configured with Amazon Fire TV SDK Addon enable, and I'm detecting the FireTV with (android.os.Build.MANUFACTURER == "Amazon" && android.os.Build.MODEL =="AFTB"), so I won't call the API on non FireTV But even that, it crash the app on Kindle TV My question, when creating FireTV app, does it works on non Fire TV, or must be exclusive for FireTV. (Using amazon addon 17) 08-02 13:28:21.610: I/dalvikvm(26703): Could not find method com.amazon.device.gamecontroller.GameController.onGenericMotionEvent, r8-02 13:28:21.610: W/dalvikvm(26703): VFY: unable to resolve static method 10611: Lcom/amazon/device/gamecontroller/GameController;.onGenericMotionEvent (Landroid/view/MotionEvent;)Z 08-02 13:28:21.610: D/dalvikvm(26703): VFY: replacing opcode 0x71 at 0x0001 08-02 13:28:21.610: W/dalvikvm(26703): VFY: unable to resolve exception class 1619 (Lcom/amazon/device/gamecontroller/GameController$DeviceNotFoundException;) 08-02 13:28:21.610: W/dalvikvm(26703): VFY: unable to find exception handler at addr 0x6 08-02 13:28:21.610: W/dalvikvm(26703): VFY: rejecting opcode 0x0d at 0x0006 08-02 13:28:21.610: W/dalvikvm(26703): VFY: rejected Lcom/realtechvr/v3x/input/firetv/FireTVInputController; 08-02 13:28:21.610: W/dalvikvm(26703): Verifier rejected class Lcom/realtechvr/v3x/input/firetv/FireTVInputController;
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

DougM@Amazon avatar image
DougM@Amazon answered
Hello S.Denis, To answer your question, use of the GameController API is only going to work for the FireTV as of right now. You can support controllers on our other hardware by using the standard Android input API for controllers. You just wouldn't get the convenience methods that our GameController API provides. One of the best ways to detect as to whether or not to support our controller would be to use Java reflection to see if the runtime components are available on the device, and then you will know if it is safe to use the API: public boolean isAmazonGameCotrollerSupported(){ boolean controllerSupported = true; try { Class.forName("com.amazon.device.gamecontroller.GameController"); } catch (ClassNotFoundException e) { controllerSupported = false; e.printStackTrace(); } return controllerSupported; }
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.