Zim

Feature Request: Basic Zim editor for Android

Bug #706366 reported by Tim
226
This bug affects 43 people
Affects Status Importance Assigned to Milestone
Zim
Confirmed
Wishlist
Unassigned

Bug Description

The question was asked a few months ago (https://answers.launchpad.net/zim/+question/131433) if porting Zim to Android would be possible and the answer is that it would likely require a complete rewrite and so is not likely to happen. I'm wondering if, instead of attempting to port Zim completely to Android, someone would be interested in writing a basic text editor for Android that enables WYSIWYG editing of Zim-formatted text files? Here's my setup and this would be the last "missing piece" to make it work perfectly:

I use Dropbox (though it should work with UbuntuOne or other cloud sync services) on two Ubuntu laptops and my Android phone. I have my Zim "Notes" notebook shared through Dropbox and, on the two Ubuntu laptops, things work as expected. I do find that I need to restart Zim when switching to the other laptop so as to see all the changes that have been made, but this is not a problem.

When I'm on the road and using my Android phone, I use the Dropbox file browser, browse to a text file in the "Notes" notebook and open it in a text editor. When I save the file, the changes are uploaded automatically via Dropbox and are waiting on my laptop(s) when I return.

This works well, so far, but it would be really nice to have a graphical user interface and WYSIWYG editing for the editor on the phone. I don't think this would be hard to implement, as the Zim markup is documented and simple. Any ideas where to look for Android hackers that might want to put together a basic text editor for Zim text files with the features listed above? It seems simple enough that AppInventor might be a place to start: http://appinventor.googlelabs.com/about/

Revision history for this message
Tim (cyboreal) wrote :

By way of follow-up, Tomdroid (https://launchpad.net/tomdroid) is a foss project still in the early stages that provides Tomboy notes on Android. Not sure if there is enough of an overlap to reuse any of the components in a "Zimdroid" app.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

As discussed before, not something I will work on (or at least not untill I have an android phone myself ;) ) but request to have zim-compatible editor is much more feasible than fully reimplementing zim on android.

Changed in zim:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Looks like the app mentioned in bug #739036 may fit the bill.

https://market.android.com/details?id=com.kooklab.epistle

Needs dropbox for syncing.

Didn't try it myself (for lack of an andraoid device).

Revision history for this message
gdw2 (gdwarner) wrote :

I've played around with python on android a little bit. I've been able to get several python scripts/programs to run successfully including the whole web2py stack. So I think getting the zim code to run shouldn't be that hard (the backend part, that is, not the gtk stuff) provided that any modules it uses are pure python. I really don't know much about gobject and how that would work on android. AFAIK, gobject isn't pure python.

 That said, the major task would be writing the front end.

I've got a little bit of android ui experience, so I can poke around and see what I can do. Another alternative, and one that fits very nicely with python on android, is to use a webview. This would mean writing the client portion in html/javascript/css. (Or alternatively, you could use something like pyjamas [[pyjs.org]], check it out!). Anybody have any idea what the major obstacles would be in writing the client in html/javascript/css?

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 706366] Re: Feature Request: Basic Zim editor for Android

If you can get python to run it would be great if we can re-use backend zim
modules. That will save a lot of hassle with compatibility etc. and you
don't have to rewrite the parsing routines etc.

Question is how to combin it with a frontend. Probably running zim in server
mode could help. Not sure if you can bind e.g. to localhost:8080 on a phone.
If not we can try running the server behind a named socket (e.g.
/tmp/zim/server.socket).

Current server is read only, it serves pages as HTML. We could add an
interface that allows to POST wiki text to save as a page. Then the webpage
can have a bare editing interface with an "edit" button and a wiki input
field (just like most other wikis out there do it). From there start adding
javascript to make the editing nicer.

Alternative would be to write a dedicated gui frontend, probably can still
interact with zim backend using server infrastructure.

One interesting question: does android support DBus ? If so that would be
the preferred interface between front end and back end.

//Disclaimer: I've done no development whatsoever on a phone, so no idea
what is or isn't possible//

Revision history for this message
Jiří Janoušek (fenryxo) wrote :

From my observations:

1) GObject
There is a GObject port for Android [1]. I don't know status of this project, but even if it works, Python bindings has to be cross-compiled for ARM platform [2]. Luckily, Jaap has a branch that replaces GObject with pure Python implementation. But it hasn't been finished yet.

2) HTTP Server
I created simple BaseHTTPServer example [3] and it works on both emulator and real device (Samsung Galaxy S) using SL4A [4].

3) DBus
It seems that DBus is used by a few system applications, but there is no guarantee that DBus is going to be on every device [5]. DBus is not supported in both native API and Java API.

[1] http://gitorious.org/android/libglib/trees/master/gobject
[2] http://code.google.com/p/python-for-android/wiki/BuildingModules
[3] https://gist.github.com/1028961
[4] http://code.google.com/p/android-scripting/
[5] http://groups.google.com/group/android-ndk/browse_thread/thread/24a98bb7c0b44c58/001a67a1ee80779e

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

So sounds like a basic app could be build using the HTTP interface. In that
case we need the following:

1/ Merge patches to remove GObject dependency from non-gui classes
2/ Rewrite server class to use BaseHTTP server instead of our GObject based
handling of sockets
3/ Add editing capability to the web interface

-- Jaap

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Just a brainstorm idea on this topic.

Today gtk 3.2 was released which adds an *experimental* html5 backend. This basically means you can show a gtk app in the browser. Currently only works with firefox. Still very premature stuff, but interesting.

So *if*
1/ this stuff matures and
2/ it works in webkit based browsers and
3/ we port zim to gtk 3 and
4/ we get all the libraries to compile and run
this could be a way to run zim on any platform that does not support gtk directly.

Still a pretty big "if", but who knows how it will develop over time.

-- Jaap

Revision history for this message
Frank Van Geirt (fvangeirt-deactivatedaccount) wrote :

Just for the record. I started experimenting Android development some week ago. I am currently playing with the Dropbox API. I registered an app 'ZimDroid' in order to use the Dropbox API. If this is working well, I will start to work on editing the Zim format in the Android app. As soon as I have something to test I will post it here.

Where can I find the latest description of the Zim format?

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

On Sat, Apr 28, 2012 at 8:58 PM, Frank Van Geirt
<email address hidden> wrote:
> Where can I find the latest description of the Zim format?

Manual page is here: http://zim-wiki.org/manual/Help/Wiki_Syntax.html

Have a look at the code of zim/formats/wiki.py for details. It defines
the regex expression per format type.

Best to take the version from the "next" branch, here:
http://bazaar.launchpad.net/~jaap.karssenberg/zim/pyzim-next/view/head:/zim/formats/wiki.py

You can run formatting with e.g "cat wiki.txt | python -m zim.formats
wiki html" to get a quick check of how zim parses a construct.

-- Jaap

Revision history for this message
boubalos (zhu-xiaof) wrote :

hope some one can launch a project to port zim to adroid and ipad

Revision history for this message
Tim (cyboreal) wrote :

@Frank - how is the ZimDroid app coming? I recently got a 7" Android tablet and would *really* like to be able to transition from Catch notes to Zim. The absence of an Android app that handles syncing (via Dropbox or WebDAV) is a deal-breaker at this point. Let us know when you need testers. Thanks!

Revision history for this message
Frank Van Geirt (fvangeirt-deactivatedaccount) wrote :

Hi Tim, I've been experimenting with the Dropbox API, but it didn't satisfy my own needs. I wasn't free to choose my own folder to sync the files, so I (temporary) dropped the idea to use Dropbox. I would like to test some other similar systems, but at the moment, time is the biggest issue. I am starting up my own company which uses all my energy and resources. At the moment, there is no real development going on from my side. Regards, Frank.

Revision history for this message
Tim (cyboreal) wrote :

Frank, I certainly understand about the lack of time problem! All the same, I'm still hoping something will happen soon. An even better solution than Dropbox, in my opinion, would be WebDAV sync capability. That way, anyone who runs their own private cloud could sync their notes without handing over everything to a 3rd party. (Either that or build in an encryption layer, like EncFS.) We use Zimbra in our organization and the webdav access to shared folders is a wonderful feature - it would be a perfect compliment to an Android Zim wiki editor. Of course, we would then need to ask Jaap to add a WebDAV sync to Zim.

If you get some time, maybe consider Kickstarting the project? I'd gladly help fund an open-source "Zimdroid" app that is tablet-aware.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

On Wed, Aug 8, 2012 at 3:45 PM, Tim <email address hidden> wrote:
> If you get some time, maybe consider Kickstarting the project? I'd
> gladly help fund an open-source "Zimdroid" app that is tablet-aware.

I'm pretty sure you would not be the only one. I would definitely put
in some myself (provided the apps source is published) and likely
others on the mailing list as well.

But fully appreciate that funding does not magically create more time
in your agenda ;)

-- Jaap

Revision history for this message
Frank Van Geirt (fvangeirt-deactivatedaccount) wrote :

Well, the first step is taken. I registered a project "ZimDroid" at Launchpad:
https://launchpad.net/zimdroid

Next, I have to set-up a system Linux (Fedora) / Exclipse / Bzr / Launchpad. This is the first time for me, so tips & pitfalls are welcome.

Then I will start a basic Android project on Launchpad on which we can build...

Revision history for this message
Tim (cyboreal) wrote :

> Well, the first step is taken. I registered a project "ZimDroid" at Launchpad:
> https://launchpad.net/zimdroid

Frank, this is great news! I look forward to helping in whatever way I can.

At the risk of overloading Zimdroid with feature requests at the outset,
let me point out the obvious: Zim excels at facilitating the management
of information and this information is frequently of a sensitive nature
(e.g. business intelligence, trade secrets, IP, network of contacts,
etc.). To that end, it would be tremendous if Zimdroid could make use of
encrypted wiki data. Specifically, it would be very helpful if Zimdroid
could be designed to be aware of wikis that are encrypted using the
EncFS encryption library (see Cryptonite, for example:
http://code.google.com/p/cryptonite/). In this way, Zimdroid could
natively use Zim wikis that are encrypted using EncFS and synchronized,
whether by using revision control or Dropbox:

User input
-^-^-^-
Zim / Zimdroid
-^-^-^-
unencrypted files
-^-^-^-
EncFS decryption layer
-^-^-^-
encrypted files
-^-^-^-
synchronization service (e.g. Dropbox, Git, Hg, etc.)
_____

This may be for later on down the line, but would turn Zimdroid into an
immensely powerful, one-of-a-kind, secure, mobile information management
application.

Revision history for this message
leoluk (leoluk) wrote :

Any news?

Revision history for this message
Frank Van Geirt (fvangeirt-deactivatedaccount) wrote :

I know it's going slow but I made some extra steps. I've set-up a combination Fedora - Eclipse - Android SDK - Bazaar - Launchpad. Especially the combination with Bazaar & Launchpad is new for me. I pushed my first code (a standard Android template app) and production chain works. I can now start adding code.

https://launchpad.net/zimdroid

Perhaps interested people can start having a look and try to do something (e.g. file bug/change request) and give me feedback. I assume I still have to configure launchpad further for more access, but I would appreciate assistance; like I said it's new for me...

Revision history for this message
Tim (cyboreal) wrote :

@Frank, glad to see things are moving forward. I'm joining your project on launchpad, let me know how I can help. The urgency of needing this app continues to increase, so thank you!

Revision history for this message
pvanb (p-vanbreugel) wrote :

Hi Frank,

I would like to add my interest.. I am not a programmer, but if any testing need to be done, let me know

Revision history for this message
jayseye (jayseye) wrote :

Just curious, is the plan to use Java? I've heard that Python does
have some support under Android, though have yet to learn whether it
can be used for GUI programming.

Revision history for this message
Frank Van Geirt (fvangeirt-deactivatedaccount) wrote :

A basic first version of ZimDroid can be downloaded via https://launchpad.net/zimdroid
Currently there is no build or apk-file; I still want to add some features first.

It can be downloaded via "bzr branch lp:zimdroid". I use Eclipse with the Android SDK.

My Zim notebook is on Dropbox. With the Dropsync app I sync my Zim folder with my Android device. This synced folder can be added in ZimDroid. Currently one can browse the tree and only view the pages; no editing yet.

For now it would be interesting that someone starts to experiment. I probably need to make some configuration to launchpad too. Further, I will start some basic documentation.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

On Tue, Feb 26, 2013 at 9:23 AM, Frank Van Geirt
<email address hidden> wrote:
> A basic first version of ZimDroid can be downloaded via https://launchpad.net/zimdroid
> Currently there is no build or apk-file; I still want to add some features first.
>
> It can be downloaded via "bzr branch lp:zimdroid". I use Eclipse with
> the Android SDK.
>
> My Zim notebook is on Dropbox. With the Dropsync app I sync my Zim
> folder with my Android device. This synced folder can be added in
> ZimDroid. Currently one can browse the tree and only view the pages; no
> editing yet.
>
> For now it would be interesting that someone starts to experiment. I
> probably need to make some configuration to launchpad too. Further, I
> will start some basic documentation.

This looks very promising!

Looking over the code, but afraid I have to learn a bit more java to
be able to contribute. Am interested though to have a look at the
"wiki-to-html" code to ensure it matches what the python version is
doing. (I'm currently refactoring part of the parsing in the python
code - now have a few good test cases for parsing.)

Regards,

Jaap

P.S. once you have a build that is ready for more testers, announcing
on the mailing list will sure get some attention

Revision history for this message
Martin (martin-amery) wrote :

Anyone seen "Draft" by mvilla on Google play.
looks like it may open/read zim via dropbox

Martin

Revision history for this message
arjmage (arjmage) wrote :

That's a negative martin. The "Draft" app, which is not free btw, does claim to make markdown syntax files. However, the way the app is now it creates it's own filespace and does not have the ability to open files on the android device or save it there. It seems to be for directly saving it to dropbox in a folder that it creates. So, this is not useful to edit zim notes that already exist.

On the other hand, what would work is to use dropsync to keep a local copy synchronized on the android device, and then use a (free) app like "MarkDawn" or "MarkDrop" perhaps to make quick edits to the .txt notes. These editors don't use the exact same syntax as Zim but do make it easier to use the Zim wiki syntax for some quick edits.

Going to contribute to Zimdroid with my python know-how, but likely only after july.

arjmage

Revision history for this message
Frank Van Geirt (fvangeirt-deactivatedaccount) wrote :

Editing pages is also possible in the current basic version of ZimDroid. Not yet a wysiwyg editing, but straight into the zim files. The files can be stored and are perfectly readable and editable in my Zim on Windows & Linux. I am using this version already in my daily job.
Next step is to add new pages. Then the focus will be on some wysiwyg editing.

Revision history for this message
ianp5a (ianp) wrote :

Just for info, I use "Ubuntu One" to sync files, including my Zim files files between Windows(work), Linux(home) and Android. So my Zim files are already on Android in a folder. I just need the editor. Like Dropbox it's a good solution.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Latest initiative to get this started is here: https://github.com/jaap-karssenberg/zim-android-mockapp/wiki

Find out how you can help in the wiki

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.