Search code examples
androidwebviewandroid-webviewandroid-tvtrusted-web-activity

Is it possible to use PWAS in Android TV?


I was looking into web frameworks that support TV's by market size. Android, WebOS, Taizen, Microsoft, Apple .. **

I am using Trusted Web Activity / svgomg to build PWA based apps for Android TV.

It looks like it is supported : https://github.com/GoogleChromeLabs/svgomg-twa/issues/91

But I tried building apk/app for Android TV and got this error :

I/OpenGLRenderer: Davey! duration=1588ms; Flags=0, IntendedVsync=85294375864, Vsync=85294375864, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=85300204600, AnimationStart=85300236800, PerformTraversalsStart=85300260700, DrawStart=85300629400, SyncQueued=85300648400, SyncStart=85300758100, IssueDrawCommandsStart=85300807700, SwapBuffers=85301335900, FrameCompleted=86882937700, DequeueBufferDuration=208000, QueueBufferDuration=409000, 
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@5470549
D/TWALauncherActivity: Using URL from Intent (https://xx/).
D/TWAProviderPicker: Found no TWA providers, using first browser: null
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@2076314
D/EGL_emulation: eglMakeCurrent: 0xea644960: ver 2 0 (tinfo 0xea6c1550)
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@d15ce5f
D/TWALauncherActivity: Using URL from Intent (https://xx/).
D/TWAProviderPicker: Found no TWA providers, using first browser: null
D/EGL_emulation: eglMakeCurrent: 0xea644960: ver 2 0 (tinfo 0xea6c1550)
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@2adfb62
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@5de11e5
D/TWALauncherActivity: Using URL from Intent (https://xx/).
D/TWAProviderPicker: Found no TWA providers, using first browser: null
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@1b55ae0
D/EGL_emulation: eglMakeCurrent: 0xea644960: ver 2 0 (tinfo 0xea6c1550)
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@40ec95b

What are the alternatives to build PWAs that work on TV OSs? Or, at least to use a PWA in an Android TV app, similar to svgomg-twa?


Solution

  • Currently, the easiest way to use a Web App on Android TV is by using the WebView. Many PWA features are not supported by the WebView.

    Youtube uses Cobalt as the platform to run their app across different platforms. It only supports a subset of HTML, CSS and JavaScript, so it doesn't provide PWA support.

    Trusted Web Activity is not currently supported on Android TV. There's an open feature request at http://crbug.com/1054737.

    For those interested in Trusted Web Activity support for Android TV, I'd recommend going to that issue and starring the feature request, so the team will have a better idea of the demand and can prioritise.