Pages

Friday, 30 September 2011

dulwich for Android

This is just a little post to help out when trying to install dulwich - the pure Python implementation Git version control - on Android.

Dulwich is distributed as a .tar.gz archive, whereas my Android device won't allow me to download these files.

I have converted the archive to .zip which is Android-friendly and have made no other changes. This is the latest version that is current as of now - 0.8.0.

You can download this version here (link fixed to be a direct download).

Wednesday, 28 September 2011

Scripting gets a home on github.com

I have just figured out how to export my scripts from my Android tablet.

I like Git version control so wanted to useit to back up my scripts. However there was nothing I could find to perform commits from Android to somewhere like GitHub.

Enter Dulwich - git written in Python. I installed this to the phone (had to do it over USB unfortunately). I then found a code sample integrating it with Paramiko - SSH written in Python. That had a dependency on PyCrypto which is helpfully compiled as an egg on the Py4A page.

Now all I had to do is write a script to do the commit. Easier said than done. I've been spending all of my commute time on it and have only just got the first pushed commit into the repository.

Of course I wouldn't have had a chance of doing this on my iPhone! Three cheers for Android Scripting!

You can visit the fruits of my labour here. But don't expect much - I still have to learn how to push a diff'd second commit!

Wednesday, 21 September 2011

I'm playing with SL4A: UI Builder

I'm now playing with SL4A that I recently discovered. SL4A stands for Scripting Languages for Android and provides live scripting environments on your phone or tablet.

It works in tandem with Python for Android as an interpreter which is downloadable separately. Python is my choice of language for now.

The latest Unofficial packages of SL4A add the ability to build UIs using the standard Android XML format.

That's great but I don't want to be editing XML on my phone. Not finding a useful XML editor for free in the Market I've found my first SL4A project.

UI Builder.

This is a menu driven Python script for generating and previewing live a simple layout XML file. It does not support nearly everything nor does SL4A yet (for example any Views that must be populated by an adapter class can't be done as far as I can see). But you will be able to do interactive form style applications.

I'll post the code soon when I can upload it somewhere. It's longer than a barcode (SL4A's unique script distribution option) for sure.

I'm steadily improving it thanks to time spent carpooling.

As a tease, here's a screenshot, which I can't seem to rotate right...