The Android port is just about usable. Still, we have some fun todo items to improve it.

high-priority TODO

  • ?Android app permission denial on startup
  • S3 doesn't work (at least to Internet Archive: "connect: does not exist (connection refused)")
  • Get app into Google Play and/or FDroid


  • Don't make app initially open terminal + webapp, but go to a page that allows opening the webapp or terminal.
    Possibly, switch from running inside terminal app to real standalone app. See and

  • I have seen an assistant thread crash with an interrupted system call when the device went to sleep while it was running. Auto-detect and deal with that somehow.

  • Make git stop complaining that "warning: no threads uspport, ignoring --threads"
  • git does not support http remotes. To fix, need to port libcurl and allow git to link to it.
  • getEnvironment is broken on Android and a few places use it. I have some horrible workarounds in place.
  • Get local pairing to work. network-multicast and network-info don't currently install.
  • Get test suite to pass. git clone of a local repo fails on android for some reason.
  • Make app autostart on boot, optionally.
  • The app should be aware of power status, and avoid expensive background jobs when low on battery or run flat out when plugged in.
  • The app should be aware of network status, and avoid expensive data transfers when not on wifi. This may need to be configurable.
  • glacier and local pairing are not yet enabled for Android.
  • The "Files" link doesn't start a file browser. Should be possible to do on Android via intents, I suppose?
  • Adding removable drives would work, but the android app is not in the appropriate group to write to them. WRITE_MEDIA_STORAGE permission needed. Added to AndroidManifest, but did not seem to be used. Googleing for it will find a workaround that needs a rooted device.
It's a linux kernel so perhaps another option would be to create a big file and mount -o loop
Comment by gdr-go2 Mon May 28 18:12:10 2012
mount requires root and you'll have still the 4gb limit for your image by FAT. some phones (e.g. galaxy nexus) already use ext4 for /sdcard though.
Comment by Bernhard Mon Sep 10 19:34:00 2012

I played around a bit with GHC and Android today. It isn't really a result, but maybe useful for someone out there.

I have a Debian chroot environment on my Android device (howto: In the Debian box:

$ cat arm.hs
main = do
  putStrLn "Hello ARM"
$ ghc -static --make arm.hs
Linking arm ...
$ ldd arm => /usr/lib/ (0x40233000) => /lib/ (0x400c8000) => /usr/lib/ (0x401b1000) => /lib/ (0x40171000) => /lib/ (0x40180000) => /lib/ (0x4018b000) => /lib/ (0x40282000)
/lib/ (0x400a2000) => /lib/ (0x4007e000)

well, that isn't really static. tell the linker to build a static binary (those are arguments to ld):

$ ghc --make arm.hs -optl-static -optl-pthread
[1 of 1] Compiling Main             ( arm.hs, arm.o )
Linking arm ...
$ file arm
arm: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.18, not stripped
$ ldd arm
    not a dynamic executable
$ ./arm
Hello ARM

now, get this (quite big) binary into the normal android environment, using adb, SSHDroid or whatever:

% cd /data/local/tmp # assuming destination of file transfer
% ./arm
arm: mkTextEncoding: invalid argument (Invalid argument)

looking in the source of System.IO it seems like an iconv issue. So, there's still some dynamic dependency in there... sigh

Comment by Bernhard Mon Sep 10 21:58:28 2012

Thanks Bernard, that's really massively useful. It makes sense -- statically building with libc should work, the Android kernel is still Linux after all.

To get past the iconv problem, I think all you need is part of the locales package from your linux system installed on the Android. Probably just a few of the data files from /usr/share/i18n/charmaps/

Comment by Tue Sep 11 02:12:45 2012

/usr/share/i18n/ does not exists on my Debian ARM system :/

however, strace ./arm in the debian chroot reveals that some files from /usr/lib/gconv/ are loaded:

open("/usr/lib/gconv/", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\4\4\0\0004\0\0\0"..., 512) = 512

full log: Unfortunately, I don't have strace in the android userland for comparison.

Just copying the related gconv files didn't work. I don't have so much time at the moment, I'll investigate further in some days or so.

At least, output using error :: String -> a does work :-)

Comment by Bernhard Tue Sep 11 09:34:42 2012

Just so this does not get lost: For better or for worse, the vanilla Android devices stopped shipping with micro-SD support in 2011 (or 2010 if the Nexus S does not support them either; on sketchy GPRS so not googling around). Most higher-end Android devices ship with at least 8 GiB of on-board Flash storage, some even go up to 64 GiB.

IMHO, this would make it viable to first get git-annex working on Android without regard for FAT.

The obvious advantage is that porting should be easier and quicker.

The obvious downside is that this may mean revisiting some parts of the code later.

-- Richard

Comment by Richard Tue Oct 30 08:44:32 2012

Actually, this is something that would be ideal for a poll:

Should FAT-based Android repos be implemented:

  • Immediately
  • After the initial release of the Android app is working
  • Before the kickstarter ends
  • Not at all

Also, as another data point, the FAT-based SD card can be mounted as USB storage by any computer an Android device is connected to whereas the EXT4-based root FS can only be accessed via MTP.

Comment by Richard Tue Oct 30 08:51:17 2012

I use Terminal IDE on android, which is 'sort of a shell environment'.

It has bash, git, dropbear ssh, and vim. It is a bit limited, but it does feel like a linux shell.

Comment by Carlo Wed Nov 21 21:46:19 2012

I'd like to have my phone sync a bunch of files when I'm at home and when I get to work, have them synced to my work machine, deleted off my phone and when I get home, also deleted off my home machine.

This will allow incremental backups to a local folder at home and I can then "mule" my files, sneaker-net style, to work with zero user intervention. It only works if events can be triggered or I can combine a triggering app with a special android intent for both ends of my trip.

Comment by Aaron Tue Jan 8 13:04:05 2013

One of the points is:

  • The app should be aware of power status, and avoid expensive background jobs when low on battery or run flat out when plugged in.

This isn't good for situations where the device is plugged in and charging, but will only be so for a limited time (such as charging during a car journey) as the device would charge slower.

Could this behaviour be configurable too?

Comment by Xyem Mon May 6 12:18:39 2013