midgard
midgard copied to clipboard
Add Android support
Looking forward to Android.
Yes, Android can be easily supported. But I don’t have a good idea about how Android support should look like. For example, on desktop, there is a daemon process for syncing clipboard, on iOS, there are Shortcuts to fetch clipboard. But on Android, I can’t imagine a way to fetch them except developing an app. This seems less convenient.
If you have a good idea, feel free to suggest here.
@Codexiaoyi @changkun You may want to look into Tasker android app, it is a trial/paid app which is kind of like iOS Shortcuts but on steroids. In it there is a clipboard change event trigger, and then there is a http request task that can be done. I think it can be done on it. Please share the results if anyone tried
so it works using tasker implementation.
just make sure to change the http://pi:[email protected]:8456/midgard/api/v1/clipboard
in the below taskernet scripts to your setup http://USERNAME:PASSWORD@DOMAIN:PORT/midgard/api/v1/clipboard
Midgard SEND https://taskernet.com/shares/?user=AS35m8n2e1ZqSMAXi0rAdytI3lFROIIV6atUo8BPrMJuT45bsVYevMyh1FKJLYTk54TKvCKr&id=Profile%3AMidgard+SEND
The midgard should autosync when using the Midgard SEND event
Midgard RECEIVE https://taskernet.com/shares/?user=AS35m8n2e1ZqSMAXi0rAdytI3lFROIIV6atUo8BPrMJuT45bsVYevMyh1FKJLYTk54TKvCKr&id=Profile%3AMidgard+RECEIVE
The Midgard RECEIVE in the above script triggers using gestures with beep sound (it will trigger when the phone orientation is changed from keeping it on the table to standing upright), but you can change it to anything
Also change the Authorization value from cGk6cmFzcGJlcnJ5
to base64 encoded value of your USERNAME:PASSWORD
from https://www.base64encode.org/
Thanks for the recommendation @r4nchy. It turns out that there is no system-level solution to support iOS-like "Shortcuts". Asking a user of Midgard to install a 3rd party app is not a goal can be aligned with user easily.
I think a feasible solution is to develop a midgard android app, using existing GUI solutions, such as Fyne, Gio, or GoMobile to support these features:
- sync text clipboard content midgard server on android
- allow upload pictures from android and upload to midgard server as image clipboard content