question

zarex avatar image
zarex asked

Web app resolution issue and screensaver/sleep disabling.

Hi, just building my first fire tv app, html web app. Tested using web app tester and I can see the dashboard on my tv which is great. I have searched everywhere to solve this 2 issues with no joy. First problem is the resolution is 981x552, the docs say it should be Target a resolution of 1080p (1920x1080) for web apps for Fire TV? I have tested on 2 large tvs same result. Second problem, I want to disable sleep and screensaver as its a dashboard and needs to always be showing, not sure how to do this. Any help would be greatly appreciated. Thanks
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

carl-artsfuse avatar image
carl-artsfuse answered
I'm in the same boat. There is no way to prevent daydream with a pure HTML webapp. You need a hybrid app (java webview wrapper) to call the APIs to prevent it. This seems like a huge shortcoming for brining people into the platform, but people have been asking for a long time. There is a Cordova Amazon Webappp to generate a java app. I am figuring that out right now - it had some initial setup problems. I'd be happy to share it after I get it working.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zarex avatar image
zarex answered
Thanks for the info, I have built an android wrapper using android studio, java etc and deployed to my tv, it shows the web view content but it still shutting screen down after a few hours. I have put in the correct flag and its defo not shutting down after 30 mins, as it was before, but it does sleep eventually, no idea now how to fix this. Will keep trying.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
Hi there, Web app submission is an option for someone who does not have any Android development experience, where we wrap your URL / web files in a very lightweight Android app on your behalf. Naturally this option has limitations, and because you are not the author of the app, you cannot really edit the manifest or use certain features (including Live App Testing, etc). If however you (or your developers) are familiar with Android development, we would strongly encourage you to build and submit an Android .apk file instead of just the URL / web files. The Android app will be an empty shell with a single WebView in the launch activity that will load your URL / start page. With this setup you will be able to control much more, including values in your manifest, subsequent versions/udates, other features, etc. It's easy too, have a look at the following article, specifically the 'Building Web Apps in WebView' section, which can guide you step-by-step: http://developer.android.com/guide/webapps/index.html As for the screensaver and sleep feature, please note that by default your Amazon Fire TV device goes into sleep mode after 20 minutes of inactivity and Amazon Fire TV (1st Generation) devices go into sleep mode after 30 minutes of inactivity. However, just like you have confirmed already, it works after you wrapped it in a proper Android app and the values you set in the manifest have an effect on the screensaver/sleep feature. The fact that your device goes to sleep after several hours could be related to other connected devices in your setup going into sleep or power saving mode. I would check the AV Receiver / Projector / cable box / TV settings -- for example most new TV sets have a default timeout of 2-4 hours of inactivity before they go to sleep, so it's worth checking that as well.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zarex avatar image
zarex answered
Thanks for helping, I have built most of it, done some more testing and without the FLAG in the code the fire tv goes blank after 30 mins (so prob gen1), the weird thing is if I put the flag in, it comes out of my app after 1:20mins approx, but I am on the manage applications page so its as if its exited the program rather than slept, so wonder if its something else? Could it be something silly like side loaded apps have this limit in place? thanks Again
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
That's an interesting observation, thanks for letting us know, I have forwarded your feedback to the Fire TV team for further investigation.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
Could you please post the exact version of your device, you can find it in Settings / About. Thanks!
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zarex avatar image
zarex answered
Thanks, here is as much info as I can find: Storage capacity: 3.75gb of 5.57gb available Software version: 54.1.2.3_user_123067020 Thinks its generation 1 fire tv stick, wasn't sure how to find this? Pretty sure I am upto date with updates. Thanks for forwarding this to the team, be great to know if its me or if this is a bug or maybe this doesn't happen to proper apk's? Cheers Message was edited by: Levon@Amazon
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
Thanks zarex, Meanwhile, could you please check the app's log files to see if there's anything abnormal wrt memory. Would you be able to profile your app and see if it's leaking any memory as it keeps running over an hour -- this could be one of the reasons that the OS would force it to close. http://developer.android.com/tools/debugging/debugging-memory.html
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zarex avatar image
zarex answered
Hi, thanks for getting back to me, so you have a very valid point, and I have javascript polling going on in background of dashboard which could quite easily stuff memory. So as a very quick test I have loaded up same webview on fire tv but with google.co.uk, will feedback here if it makes 2 hours and then you are correct and I will debug memory issues. Thanks
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zarex avatar image
zarex answered
I change the webview to host google and its there after several hours so the problem is a memory leak in my dashboard javascript polling, so thanks very much to all the advice, I will fix the mem leak and then i will be very happy with my dashboard. Thanks all
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.