OpenLauncherTeam / openlauncher

Customizable and Open Source Launcher for Android
Apache License 2.0
1.41k stars 413 forks source link

Make PWAs installable #637

Closed Apollo3zehn closed 2 years ago

Apollo3zehn commented 3 years ago

I have worked on a solution to make PWAs installable from Firefox for Android as shown in the following pictures. The pictures have been made trying to install Mozilla`s test PWA (https://mdn.github.io/pwa-examples/a2hs/).

Install button appears

Screenshot_20210104-120807_Firefox

Shortcut with correct PWA icon and label created

Screenshot_20210104-120859_OpenLauncher

PWA launched in full screen mode

Screenshot_20210104-120821_Firefox

Since I am not a Java nor an Android develeoper, this PR is not intended to be merged directly. Instead somebody with more knowledge should review and extend (or copy) it with necessary additions e.g. to handle different android versions. The shortcut feature is not only useful for PWAs but also for normal app shortcuts which I did not implement example.

This is also related to #583 and #568.

My works are based on those of the Bliss Launcher of /e/-OS (https://gitlab.e.foundation/e/apps/BlissLauncher) which helped me to implement this feature.

Apollo3zehn commented 3 years ago

I forgot to provide some additional info:

C:\Users\wilvin>java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) Client VM (build 25.271-b09, mixed mode)

Installed plattform: android-28

Stupidman22 commented 3 years ago

This need some modified but It the true way. This guy deserves to be appreciated. Why author not comment in this work ??

gsantner commented 3 years ago

Java / Android version should be ok, no worries. Way more important is that it works well, and not breaks something else.

This need some modified but It the true way. This guy deserves to be appreciated. Why author not comment in this work ??

@Stupidman22 Because other people have a personal live too and OpenLauncher is not much in active development. If you are interested, feel free to improve the project and send a PR like Apollo does here.

gsantner commented 3 years ago

@Apollo3zehn Would you also mind to add (/try/improve) generic launcher shortcuts? So where apps can add a shortcut to desktop to certain files, pages etc.

For example at Markor open source android app you can add desktop launcher shortcut for current file..so you can directly open the file in editor from launcher. (--> i.e. Apps that use the INSTALL_SHORTCUT permission in a generic way)

viperperidot commented 3 years ago

Will this also work for chromium based browsers? Thanks for starting on this, I think it is a really important feature for a FOSS launcher to have because lots of people use webapps and browser shortcuts on the homescreen as an alternative to many traditional applications.

Apollo3zehn commented 3 years ago

I am not sure if I am the right person for this. I am no Java or Android app developer. I would not mind if somebody else takes over this part. If nobody want to do this, I can try to do it myself the following months, unfortunately I do not have much time right now.

igor-cali commented 3 years ago

I tested this PR on Android 10 emulator and it works fine with Chrome and Firefox browsers.

It could be improved in future so the website favicon (if available) is used in place of the browser icon for the shortcut. Anyway, I am not sure how much this is dependant on OL and how much in the used browser app.

I think this PR could be merged.

natrius commented 2 years ago

Please merge this so https://github.com/OpenLauncherTeam/openlauncher/issues/522 can be closed as well after the next update @gsantner The Issue is open already for close to 2 years and the pull request for 1 year. Its better to have it working soon and finetune it later, espacially if nobody else has time to do it (it seems like @Apollo3zehn does not have the time right now)

gsantner commented 2 years ago

I merge it now, hope it not breaks something.

chrysn commented 1 year ago

I'm experiencing a few oddities in the nightly builds when using this:

I'll play around a bit to see whether I can dig down and/or fix any of this, but I'm not an Android developer (as may show in my interest in PWAs, and I'm not actually a web developer even ;-) ), so no promises.