You can use your existing skills and resources and open the doors to a world of potential new customers! The Amazon Fire TV family of devices and the associated SDK are fun to develop for. Then when we run the game, the ship moves via the right joystick: With this in place we can get input from the controller in the game layer and move the ship accordingly: Therefore, we need to forward generic motion events to the controller: In this case, we’ll be using the right joystick of the game controller to move the ship around the screen in any direction. To use the game controller API, you must call GameController.Init after setting the ContentView: Gather input from the game controller in your game loop.ĬocosSharp games build upon MonoGame, which on Android uses the AndroidGameActivity.Forward any keystrokes and/or generic motion events to the controller.To use the GameController API (available in the Xamarin component) you have to: Let’s take a look at how to extend the game to use an Amazon Fire TV controller with the GameController API. I previously blogged about a simple space game I made for the Fire TV Stick, using CocosSharp, where I used the remote to control the spaceship. Therefore tapping the center button results in a button click in the Hello World app:Īpps are great, but Fire TV devices really shine in its ability to bring Android games to the TV. The Fire TV remote maps to normal Android keystroke handling. The app will deploy to the Fire TV device and you’ll be able to debug within Xamarin Studio just like any other Android application. Select the Amazon AFTM (API 17) from the Devices dropdown and run:.Connect to the Fire TV (or Fire TV Stick) via adb:.Create a Hello World app that targets Android 4.2 (Jelly Bean).However, as mentioned, API 17 will work even without using the component. To develop with Xamarin, the Xamarin component store includes an Amazon Fire TV component, which includes support for Amazon notification and game controller APIs respectively: The Amazon Fire TV SDK Add-on is available in the Android SDK Manager via an Add-on site, as described in the Amazon documentation. In fact, without even using the Amazon Fire TV SDK, you can run most API 17 apps without much modification. The version of Amazon FireOS that runs on Fire TV is based on Android Jelly Bean (API Level 17), so you can take your existing Android skills and code there by just targeting API 17. It’s incredibly straight forward to get started with Amazon Fire TV and Fire TV Stick when using Xamarin due to its native Android support and the freely available Fire TV component. Mike is going to walk us through the steps to get your own apps and games running on Amazon Fire TV and Fire TV Stick with Xamarin Studio. Please join me in welcoming special guest Mike Bluestein, who as a Developer Evangelist for Xamarin, helps developers be successful with the Xamarin platform. This includes Amazon Fire tablets, Amazon Fire phone, Amazon Fire TV and the recently announced Amazon Fire TV Stick. Utilizing Xamarin you can now publish your own apps and games to all Amazon Fire devices. Xamarin also includes a suite of tools that allow you to test, build, and analyze your apps across all of the major mobile platforms. Because Xamarin apps are built with standard, native user interface controls apps not only look the way the end user expects, they behave that way too. Xamarin generates fully native code for each mobile platform instead of translating at runtime. Xamarin is a cross platform development environment that leverages the power of the C# programming language and takes full advantage of native hardware acceleration.
0 Comments
Leave a Reply. |