Amazon FireTV. Any chance Corona SDK will support this?

The app would have to know how to map the keys.  R2 is an axis type input and the axis numbers vary from device to device.  And if the app doesn’t map it right, it won’t work.  See:

http://coronalabs.com/blog/2013/08/27/tutorial-introduction-to-game-controllers/

and

http://coronalabs.com/blog/2013/09/24/tutorial-controllers-and-axis/

The last one should show you how to setup a mapping system for your app so that it will work with wider variety of controllers.

Rob

Thanks for the links, Rob.  Don’t mean to hijack the thread (I opened up a new one but remained unanswered), but wanted to know if the above tutorials will work for iOS Bluetooth controllers including iCade and the Logitech and Moga ones.

Time to pick up a Fire TV!

Controller’s on iOS are a different beast.  Apple has their MFI program (Made of IDevices) where they dictate many things on what controllers including the shape of buttons.  Controller makers have been slow to adopt the MFI program due to the requirements (based on what I read on the tech blogs).  I dug through the controller API and the events seem similar to what we get for Android.  However, we have not built in support for it.

I suspect that once there are more controllers out there, there will be more need for us to include this in the core API, but for now, the controller support is Android only.

I’m thinking about picking up one too. 

So I made a simple app to print text on the screen and test the key inputs and it seems to work fine :slight_smile:

So onto Fire TV apps :slight_smile:

local function onKeyEvent( event )

   local phase = event.phase

   local keyName = event.keyName

    myprint (“keyName:”…keyName…"  phase:"…phase)

    

    return true

end

Runtime:addEventListener( “key” , onKeyEvent )

tvtest.jpg

Looks like you can program for the remote!   This is cool!!!

Rob

Absolutely !!

I see this on GitHub from roaminggamer: https://github.com/roaminggamer/RG_FreeStuff/tree/master/FireTVLib

Thanks Ed!

And there is a Tutorial/Blog post to go with it:

http://coronalabs.com/blog/2014/05/13/tutorial-amazon-fire-tv-controller-events/

Rob

Thanks Rob!

My app was rejected by Amazon for not properly requesting and releasing audio focus on App start and suspend (as far as I can tell). Did anyone else have this problem or know how to get around it?

The only releasing of audio I did was the standard:

function scene:destroyScene( event ) audio.dispose( tapSound ); tapSound = nil; end

Are you audio files not disposed of when the app quits?

Thanks for the response GP - I did not dispose of my files when the app quits, I will try that. One other question while I have you - 

Did you take any effort to treat the media play buttons differently? Do you dispose of your audio files on app suspend as well as app quit? (It seems that my app is supposed to just suspend when the home button is hit, and not quit)

Thanks again - 

I actually didn’t reference the media play buttons at all. I actually just tied the same navigation actions to ‘Left’, ‘Back’ and ‘B’, and jump actions to ‘Select’, ‘Up’ and ‘A’ depending how you want to play and what controller/remote you have.

To leave the app, it sees which screen you’re on when you press the back button and then just exits.

if( keyName == 'left' ) or (keyName == "back") or ( keyName == 'b' )then if (storyboard.currentScene == "menu") then print("Time to go!") native.requestExit(); return true else if storyboard.isOverlay then storyboard.hideOverlay() return true else print("We're on the game screen") tapChannel = audio.play( tapSound4 ) storyboard.gotoScene("menu", "slideLeft", 600) return true end end end

GP, Thanks again for the insight – so you don’t do anything special when ‘home’ is hit? (You let the Fire TV ‘pause’ the app and go back to the menu?) I was expecting that they might be requesting that I dispose of my audio there, but that doesn’t make sense if you didn’t do it either.

I didn’t program anything for the Home button press. They did want me to support the Back button though, it got rejected once because of that. This was when I didn’t even own a FTV to test on, I had to keep emailing the .apk to a friend who would try to explain what was happening. Once I actually bought a FTV, I saw how I should have had 60 FPS in the config file and other small fixes, so it was a good purchase.

Amazon approved my game for Fire TV this morning: http://www.amazon.com/GP-Animations-Maddie-Bears-Snack/dp/B00JOQW77U

Ed Maurina (www.RoamingGamer.com) was a huge help in creating the lua sheet that controls the Fire TV remote buttons.

Thanks for info, again. I guess I’m just getting unlucky and the reviewers feel like rejecting my app. Unless Rob or anyone else has any insight I guess I’ll have to give up Fire TV development with Corona for the time being.

Have you asked Amazon for more details?  Others don’t seem to be having the issue and we didn’t do anything special for the Fire TV.

Rob

Hi Rob,

Unfortunately I’ve only had contact with the same rep. I’ve tried to explain that other Corona apps haven’t had this problem and to get more details, but nada. Their original response even said that Unity was exempt from this requirement as it isn’t possible to do in that framework (!) 

The text of their latest reply,

"By requesting audio focus, we refer to requestAudioFocus method created  by the Android AudioManager class.

http://developer.android.com/training/managing-audio/audio-focus.html
It would also be to your benefit to handle loss of audio focus, since without explicitly requesting this launching your app will impede on apps that have already requested Audio focus, for instance a streaming music application could be playing in the background and with your app being started it would cause an issue with audio between streaming service and your app. Which would be the basis of the fail case. You would need to at least find a way to request audio focus in order to pass this particular test."

I see this on GitHub from roaminggamer: https://github.com/roaminggamer/RG_FreeStuff/tree/master/FireTVLib

Thanks Ed!