How to add SHARE option to my app with other apps

846 views
Skip to first unread message

Durga Prasad

unread,
Sep 24, 2015, 11:47:22 PM9/24/15
to AndroidScript
Hello,

How can I share my app name or Google play store link with other apps from my created app. That's is if I click share button in my app it has to show the available sharing options with different other external imstalled apps.

If I click -> share -> whatsapp (selecting an app) -> in whatsapp send my desired text

How can I achieve this? Any examples will help me..

Steve Garman

unread,
Sep 25, 2015, 12:33:06 AM9/25/15
to AndroidScript
Durga, I am not quite sure what you are asking for.

If you want your app to appear in the list when someone presses a "Share" button in another app, you can do that now.

Take a look in the samples at "Shared data".

If you want open a file, choosing the appropriate app from a list, there is
app.OpenFile()

If you want to put a "Share" button in your app, I think that is difficult to use right now.

The plan is that in the next version of DroidScript, it should be easy to send a file to any other app using the share mechanism.

Durga Prasad

unread,
Sep 25, 2015, 1:41:35 AM9/25/15
to AndroidScript
Yes Steve I meant to do the opposite action of shared data sample.that is I need to send text to other apps.

In the shared data sample I can able to receive text from other Apps.
I have attached few sample apps screenshot to give much more clarity.

Also I saw send intent sample file. But I am quite not sure how can I get other apps properties as used in that sample.

Screenshot_2015-09-25-10-55-35.png
Screenshot_2015-09-25-10-55-44.png
Screenshot_2015-09-25-10-56-21.png

Dave Smart

unread,
Sep 25, 2015, 4:14:58 AM9/25/15
to AndroidScript
Hi Durga,

You probably want to send an intent to achieve what you want.  I suggest you search on 'stack overflow' for a Java example of sending intents to the App you are interested in and find out what fields are required.

If you tell us what App you are trying to send to, then you might find that someone else had already done it.

If you want to pop up a list of target App choices, then that is another matter and you might need to request new functionality, although you might be able to achieve the same effect by writing to a text file and using the app.OpenFile() function with the 3rd 'prompt' parameter set to true.

Regards
David

Durga Prasad

unread,
May 7, 2016, 10:31:52 AM5/7/16
to DroidScript
Hi Dave,

I am not sure this has been already available in droidscript now. Just wanted to check again the following.

app.openfile works for txt files and images I have tried.

But howover for images it doesn't show all available options. It shows only few options.

I tried like this

app.OpenFile( "/sdcard/filename.jpg", "image/jpg", "Share Via",true );

Instead of using this option to share files with other apps, is that possible to trigger the default Android share menu. So that user can select the app they want to share.

I am not sure this functionality already exist in droidscript?

Regards,
Durgaprasad.

Gerard Hernandez

unread,
May 8, 2016, 9:15:51 PM5/8/16
to DroidScript
android.intent.action.VIEW, that is the action needed to open most of files in android via intents, the same for share.

Paul Norman

unread,
May 9, 2016, 1:31:04 AM5/9/16
to DroidScript
Steve Garman has kindly opened a Wiki page space to help us store information on useful Intents as they are discovered/defined...

http://wiki.droidscript.me.uk/doku.php?id=intents:start

Siddheshwar

unread,
Oct 2, 2018, 9:07:33 AM10/2/18
to DroidScript
Hi Durga,
Please try this

App.SendText("<url to be shared>");

CHD

unread,
Oct 4, 2018, 10:48:37 PM10/4/18
to DroidScript
app.OpenFile( "/sdcard/filename.jpg", "image/jpg", "Share Via",true );

instead of this ypu can use the following code which will definitely show all the apps which can open the image...

app.OpenFile("/sdcard/filename.jpg");

in my case, it works well...

Reply all
Reply to author
Forward
0 new messages