java – Is it possible to run a Tomcat server and a few web applications on an Android device? (ie. a tablet)-ThrowExceptions

Exception or error:

The title pretty much says it all, but let me provide some more details.

What we are trying to accomplish is to build a mobile server platform. We already have a server platform written in Java, that runs on a Tomcat server. It provides web interfaces, and web service interfaces to clients.

This system was built, like most web apps are, to perform in a fixed location.

Now, we need to be able to take the web services and server software to remote, unconnected locations.

Our idea is, that we will use an Android tablet with Wifi enabled as a server for the clients local to the device. The server will do its thing running on the tablet to serve local clients, then once the tablet comes back within range of a 3G/4G/EDGE or whatever network, the tablet will uplink the data collected to a master server.

The number of clients that could be served is relatively small – no more than 20 or so at a time. The volume of traffic would be small in the <32K per second range per client, and further the web server and applications have a relatively small footprint.

If we wanted to go about setting up this stuff on Android, first, is it even possible without rooting the devices? Second, if it is possible would it run with any kind of decent performance?

Thanks in advance!

How to solve:

You can try using I-Jetty to run a Java web application on Android. You won’t need to do any rooting, but I could not find any performance information. You might just have to do your own benchmarking to find out if it will suit your needs.

###

The answer seems to be:

  • in theory yes,
  • in practice its a bad idea and you’ve got some work to do to make it happen.

For instance, read this Google Groups thread.

Second, if it is possible would it run with any kind of decent performance?

Impossible to tell, but I have my doubts. If you are looking for performance (and simplicity) you should be looking at a regular PC, IMO.

###

The best solution for running Java Servlets on android is I-Jetty and it’s Console both are free and open source.

There are specific servers from Ice Cold Apps for a reduced price, you can use Ice Cold Apps Servers Ultimate for all other supporting services like Caddy, CVS, DC Hub, DHCP, UPnP, DNS, DDNS, eDonkey, Email (POP3 / SMTP), FTP Proxy, FTP, FTPS, FTPES, Flash Policy, Git, Gopher, HTTP Snoop, ICAP, IRC Bot, IRC, ISCSI, Icecast, Lighttpd, LPD, Load Balancer, MQTT, Memcached, MongoDB, MySQL, NFS, Node.js, NTP, NZB Client, Napster, Nginx, PHP, PXE, Port Forwarder, RTMP, Remote Control, Rsync, SIP, SMB/CIFS, SMPP, SMS, Socks, SFTP, SSH, Server Monitor, Styx, Syslog, TFTP, Telnet, Time, Torrent Client, Torrent Tracker, Trigger, USB/IP, Unison, UPnP Port Mapper, VNC, VPN, Wake On Lan, Web, WebDAV, WebSocket, X11 and/or XMPP server!.

Another option is a method for you to install and use Debian and its associated applications/packages alongside Android. This is NOT full Debian OS – it is a compatibility layer, which allows you to run Debian applications.
You do not need to root your device, it will work fine with any stock ROM.
You will need 900 Mb free on internal storage. This app cannot be installed to SD card.
A mouse or stylus is highly recommended.
This is NOT official Debian.org release.
A regular uninstall fully cleans up after this application.
This is expandable and you will be able to install your own applciations/packages into it like Tomcat.

If you are using Android 6.X or newer, check out GNURoot Debian
Inside GNURoot Debian, you can create a root file system, launch into it, or delete it.

If you are using Android 5.X check out Debian noroot that will install Debian Jessie.
You can pair it with XServer XSDL app to run graphical Debian applications.

###

If my problem statement is to install tomcat in android, the following would be my possible solutions.

1_ Investigate possible interaction of tomcat server with underlying os.

As far as I am concerned from their download directories, its pretty obvious that their interaction is minimal and I could possible run catalina.jar from any machine capable of running a jvm.

2_ Will dalvik vm support Tomcat?

Most probable not. But I will first install android in a more powerful device (like my laptop) and then try running tomcat in the vm. My guess is, this could open up a pandora’s box.

3_ Investigate virualization?

This could be a good bet. But in a limited resource device like tablet, this solution looks insane.

But then I could not understand what drove you to this solution? Could you not store information using a sqllite module or implement your webservices in REST and probably have a server like Tomcat Lite or Getty.

Leave a Reply

Your email address will not be published. Required fields are marked *