Monday 28 April 2014

Using an Android tablet as a terminal for a Linux computer

I use my Android tablet to do a few jobs that I can't get a program for in Windows or Linux.  That is not because either of those operating systems are not capable of the work, it is simply that there is a new generation of programmers out there writing stuff for iPad and Android who 'think sideways'.



They are producing small applications whit big features that many traditional programmers just don;t think about, and one of my favourite Android apps is like that.  There have been Windows, Linux and Mac programs for years that will do this, but the Android App just has a couple of killer features.

The work involves images and a particular type of printer, and to run this application I have to adjust the image within some strict parameters.  For this I use GIMP, running on my Linux computer.

Once that is done, I need to transfer the adjusted images to my Android tablet and run them through the Android App.  This used to involve using a cable, or using Dropbox, or saving them to a micro SD card and using that to transfer them to the internal memory of the tablet, which meant a double swap of micro SD cards,

Luckily now, there is Airdroid.  http://www.airdroid.com/
Airdroid runs on my computer, in a web browser.  I keep it in a pinned tab in Firefox.  The free version of Airdroid works nicely over my WiFi LAN, but can also work over the net.  You get 100MB a month of Internet file transfer with the free version and for $2 a month or $20 a year you get 1GB a month, and that can be increased at any time by buying more at the same prices.

So Airdroid lets me use my computer to access my Android tablet wirelessly and transfer files up and down.  It seems faster to transfer files using Airdroid than it is to write to SD on my computer.  A 2MB file transfer takes less time that it did to write this sentence.

That still leaves me with two machines to operate.  This is where another neat program comes in.  The fastest remote desktop system I have evere found, is a program called Teamviewer.  http://www.teamviewer.com/en/index.aspx

It is great for remote access, however it often doesn't work on Linux.  It will work for a while, but refuse to start over and over again at other times with a 'daemon is not running' or similar message'.

So I found bVnc Free.  After using it a while I paid the few dollars for the Pro version.

Now, bVnc is not without its quirks too, and it was a pig to set up, simply because there are no instructions that make sense and no manual.  There is also no information in easy to understand form on Google.  Reduced to simple terms, you need to install x11vnc in your Linux computer and either open a terminal and run    
./x11vnc -forever -passwd ThePasswordYouWantToUseGoesHere -rfbport 5900 -bg
You can also make a script to run it and use it whenever you need VNC access or set it for auto startup.
When it is running, type ifconfig into a terminal and see what your current IP address is on your wifi network.  In the first line, the first address (193.xxx.xxx.xxx) should be the address of the computer you are on, the second address should be your router.  it should be the first address that you need.

When you have run that command, you can open bVnc on your Android device and go ahead and try connecting to your computer.

On the connect screen, there are some connection options.   Basic is the simplest but can be open to sniffing, as data is not really encrypted as it goes over your network.  Don;t use this to do your banking!

In basic there's a line that ends in '5900'  In this line, type the IP address you got from ifconfig.  Below that you will see a line for Password.  In here you enter the same password you wrote in the start command.

Click connect in the top corner and a few moments later you should have your Linux desktop showing on your Android tablet.
Setting this up on Windows will be just as easy.  I have not used Windows since I changed my business computers completely over to Linux in 1998, so I will not write about it here.

There will be a lag between doing something on the tablet and getting feedback, but it is not too bad.  One handy feature is that there is full 'piinch to zoom' on bvnc.  That means if you have to click on a button like the minimize. maximize, close buttons on the task bar, you can zoom in, click, and zoom out again.

Ok, so here I am on my Android tablet, using my Linux Desktop.  I open an image in GIMP, tweak the image with my preferred settings, then export it.  usually I would now go back to the computer and open Airdroid to upload the image for the Android App to do more work.

Here's where the MAGIC happens.  Still on my Android tablet, and still in the bVnc session, I open my web browser and click the tab where I have pinned the Airdroid screen.  I hit 'Connect' and it asks for a password.  I enter the Airdroid password and a moment later I have an Airdroid session in my Linux browser, on my Android tablet.  Have you ever looked in a mirror, while that mirror is reflected in a mirror behind you?  It is that sort of feeling.

Now I just use the Linux session of Airdroid to upload the GIMPed image to my tablet, process it in the Android App, then use Airdroid to download it again.

It goes even further.  The graphic work involves printing using a special printer and special settings.  Because there is no printer driver available specifically for Android and the WiFi versions do not let me adjust the advanced settings, I would normally have to print from the computer.  But as long as the correct paper is in the printer, I can now create the art, and send it to the printer from Linux, using my Android tablet.

Effectively the Android tablet has become a portable terminal for the Linux desktop computer.

I am using Mint 16 KDE with TWO monitors attached to a low end built in ATI Radeon graphics chip.  KDE is set with 4 Desktops and 3 Activities.  bVnc allows scrolling sideways across both monitors and switching desktops and activities seamlessly.

This post was written and posted using the Android tablet, and Blogger, running in Firefox on my Linux computer, in a bVnc session.


No comments:

Post a Comment