Vincent Valentine Vincent Valentine - 1 year ago 116
Android Question

Using nodejs as a server on android device?

I'm making an application that using nodejs as a server on android device. Server will handle req and return html interface to desktop client via their web browser but i don't know what to start with Android studio.

Answer Source

I am guessing, that you want to use load html returned by server in the Android app. if that is the case, you can simply create an activity with a webview and load the same url you would load in the app.

You can follow this documentation to load url.

simply put, have a layout with webview

<?xml version="1.0" encoding="utf-8"?>
<WebView  xmlns:android=""

and in the activity load your servers url.

WebView myWebView = (WebView) findViewById(;

and if you want handle all links in that html to be opened in the same app follows this Clicking URLs opens default browser

But this is as good as somone opening the url in a browser in android phone, to give a better experience, you server should be able to give data as JSON or XML or any other data format and you should be able to build a native app on that data.

If this is not what you were looking for, apologies.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download