question

Fernando D. V. D avatar image
Fernando D. V. D asked

GameController isButtonPressed problem

Hi, i am having strange behavior when using isButtonPressed(..) is always returning false and never true; the implementation used is as follow /* Is button pressed for player N? */ GameController controller = null; int cplayer = here is an integer representing the controller player (1/4) //cnd.getParamExpression(rh, 0); try { controller = GameController.getControllerByPlayer(cplayer); } catch(Exception e) { Log.Log("Error occurred when read FIRETV Controller player"); return false; } switch(num) { case 27: return controller.isButtonPressed(GameController.BUTTON_A); case 28: return controller.isButtonPressed(GameController.BUTTON_X); case 29: return controller.isButtonPressed(GameController.BUTTON_Y); case 30: return controller.isButtonPressed(GameController.BUTTON_B); case 31: return controller.isButtonPressed(GameController.BUTTON_SHOULDER_LEFT); case 32: return controller.isButtonPressed(GameController.BUTTON_SHOULDER_RIGHT); case 33: return controller.isButtonPressed(GameController.BUTTON_STICK_LEFT); case 34: return controller.isButtonPressed(GameController.BUTTON_STICK_RIGHT); case 35: return controller.isButtonPressed(GameController.BUTTON_DPAD_CENTER); case 36: return controller.isButtonPressed(GameController.BUTTON_DPAD_UP); case 37: return controller.isButtonPressed(GameController.BUTTON_DPAD_DOWN); case 38: return controller.isButtonPressed(GameController.BUTTON_DPAD_LEFT); case 39: return controller.isButtonPressed(GameController.BUTTON_DPAD_RIGHT); default: return false; } am i doing something wrong, everything work in my code but this part of the code no. here an example using this code and other to test FIRETV controllers https://dl.dropboxusercontent.com/u/49201338/TestFireTVController.apk Also i don't seem capable to find your example fro testing the gamecontroller api, can you point to a link whee i can download and use for testing thanks in advance for your help
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.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hey Fernando, Please follow the instructions documented below to check out the controller sample app in your dev machine https://developer.amazon.com/public/solutions/devices/fire-tv/docs/using-the-fire-tv-sdk-samples Please get back if this does not hep to resolve your issue. Thanks.
10 |5000

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

Fernando D. V. D avatar image
Fernando D. V. D answered
Hi, Thanks for taking your time to answer me. well that info used for making the apk and part of that is working, but the only thing is not working is the isbuttonpressed. also i wonder in th amazon-app.-sdk you have all example but the gamecontroller is missing, thats why i kindly ask if you can send to me or post Thanks in advance
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Fernando, Sorry for the confusion. Below is the right link to follow the Sample checked out in ADT as add-on. https://developer.amazon.com/public/solutions/devices/fire-tv/docs/setting-up-your-development-environment#Installing%20the%20Amazon%20Fire%20TV%20SDK%20Add-on
10 |5000

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

Fernando D. V. D avatar image
Fernando D. V. D answered
Hi, Again sorry i think i did not explain myself right i have the SDK, ADT , etc and i have test all your examples but again there is no example that covers the GameController, where can i find a Zip file for that.
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
The Amazon Fire TV SDK is an Android SDK add-on. To download and install the SDK, use these steps: In Eclipse, on the Window menu, click Android SDK Manager. - or - On the command line, run the following command, where is the path to your Android SDK: /tools/android In the Android SDK Manager window, verify that SDK Path points to the path to your Android SDK. To modify the path, in Eclipse, on the Window menu, click Preferences, click Android, and then update the SDK Location. In Mac OS X, these menu items are on the ADT menu instead of the Window menu. In the Android SDK Manager window, from the Tools menu, click Manage Add-on Sites. In the Add-on Sites dialog box, click the User Defined Sites tab, and then click New. In the Add Add-on Site URL dialog box, enter the following URL: https://s3.amazonaws.com/android-sdk-manager/redist/addon.xml Click OK and then Close. Wait for the Android SDK Manager to refresh, as indicated by the progress bar. Expand Tools and click Android SDK Tools (latest version) and Android SDK Platform-tools (latest version). Expand Android 4.2.2 (API 17) and click SDK Platform and Amazon Fire TV SDK Addon. If your SDK Manager is sorted by repository, you can find the Amazon Fire TV SDK under the URL from Step 5. If the entry for Amazon Fire TV SDK is missing, select Packages > Reload, or turn off the download cache in the options (see Troubleshooting ). Expand Extras and click Android Support Library. The Amazon Fire TV SDK samples require this library. If your SDK manager is sorted by repository you can find the Android Support Library under the Google, Inc. heading. Click Install n Packages. In the Choose Packages to Install dialog box, accept the license agreements for the packages, and then click Install. Restart Eclipse (if you are using Eclipse).
10 |5000

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

Fernando D. V. D avatar image
Fernando D. V. D answered
Sorry, i feel bad now, what part of that i have everything installed and working is not well written in my last posts? i have the eclipse ADD-ON, AND EVERYTHING IS WORKING BUT ISBUTTONPRESSED NOT WORKING, there is other developers to help me. THANKS YOU this is the post 6 and you focus is something i did not ask and is not my problem but you don´t answer my question, anyone else to help me?
10 |5000

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

Fernando D. V. D avatar image
Fernando D. V. D answered
Ok, after review and notice that you post asking for add-on i review the add-on and i saw that it did not had the samples so i delete using sdk manager and reinstall the add-on with eclipse and after i found the "holy grail" example, nice since i build and test confirming my first post. The isButtonPressed function is not working in your example as is not working in my example // Move the cursor function of the DPAD direction x[n] += gameController .isButtonPressed(GameController.BUTTON_DPAD_RIGHT) ? +5 : 0; x[n] += gameController .isButtonPressed(GameController.BUTTON_DPAD_LEFT) ? -5 : 0; y[n] += gameController .isButtonPressed(GameController.BUTTON_DPAD_DOWN) ? +5 : 0; y[n] += gameController .isButtonPressed(GameController.BUTTON_DPAD_UP) ? -5 : 0; but this code from the same example, if (gameController .wasButtonPressed(GameController.BUTTON_A) ----------> IS WORKING | gameController .wasButtonPressed(GameController.BUTTON_DPAD_CENTER)) ------- NOT WORKING { both should make the circle around the dot, but only button A is working Can someone take a look at this I will really thanks in advance if someone can take a look, i remain at your entire disposition for any further information, but again running your example should be enough Regards, MrFVD
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
True. I am following up with concerned team. I will get shortly. Thanks for bringing this up.
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
The problem is identified by team, we will release the fix in consecutive updates, please stay tuned. Thanks.
10 |5000

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

Fernando D. V. D avatar image
Fernando D. V. D answered
Any News or a possible ETA? thanks in advance
10 |5000

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