How to use the "share" feature on Android for sending links to a livecode app?

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
TorstenHolmer
Posts: 57
Joined: Mon Oct 28, 2013 1:23 pm
Location: Dresden, Germany

How to use the "share" feature on Android for sending links to a livecode app?

Post by TorstenHolmer » Sun Jan 08, 2023 5:54 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: How to use the "share" feature on Android for sending links to a livecode app?

Post by jacque » Mon Jan 09, 2023 7:14 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

TorstenHolmer
Posts: 57
Joined: Mon Oct 28, 2013 1:23 pm
Location: Dresden, Germany

Re: How to use the "share" feature on Android for sending links to a livecode app?

Post by TorstenHolmer » Tue Jan 17, 2023 7:42 am

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: How to use the "share" feature on Android for sending links to a livecode app?

Post by jacque » Tue Jan 17, 2023 7:50 pm

This lesson may help:
https://lessons.livecode.com/m/4069/l/5 ... rl-schemes
There is more info in the comments.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Android Deployment”