Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - Handle non touch based input #63

Closed
dtanquary opened this issue Mar 25, 2018 · 22 comments
Closed

Android - Handle non touch based input #63

dtanquary opened this issue Mar 25, 2018 · 22 comments
Assignees
Labels
android bug Something isn't working enhancement New feature or request
Milestone

Comments

@dtanquary
Copy link

It would be great to be able to try this out on an android device hooked up to my TV such as a fire TV or Android TV. I was able to install the latest build on my fire tv and open it, but I am not able to navigate or select anything using the firetv remote.

@BradyBrenot BradyBrenot self-assigned this Mar 25, 2018
@BradyBrenot BradyBrenot added this to the v2.0 milestone Mar 25, 2018
@BradyBrenot BradyBrenot added bug Something isn't working enhancement New feature or request android labels Mar 25, 2018
@BradyBrenot
Copy link
Owner

I'm not sure if Qt has any sort of built-in handling of Android TV. If it does it probably works like keyboard nav, which is apparently broken right now (not setting a default focus; works if you click a control).

Investigating in an emulator.

@BradyBrenot
Copy link
Owner

Emulator's running, confirmed it's hosed. Trying to figure out what I can do with it.

@Collisionc
Copy link

I'll try installing it to my shield tv and see if anything is different, it's probably broken there as well but it's worth a shot.

@BradyBrenot
Copy link
Owner

Give the new release a shot. I've tested keyboard navigation out in two Android TV AVDs (Android 5 and Android 7) and it seems to work now. Arrow keys should also work on PC.

@dtanquary
Copy link
Author

Just tested the new build on the fire tv. The arrow navigation is now working but I am not able to select anything.

@BradyBrenot
Copy link
Owner

Sigh, you'd think I would have tried that but nope. It's a little hard given that I can't seem to even get the emulator talking with my bridge.

Going to see if I can figure out what key Qt thinks that center button is, and then see if I can get it to act like Spacebar on the PC... somehow...

@dtanquary
Copy link
Author

If it helps I am pretty sure the center button is the same thing as pressing "A" (KEYCODE_BUTTON_A) on any connected controller: https://developer.amazon.com/docs/fire-tv/remote-input.html#capturing-input

@BradyBrenot
Copy link
Owner

It's "Enter" in the AVD (as far as Qt sees it). Will see...

@BradyBrenot
Copy link
Owner

BradyBrenot commented Mar 25, 2018

k @dtanquary I've added a new release with this "force the enter key to fire a spacebar event" hack. It definitely works in the AVD now, which is how Amazon recommends testing it, so it really ought to work.

@BradyBrenot
Copy link
Owner

BradyBrenot commented Mar 25, 2018

rather, added a new APK to the existing release. Called it huestacean_v2.0-alpha.3.1_android.apk

@Collisionc
Copy link

Collisionc commented Mar 25, 2018

Shield TV works fine with it, although the UI doesn't scale very well as there doesn't seem to be a way to scroll down the app screen to see "Center Slowness" and "Side Slowness".
mvimg_20180325_023807_exported_8670243072523810912

Unrelated to this issue, but I do have to sideload the .apk to get it to work, and even when sideloaded it doesn't show up as an app anywhere, I have to go into settings --> apps ---> app details and select hustacean, and then open it there -- where it doesn't save anything from the previous session, so I have to relink the bridge.

As far as DRM protected stuff goes, youtube/espn are working fine with huestacean. The "Frame read" time on the program randomly jumps to 500 ms for a couple of frames then dips down to 50 ms every 5-6 seconds.

@BradyBrenot
Copy link
Owner

Frame time jumping around is probably OK, Android doesn't actually seem to send frames unless something's changing on the screen.

@BradyBrenot
Copy link
Owner

And as far as playing Netflix goes, rooting + installing Xposed + installing the DisableSecureFlag extension seems to be the only way (I'm playing a video on Netflix right now on my phone and it's working). I can't recommend Xposed to users generally given how potentially dangerous it is but eh it exists.

@dtanquary
Copy link
Author

@BradyBrenot I just tested out the latest build on the fire tv. I was able to navigate and select things for the most part but there are still 1 or 2 buttons that seem impossible to navigate to. I will try to make a little video of me navigating around and put it on youtube for you to see where I am getting stuck.

The firetv also seems to be killing the background process off nearly immediately after I navigate away from the app but that's a separate issue and I will see if there is anything I can tweak on the fire tv to control that. I may end up having to root to get the optimal experience but that would be worth it imo.

@Collisionc
Copy link

It might be a matter of processing power difference between the shield and fire tv. The fire tv is likely suspending everything that's in the background to reserve processing time for the foreground. Shield on the other hand has the capability of hosting a plex server + smartthings hub while playing media.

You'd definitely be able to get around it via rooting the five tv, but it might not be the best experience if processing power is the issue.

@BradyBrenot
Copy link
Owner

Setting the app up to act as a Foreground Service might help, see

https://developer.amazon.com/docs/fire-tv/faq-general.html
https://developer.android.com/reference/android/app/Service.html

@BradyBrenot
Copy link
Owner

Which means reworking a good chunk of this thing to separate the GUI from the rest, which is... probably a good idea for all sorts of reasons, but a huge pain in the neck.

@mrmidnight273
Copy link

mrmidnight273 commented Mar 31, 2018

Installed on my Sony X900E. App starts and I can select stuff. Only issue I have is the syncing doesn't stick when I switch from the app to anything else (including Android TV home screen)

Disregard this error report. I was attempting to sync with an HDMI input, obviously this won't work.

BradyBrenot added a commit that referenced this issue Apr 2, 2018
addresses: #63 (android non-touch input), #44 (GUI rework)
@BradyBrenot BradyBrenot modified the milestones: v2.0, Android TV Apr 2, 2018
@BradyBrenot
Copy link
Owner

Split the foreground service thing off to #68 / #69

@mrmidnight273
Copy link

2.3 release won't allow me to click the link button. I can't even select it. Sony X900E

@Collisionc
Copy link

Collisionc commented Apr 8, 2018

Yeah, looks like this:

image

Added issue here #76

@BradyBrenot
Copy link
Owner

Folded into #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants