Showing posts with label http server. Show all posts
Showing posts with label http server. Show all posts

MaePadWeb 2.0: Take your MaePad anywhere (even on a N8)

The companion app to MaePad that has been announced some days ago is now available in Extras-Devel for your N900, with some nifty features:

  • Fully edit the checklists in your database
  • Native Maemo 5 look and feel in the browser (title bar, toolbar, lists, ...)
  • Dynamic themeing based on current Maemo theme
  • Per-session password for some security (inspired by MAD Developer)
MaePadWeb in a web browser

This means that if you are using the NSeries theme, it looks like this, but if you are using Digital Nature, this is how it looks (and that should work for all themes). On your device, you will see a simple info window. Now, that's bringing the Maemo 5 UI to your Desktop computer's web browser. But does it work on mobile devices as well? Of course! Let me present you MaePadWeb running in the Symbian web browser on a N8-00:

MaePadWeb on a N8-00

If you think that this looks shopped, check out the video for further proof and to see the checklist editor view in action :)

This project brings together some great technologies: Python (for the backend) and HTML/CSS and JavaScript (using JQuery for convenience) for the frontend. Apart from the artwork, it does not depend on anything from Maemo 5/Hildon that isn't available in MeeGo already. In fact, Python with SQLite3 support is the only real dependency of this app on the backend side. With all the confusion on what to use for MeeGo Handset UIs (MeeGo Touch Framework, QWidget-based Qt, QWidget inside QGraphicsView, QML, Qt Components, ...), the HTML/CSS/JavaScript combo seems like a good cross-platform alternative (you still have to run the backend somewhere, but it can run on the same device, of course). All you need is a good browser/JS engine/rendering engine combo (Fennec/QtWebKit on MeeGo Handset, MicroB on Maemo). This also works on the N8x0 with MicroB :)

Streaming video to the big screen

This is a pretty obvious hack and nothing new at all, using plain command line tools that existed for ages. Still, it might come in handy, and maybe you did not even think about it yet:

Prerequisites are a computer with an installed SSH server and mplayer or a similar media player. On your N900 (this obviously works just as well for the N800 and N810), you just need the SSH client for the first variant, and Python for the second variant. No other tools or apps are necessary.

In my case, I downloaded a video onto my N900 using gPodder, but I didn't want to watch it on the small screen, and I don't have a TV to hook it up to. So I decided to just stream the video over the network to my computer (ideally initiating the stream from the N900).

What you need to do is find out the $DISPLAY variable in your X session on the computer (:0 usually works, but strangely I'm on :4.0 with Ubuntu 10.04 here). You can do this with echo $DISPLAY in a X Terminal on the computer. Remember that value. Now, let's go to the X Terminal on the N900, cd into the folder with the videos and note the file name. To stream the video fullscreen to the computer, use a command like this: ssh username@computerip 'DISPLAY=:4.0 mplayer -fs -' < filename.mp4.

If you don't have SSH access, an alternative is to use HTTP for streaming (e.g. with VLC, which is also available on Windows and Mac OS X). The easiest way to do is (if you have Python installed, which you most likely have) to cd into the directory that you want to share (the directory and all its subdirectories will be shared - be sure to have no sensitive data there!) and use the command python -m SimpleHTTPServer for some instant HTTP server goodness on port 8000. Use VLC or a web browser on your computer to access the share. You can use Ctrl+C to stop the server.

So, if you want to browse the downloaded podcasts of gPodder on your computer, use the following command sequence in X Terminal:

cd
cd MyDocs/Podcasts
python -m SimpleHTTPServer

Now, use the web browser on your computer (connected to the same network) and access http://n900ipaddress:8000/ to get a directory listing of all downloaded content. Copy the URLs into VLC and start streaming over the air.

Usually the limiting factor here is the wireless bandwidth and the reading speed of the eMMC. Apart from that, no restrictions apply - you can easily stream HD content, as the decoding is done on your computer, and the N900 just reads the data and sends it unmodified over the network without much processing (that's why everything said here also applies to the N800 and N810 and should work just as well).

Remote-control Vagalume via a web server

I am using Vagalume to listen to last.fm on my N800 that is hooked up to the stereo. During that time, I'm sitting at my lappy doing random things. When a song I don't like comes up, I have to get up and hit the "skip" button. Not anymore! Enter "vagalumisierung.py"...

This little Python script sets up a little HTTP server on port 8242 (that's "VAGA" if you type it on your mobile phone), receives song changes from Vagalume and can carry out basic operations like play, skip, ban, love, etc..

How to use? Copy it to your tablet, install python2.5 and python2.5-dbus and start it in background (with "python2.5 vagalumisierung.py &"). Then, point your browser to http://yourtabletshostname:8242/ (a good time to set up Avahi correctly, so you can use "tabletname.local"). You can now see the currently-playing song and remote-control Vagalume via HTTP over your Wifi-Style connection!

Oh, and here's the link to download the script: vagalumisierung.py

If people love this, I could enhance this a bit and put a GUI around it and create a Maemo package.