Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Turn an Android Device Into a Web Server

DZone's Guide to

How to Turn an Android Device Into a Web Server

This article and tutorial show you how to serve a web application by turning your Android phone into a server with the Iris web framework, written in Go.

· Mobile Zone
Free Resource

Get gorgeous, multi-touch charts for your iOS application with just a few lines of code.

Hello folks,

Yesterday I managed to serve my simple web application from my Android phone. By following some simple steps, you can do it too- it’s ridiculously easy!

Image titleFirst of all, I have to say that this experiment is tested and worked only with the Iris web framework, written in Golang and Android version 5.1.

Steps

Open your Android device and follow the steps below:

  1. Install and open termux.

  2. Execute the following commands by order:

  3. $ pkg install git
    $ pkg install golang
    $ export GOPATH=/data/data/com.termux/files/home/go
    $ go get -u -v github.com/kataras/iris
    $ cd /data/data/com.termux/files/home/go/src/github.com/kataras/iris/_examples/hello-world
    $ go run main.go
  4. Open your favorite browser and navigate to
    http://localhost:8080.

That’s All. Pretty Simple, Right?

Share your thoughts about this post and let me know what awesome apps you’re planning to build with Go + Iris!

The full source code of the web app we ran is located here. If you have any further questions, please feel free to leave a comment below or open a discussion with me.

.Net developers: use Highcharts, the industry's leading interactive charting library, without writing a single line of JavaScript.

Topics:
golang ,android ,web server ,mobile ,web apps

Published at DZone with permission of Gerasimos Maropoulos. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}