Android TV - What is required? [SOLVED]

Monkey Targets Forums/Android/Android TV - What is required? [SOLVED]

Difference(Posted 2016) [#1]
Hi All

I'd like to look into making an app with monkey-x for Android TV.
Has anybody looked into this?

I'm using mojo2, if that makes a difference.

[EDIT]: I've got this solved, using the android_new target with a few tweeks.

I can do a write-up if anybody is interested.


Difference(Posted 2016) [#2]
I'm currently watching https://www.youtube.com/watch?v=Gid6c_-80EM&feature=youtu.be&list=PL5B692fm6--uxqRvGL6eEu898_9lUi-_y


ElectricBoogaloo(Posted 2016) [#3]
This "should" work.
NewYA Target : Linkage

I've got it working on OUYA, Razer Forge, PlayJam GameStick and a few other bits and pieces, but haven't yet tested on a "standard" Android TV device.
It also doesn't deal with any marketplaces, purchases, adverts or anything else. It's basically a case of "the controller works, that's good enough for my Freeware games."


Difference(Posted 2016) [#4]
@ElectricBoogaloo Wonderfull! I'll check it out


Difference(Posted 2016) [#5]
I've tried some of your Android TV apk's on my Nvidia Shield Android TV.
They install without problems, but are only accesable via the "sideload launcher" app and dont't show up as Native TV aps in the TV GUI.
The mapping of the XABY buttons are different from other Android TV Apps, but maybe that's just your choice?


ElectricBoogaloo(Posted 2016) [#6]
The wonderful world of Android Fragmentation!


Difference(Posted 2016) [#7]
I've got this solved, using the android_new target with a few tweeks.

I can do a write-up if anybody is interested.


Neuro(Posted 2016) [#8]
You got it running on NVidia Shield TV?


Difference(Posted 2016) [#9]
Yes :-)


Neuro(Posted 2016) [#10]
Cool! Do a write up please!


Difference(Posted 2016) [#11]
Here are instructions, on getting your app onto the Nvidia Shield Android TV

Get the Nividia Shield Android TV ready for development

1) Press Build numer in system info 7 times, until you are promted the developper mode has been avtivated
2) Enable unknow sources
3) Enable USB debugging, and network debugging
4) Instal Nvidia Shield USB drivers on your computer
5) Connect NV via USB, and on the NV, accept the computer as a trusted device, make sure you "remeber this setting"
6) From a command promt, type "adb devices" on your PC/Mac to check you are connected
7) Optionally remove the USB cable and connect via network: "adb connect xxx.xxx.xxx.xxx (the ip is shown in developper settings on the NV)


Monkey


1) In your monkey code, have ( it will work without, as long as you dont make it portrait only)
#ANDROID_GAMEPAD_ENABLED=True
#ANDROID_SCREEN_ORIENTATION="landscape"


2) Build your project once for android, to create a build folder, - then edit the following in it:
3) In the "android_new\templates\res" folder, make a new folder called "drawable-nodpi"
4) Put an 320x180 PNG image with the name "banner.png" in the folder (you can choose another name, but then rename ref in "AndroidManifest.xml" too)

5) Add the following line to "android_new\templates\ant.properties"
target=android-21

6) Replace "android_new\templates\AndroidManifest.xml" with:



You can now deploy and run your app on the NV Android TV, and will show up in the leanback launcher.


Difference(Posted 2016) [#12]
I've added a ""bug" report for missing "center" button constant handling, on android gamepads here: http://www.monkey-x.com/Community/posts.php?topic=10387&post=116525

Besides that, I get signals form all buttons on the gamepad, and the remote, EXCEPT the dpad on the Nvidia Shield Controller. It does not seem to come as a getKeyCode() events. Can anybody shed some light on this?

[EDIT] : Found it! Dpad comes in as Joystick HAT_X, Y

http://developer.android.com/reference/android/view/MotionEvent.html#AXIS_HAT_X

I'll add this to my request


Neuro(Posted 2016) [#13]
Cool, thanks for this!!