Laverna: Mobile app

Created on 16 Sep 2014  ·  21Comments  ·  Source: Laverna/laverna

Is there a roadmap for a mobile friendly version of Laverna? It's not unusable on mobile, but I think a lot more can be done. I'm thinking Apache Cordova might be a good contender to easily wrap the existing code into apps compatible across platforms.

Some features I think would be good to have in mobile versions:

  • Native app, separate from regular browser.
  • Use completely offline (html/js is distributed/served inside the app.)
  • Place offline edited items into a queue to be synced in the background whenever connection is available. We can probably steal dropbox sync code from todo.txt
  • Insert photos via camera or gallery.

If nothing like this has been considered, I'll probably start investigating Cordova.

enhancement

Most helpful comment

@wwebfor Hi! I would like to contribute to the project and create a native android app.
So, if you don't mind, maybe you have some suggestions or wishes?
Anyway, I'll start it in my own repository, and if everything is okay, we can come up with it somehow.

All 21 comments

You can compile a phonegap app. All you have to do is to run a command grunt platform-build.

oh, nice, that was easy! It looks like this is still pretty early, I can see a list of notes, but when I click on them I can't view them. Editing works great though. I'll play around with this some more. Thanks!

For me grunt platform-buildfails with:

[...]
Running "phonegap:build" task
Cleaning phonegap
Creating directory tree
Cloning root directory
Warning: EMFILE, open 'dist/bower_components/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/AlphaPresentForms.js' Use --force to continue.

Aborted due to warnings.

I can send the full log if needed.

If I use grunt --force platform-build as suggested I get:

[...]
Running "phonegap:build" task
Cleaning phonegap
Creating directory tree
Cloning root directory
Warning: EMFILE, open 'dist/bower_components/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/AlphaPresentForms.js' Used --force, continuing.
Fatal error: EMFILE, open 'dist/bower_components/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/AlphaPresentForms.js'

The file dist/bower_components/MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/AlphaPresentForms.jsexists. I don't know what the problem is.

grunt build do not fail. But I can't display notes if I click on them on my Galaxy Note 2 phone using Firefox 32.0.1. Maybe it is the same problem @EnigmaCurry is also having.
It is even worse using Chrome 37.0.2062.117 on Android. The first laverna page is not correctly displayed.

I investigated the issue I saw where you couldn't see the notes. The notes list get's a high z-order value of 1070 when the window is not very wide (as is the case on mobile). The note itself has a z-order of 1030, so it is actually appearing beneath the list of notes, so you can't see it.

How exactly do I get this phonegap app on my android device?
I am currently running laverna from laverna.cc and have my notes stored in mydropbox.

I am also having an issue running grunt platform-build, it seems that the AndroidManifest.xml is somehow not created.

Running "phonegap:build" task
Cleaning phonegap
Creating directory tree
Cloning root directory
Cloning .cordova directory
Compiling config.xml
Compiling template dist/config.xml
Adding plugins
Building platforms
Running: phonegap local build android
[phonegap] adding the Android platform...
>> C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.js:126
>>                     throw e;
>>                           ^
>> Error: An error occurred while listing Android targets
>>     at C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\lib\check_reqs.js:87:29
>>     at _rejected (C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.js:808:24)
>>     at C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.js:834:30
>>     at Promise.when (C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.js:1079:31)
>>     at Promise.promise.promiseDispatch (C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.js:752:41)
>>     at C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.js:574:44
>>     at flush (C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.js:108:17)
>>     at process._tickCallback (node.js:419:13)
>> { [Error: C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\create.bat: Command failed with exit code 8] code: 8 }
   [error] C:\Utilisateurs\a555979\.cordova\lib\android\cordova\3.5.1\bin\create.bat: Command failed with exit code 8
Fatal error: Unable to read "phonegap\platforms\android\AndroidManifest.xml" file (Error code: ENOENT).

Should I open an separate issue?

I also got error while running grunt platform-build.
I don't understand how to get a mobile friendly app.
Do we have to build this where laverna was installed ? (in my case a server) or on the mobile device we wan't it working ?

The error I got is :

Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
    at /home/User/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:159:19
    at _fulfilled (/home/User/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/home/User/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/home/User/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:760:13)
    at /home/User/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:821:14
    at flush (/home/User/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:906:3

Error: /home/User/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

[phonegap] executing 'cordova build android'...
No platforms added to this project. Please use `cordova platform add <platform>`.

With User the name of my user on my server.

How can I deal with this ?

Thanks

I managed to build the mobile application, why haven't you released it in play store?

Might I suggest listing the Android app in the f-droid store, as I believe it is license appropriate to do so!

We were planning to release it but currently we feel like it is not optimized much for mobile devices yet.

I think not being optimized for mobile is not a big issue in the sort-run. It would be cool though to have offline support for notes, the option to create a note with the share menu and not being forced to use a (resource heavy) full sized browser.

Firstly, laverna looks awesome, thanks for sharing it.

Any update on the android version? Would be a huge win if I could sync private notes onto my phone...

I've managed to build laverna based on the readme, but I can't seem to figure out how to build the android app. running grunt platform-build tells me there isn't a Gruntfile. I'm sure I'm missing something obvious and would appreciated any pointers ..

@opennomad recently we switched to Gulp. That is why currently there isn't a task for building Android app.

Laverna is lacking documentation for building the mobile and desktop apps. Can the commands at least be added to the README or the wiki for ease of getting started? @wwebfor Or are you saying that after switching to gulp there's no support for building android? What about the 'mobile' task I see in the gulpfile, and gulp/mobile.js?

I ran gulp build, and that wrote everything to the dist/ folder, but how do I package that up? I tried phonegap (installed with npm install -g phonegap) with phonegap run android in the project root directory, but I got:

[phonegap] executing 'cordova run android ' ...
Error: Current working directory is not a Cordova-based project.

Also, the wiki FAQ's link to this issue is broken. It attempts to link here (#174), but the html is incorrect and it acts like an anchor instead--leading no where.
EDIT: Okay, I fixed the link on the wiki page to point here correctly.

@sp4x Can you describe how you got the mobile app to build? I would really like to do some development on the mobile app to bring it up to par.

@wwebfor Hi! I would like to contribute to the project and create a native android app.
So, if you don't mind, maybe you have some suggestions or wishes?
Anyway, I'll start it in my own repository, and if everything is okay, we can come up with it somehow.

@vboitsov it would be amazing.

FYI for all those following this issue:

FYI for all those following this issue: https://github.com/vboitsov/laverna-android.git

Hello there,
Please report to https://github.com/Laverna/laverna/issues/971#issuecomment-411423965 which explain the state of this project.

Have a nice day/night,
Cheers,
Nissar

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aaron-Zhao picture Aaron-Zhao  ·  5Comments

JerJohn15 picture JerJohn15  ·  9Comments

inukaze picture inukaze  ·  9Comments

Issam2204 picture Issam2204  ·  8Comments

fanrongqitiancai picture fanrongqitiancai  ·  8Comments