Running emacs and org-mode under Android. I’m doing this on my Android tablet -
it’s not perhaps as useful on a phone, though it’s not unmanageable.
There used to be an Emacs app for Android in the Google Play store - in fact it’s still there, but the server it used to download its files from is no longer working - and the app was always a bit fiddly to get to work properly.
Here’s a better way of getting it working:
That gets org-mode to work as expected.
Now, most likely you will have org-files that you want to keep synchronized. You may already be running MobileOrg, with something like a Dropbox synchronisation. Note that the way that the MobileOrg app works, you can’t edit the org files that it uses directly. MobileOrg utilises some sort of database and the changes that it pushes back are done so through the database, so editing the org files that MobileOrg is synched with (say, in Dropbox) won’t result in any changes being propagated back to your other devices.
So, if you’re running MobileOrg with Dropbox, you’ll need to have a separate Dropbox synchronisation in order to be able to edit org-files in Emacs on Android in a way that allows for propagation of changes from Android to other devices/repositories.
Here’s a method which allows for editing of org-mode files on Emacs which allows for back-propagation via Dropbox:
There used to be an Emacs app for Android in the Google Play store - in fact it’s still there, but the server it used to download its files from is no longer working - and the app was always a bit fiddly to get to work properly.
Here’s a better way of getting it working:
- Install ZShaolin, a console terminal emulator (zsh shell) for Android with a number of useful commandline tools like rsync, awk, imagmagick etc.
- Then install the files from the old Emacs app. They’re no longer accessible via the app from the Play store, but I had saved the files from back when it still worked, and have zipped them up and thrown them on mega: https://mega.co.nz/#!B4AThKxI!_ImT57mJNirozxna-1SOcNGAzPRr9QacM34jUoPVMgo
- Unzip the files from there and place at /sdcard/emacs/ on your device.
- Then, open up ZShaolin and start a session, and type “emacs”. VoilĂ .
- Create a .emacs file (if you don’t have one already) in ~ under ZShaolin and put the following into:
(defun load-history-filename-element (file-regexp) "Get the first elt of `load-history' whose car matches FILE-REGEXP. Return nil if there isn't one." (let* ((loads load-history) (load-elt (and loads (car loads)))) (save-match-data (while (and loads (or (null (car load-elt)) (not (and (stringp (car load-elt)) ; new condition (string-match file-regexp (car load-elt)))))) (setq loads (cdr loads) load-elt (and loads (car loads))))) load-elt))
Now, most likely you will have org-files that you want to keep synchronized. You may already be running MobileOrg, with something like a Dropbox synchronisation. Note that the way that the MobileOrg app works, you can’t edit the org files that it uses directly. MobileOrg utilises some sort of database and the changes that it pushes back are done so through the database, so editing the org files that MobileOrg is synched with (say, in Dropbox) won’t result in any changes being propagated back to your other devices.
So, if you’re running MobileOrg with Dropbox, you’ll need to have a separate Dropbox synchronisation in order to be able to edit org-files in Emacs on Android in a way that allows for propagation of changes from Android to other devices/repositories.
Here’s a method which allows for editing of org-mode files on Emacs which allows for back-propagation via Dropbox:
- Create a separate Dropbox synchronisation directory - that is, separate from the one you use for MobileOrg synchronisation. [The way I did this on my Linux desktop was to create a symlink from my “Org folder” in my Documents directory to the “actual” Org directory in my Dropbox folder. In my setup, this directory also synchs with a git repository, so I ended up excluding the hidden .git directory from synching with Dropbox, since I have only a free, very-limited-space Dropbox account.]
- Open up the Dropbox app on your Android device. Navigate to your new Org directory (not the one you use for MobileOrg). “Open” any of the org files you want to have access to. It doesn’t matter if they successfully open or not - the act of “opening” them gets the Dropbox app to save a local copy which it will keep synchronised with your Dropbox repository.
- The location for these local files is a path like this: /sdcard/Android/data/com.dropbox.android/files/u87923223/scratch/YourOrgDirectoryName/ the u-number part of the path I assume varies from user to user; and of course the final part of the path will depend on what you named your Org folder and files
- Files in the above path can be opened in Emacs on Android. Any changes you make will be propagated via Dropbox.