Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline mobile version/responsive issues #856

Closed
aashish108 opened this issue Feb 6, 2020 · 23 comments
Closed

Offline mobile version/responsive issues #856

aashish108 opened this issue Feb 6, 2020 · 23 comments

Comments

@aashish108
Copy link

Hi! II've been trying out Trilium on y Pi and it looks like a great app!

Is there a way to get offline mode on mobile web Android pls? Been playing around with it. It doesn't have to be an Android app. I think you can save websites on Chrome (etc) and open it like an app?

Also been trying to use Trilium on a web panel on desktop (mobile width) and sometimes at full width on desktop at the same time (testing) and its not really responsive as it depends on login what width it is or if it has the ?mobile URL parameter, right?

@zadam
Copy link
Owner

zadam commented Feb 6, 2020

Hello, mobile version is offline only. Once Android supports Electron (or the other way round!) we can make offline version as well :)

For the second question - you're right that this switching happens based on the login and not responsively. However in practice this should not be a problem since you can't really switch between phone and computer within one session ...

@gerroon
Copy link

gerroon commented Feb 6, 2020

@zadam do you know if this can be compiled on Android using something like Termux? That way one cna have a local copy and sync with another instance.

@zadam
Copy link
Owner

zadam commented Feb 6, 2020

Did a quick google and seems like it should be possible - you can also run docker using Termux and there are already some ARM builds linked from here: https://github.com/zadam/trilium/wiki/Docker-server-installation

@gerroon
Copy link

gerroon commented Feb 6, 2020

@zadam thanks, I will see what I can do.

@aashish108
Copy link
Author

I had a look at the Android Electron issue and, judging by the look of things, it will never be released due to too many issues. So I guess we will never get mobile app with offline storage! :/

I guess its too simple to suggest HTML5 web storage? :O

@zadam
Copy link
Owner

zadam commented Feb 9, 2020

Yes, the trouble is that HTML5 web storage and other solutions would require different codebase and that's simply not sustainable for me.

@capi
Copy link
Contributor

capi commented Feb 10, 2020

I've just successfully compiled the server-side of Trilium under Termux on Android. It runs great. If we could add the possibility to setup the web version as a sync client, I think this could be the basis for an offline-capable version for Android (for geeks).

@gerroon
Copy link

gerroon commented Feb 11, 2020

@capi how about distributing it under Termux? That would make it easy for alot of people.

@jhc86
Copy link

jhc86 commented Feb 11, 2020

Thank you!

I tried to figure out Docker before, but I wasn't successful at the time. (and I'm forever struggling to decide what's best to spend time on) This additional information is really exciting and encouraging me to try it again.

I'd like to echo Sytten's enthusiasm for a way to donate to this project, (#826) but I definitely understand the concerns about legality.

@gerroon
Copy link

gerroon commented Feb 11, 2020

@ jhc86 if youa re referring to use this on Android locally, you do not need Docker, just install Termux and follow the build instructions from the main page, at least that is my guess.

@jhc86
Copy link

jhc86 commented Feb 11, 2020

Here's what I found:

pkg install nodejs-lts gives segmentation fault, so I used pkg remove nodejs-lts and tried again with nodejs instead

Other packages I used: wget, git, python2, and hunspell

I tried both release 40.2 tar.gz (tar -xf releaseName.tar.gz) and git clone https://github.com/zadam/trilium

Both got hung up on: (fuzzy memory, phone died) spellcheck_use_hunspell
So I tried pkg install hunspell but still got error
npm install hunspell says no package found
I think I also tried npm install spellcheck and that failed but I can't remember exactly

I can try to erase termux storage and try again when I have another chance

@capi
Copy link
Contributor

capi commented Feb 11, 2020

@gerroon It was just a first try, it's a long way until a package. :-)

@jhc86 for me the following setup worked, I just had one build-error for something related to PNG, which I used a "--ignore-scripts" for npm for this one package:

pkg install nodejs-lts python build-essential
git clone https://github.com/zadam/trilium.git
cd trilium
git checkout v0.40.3
# vim package.json # remove anything electron
npm install
TRILIUM_HOST=127.0.0.1 node src/www

The important part for me was to remove anything related to electron from the package.json.

@zadam
Copy link
Owner

zadam commented Feb 11, 2020

I've just successfully compiled the server-side of Trilium under Termux on Android. It runs great. If we could add the possibility to setup the web version as a sync client, I think this could be the basis for an offline-capable version for Android (for geeks).

Interesting! Web version can work as a sync client, so far it has been disabled since there wasn't any use case for that ...

@gerroon
Copy link

gerroon commented Feb 11, 2020

@capi thanks, could you also post you package.json?

@capi
Copy link
Contributor

capi commented Feb 11, 2020

Interesting! Web version can work as a sync client, so far it has been disabled since there wasn't any use case for that ...

@zadam Is there an easy way to patch the selection for the setup screen in? Just for testing? (I have not yet looked into the code, to be honest).

@gerroon attached is my package.json for v0.40.3: package.json.zip
I had some issues with compiling pngquant-bin, I worked around that by explicitly installing it without running install scripts (no idea yet what that causes): npm install [email protected] --ignore-scripts

So the whole sequence is:

pkg install nodejs-lts python build-essential
git clone https://github.com/zadam/trilium.git
cd trilium
git checkout v0.40.3
# vim package.json # remove anything electron
npm install
npm install [email protected] --ignore-scripts
npm install
node src/www

I connected to the server with my desktop browser, I did not yet test local Android Chrome. My first experiments show, that the server running works with most things I tried. But it is really slow compared to running it on x86 hardware (e.g. upload of picture takes long).

@capi
Copy link
Contributor

capi commented Feb 25, 2020

I've just compile v0.40.4 and used the sync support of the server instance. So far it works great!

I applied this little patch to get it running: trilium-v0.40.4-termux.zip

It's still necessary to npm install pngquant-bin explicitly:

npm install
npm install [email protected] --ignore-scripts
npm install
node src/www

@leoossa
Copy link

leoossa commented Mar 1, 2020

Have you guys tried Cordova?
https://medium.com/the-web-tub/electron-on-cordova-29ede5d6d789

@rogatty
Copy link

rogatty commented Mar 7, 2020

@capi thanks, works for me too. You can automate # vim package.json # remove anything electron with:

mv package.json package.json.backup
cat package.json.backup | grep -v electron > package.json

@tejasvi
Copy link

tejasvi commented Jun 19, 2020

To anyone else stumbling across, I have created a decent mobile wrapper for android. It can connect to both local and remote servers. Though the local server will provide offline access and lower latency.
First, install termux from the play store. Then install server directly from master or from release depending on the version of your other clients.

pkg install nodejs python build-essential --no-install-recommends -y
# Choose one:
# wget https://github.com/zadam/trilium/archive/v0.xx.x[-beta].zip
    # unzip v0.*.zip
    # cd trilium-0.*
# wget https://github.com/zadam/trilium/archive/stable.zip`
    # unzip stable.zip
    # cd trilium-stable
mv package-lock.json package-lock.json.bak
sed -i.bak '/electron/d' package.json
npm install [email protected] --ignore-scripts
npm install
node src/www

Then extract trilium.zip and install the apk. Use http://localhost:8080 for default local server port.
Pro tip: Enable remote sync by going to the desktop version of the site.

trilium

@capi
Copy link
Contributor

capi commented Jun 22, 2020

@tejasvi Would you be willing to put up the wrapper on a Github repo under a comparable license to trilium itself? I think we could evolve that thing over the time into something very useful!

@ehopps
Copy link

ehopps commented Nov 15, 2020

@tejasvi Just came across your mobile wrapper and I'm seconding capi's comment above. Would you be at all interested in putting up a repo for this wrapper?

@meichthys
Copy link
Collaborator

@tejasvi your comment indicated the wrapper was for android but your screenshot shows iOS.
Do you have a repo for this wrapper?

@meichthys
Copy link
Collaborator

Issue migrated to TriliumNext as future feature requests will be discussed and implemented there.

@meichthys meichthys closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests