WebSocket support?

220 views
Skip to first unread message

BareK

unread,
Jun 29, 2016, 3:01:34 PM6/29/16
to DroidScript
Hi all,

When testing an app using WebSocket on android 4.1, it fails saying that WebSocket is not supported.
The following statement is confirmed by this code:

//Called when application is started.
function OnStart()
{
    app
.SetOrientation( "Portrait" );
   
   
//Create a layout with objects vertically centered.
    lay
= app.CreateLayout( "linear", "VCenter,FillXY" );

   
//Create a web control.
    web
= app.CreateWebView( 1.0, 1.0, "IgnoreErrors" );
    web
.SetOnProgress( web_OnProgess );
    lay
.AddChild( web );
 
   
//Add layout to app.
    app
.AddLayout( lay );
 
    app
.ShowProgress("Loading...");
    web
.LoadUrl( "http://www.websocket.org/echo.html" );
}

//Show page load progress.
function web_OnProgess( progress )
{
    app
.Debug( "progress = " + progress );
   
if( progress==100 ) app.HideProgress();
}

But, when testing http://www.websocket.org/echo.html with Google Chrome (on the same device) it says that WebSocket is supported.

So, could it be possible to provide support for WebSocket on devices since Android 4.1 in DroidScript?

Regards,
BareK

Steve Garman

unread,
Jun 29, 2016, 3:20:39 PM6/29/16
to DroidScript
The Chrome browser, as an app, is updated periodically.

Unfortunately, on versions of Android prior to Lollipop, the WebView is not updated.

From Lollipop onwards, both chrome and WebView are planned to be kept pretty much in tandem.
That is what happens now on Lollipop and Marshmallow, by updating the Android System Webview app.

DroidScript relies on the WebView for its DOM, JavaScript etc.

I doubt that DS will ever offer websockets on any version of Android that does not currently support it.

Reply all
Reply to author
Forward
0 new messages