Page 1 of 1
How to use the "share" feature on Android for sending links to a livecode app?
Posted: Sun Jan 08, 2023 5:54 pm
by TorstenHolmer
Hi,
I want to send a link from a newspaper app via the share feature of Android to my mobile livecode app.
I tried it with the url scheme but it does not work.
Is there a way to "register" my app that it can receive the information by "share" or how can I do this?
Cheers,
Torsten
Re: How to use the "share" feature on Android for sending links to a livecode app?
Posted: Mon Jan 09, 2023 7:14 pm
by jacque
I haven't tried it but I think you need to adjust the manifest. What URL scheme did you use? I think you need text/html. Here's the link I was reading:
https://developer.android.com/training/sharing/receive
If you examine the manifest of your app you may see the scheme in there and see if it is a text based one.
Re: How to use the "share" feature on Android for sending links to a livecode app?
Posted: Tue Jan 17, 2023 7:42 am
by TorstenHolmer
Hi Jacque,
thanks for the hint, but it seems that LC needs beyond the XML manifest a function called "getIntent" which will import the data. Also the app needs an icon for the sharesheet in Android etc.
So the simplest way I could find and will use is the following:
- In the sender app choose "Share" and then select the "Clipboard" option.
- In the receiving app, create a native android text field.
- When running the app, press long inside in the textfield and select the "Paste" option.
- This way you can copy the information (in my case a news page link) between the apps.
- As an enhancement you can write a textChanged handler in the field which calls a handler with the received link (thanks to Mark Talluto for sharing this tip in the "Mobile clipboard?" thread.
Cheers,
Torsten
Re: How to use the "share" feature on Android for sending links to a livecode app?
Posted: Tue Jan 17, 2023 7:50 pm
by jacque
This lesson may help:
https://lessons.livecode.com/m/4069/l/5 ... rl-schemes
There is more info in the comments.