Since it’s launch in April, the Amazon Fire TV and Amazon Fire TV Stick has quickly become the best-selling streaming media box on Amazon. With this, app developers have an exciting set of new customers to reach using your Android games running directly on the TV.
To transition a tablet or phone app to Amazon Fire TV, it’s most critical to support the TV remote and/or Game Controller.
In this video blog post, we’ll build an app from scratch for Fire TV using Unity. You’ll see how to get a game object reacting to events from the TV remote and Game Controller and you’ll see how to test your app on the Fire TV or Fire TV Stick. You can also learn more about building Fire TV support into your app on the blog.
Start a new project in Unity
Add the game object that we’ll control with the controller.
In this segment we create the script that will receive TV remote and the Game Controller events and cause the Game Object to move with the D-Pad or joystick. We use the Unity Input Manager and the default horizontal and vertical inputs so that both keyboard and controllers work.
For reference, here are the Unity Input Manager and KeyCode values for the Fire TV Controllers
Add button support
Next we add support for Back, Menu and the A buttons. This illustrates how you’d pause, show a menu, and perform game actions like jump or shoot.
Test the app on Fire TV
Now you need to build the app from Unity and run it on device using Android Debug Bridge (ADB). In this segment, we’ll go through that step by step.
If you don’t yet have ADB, here’s a post to help you set up ADB.
Use the Fire TV controllers to move the cube around and change it’s colors
More importantly, you’ll be able to see how easy it is to respond to controller events in your app.
Now, how will you to integrate controller support into your game play and UX?
Ready to Submit Your App or Game?
- To learn more about the Amazon Appstore, click here
- Click here to register for free as an Amazon Developer.
- Click here to download the Amazon Mobile SDK.
- Click here to submit your app
Please let me know if you have any questions.
-Paul Cutsinger (@PaulCutsinger)