Share list question

pluton

Active Member
Licensed User
Longtime User
Hi Erel and others

How will i call default share list (Facebook, Twitter, Email, Gmail and other apps which show in user list) - see picture

1672xxu.png


I have a some string test = "One, two, three, four fox jump over"

And I want when i press btnShare to show that default list and share that my string over app which will user choose.

Is it possible :sign0085:
 

ozgureffe

Member
Licensed User
Longtime User
Sharing image files?

What about sharing a PNG image file, created by my application and stored in sdcard?
 
Upvote 0

avnersh

Member
Licensed User
Longtime User
PutExtra in facebook

Hi erel

I'm using the code you put here ,and its working good with email (thank u)but with facebook it is not. the field in the facebook interface contain the default facebook text "Write somthing..."
please help me

B4X:
   Dim i As Intent
   i.Initialize(i.ACTION_SEND, "")
   i.SetType("text/plain")
   i.PutExtra("android.intent.extra.TEXT", "some text")
   i.WrapAsIntentChooser("title")
   StartActivity(i)
[/code

Avner
 
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
I have also tested this in the past, and it worked with:

Gmail
Text/Sms
Email

I couldn't get it to pass the data to Facebook
But I am sure it's possible with the correct Intent syntax
Also very needed:D
 
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User

After further testing (few hours)


This is the best and quickest way to Share a link to facebook
from within your app:
B4X:
Dim TheUrl as string
TheUrl = "http://www.ibm.com"

 Dim i As Intent
    i.Initialize(i.ACTION_VIEW, "http://m.facebook.com/sharer.php?u=" & TheURL)
   i.SetType("text/plain")
   i.PutExtra("android.intent.extra.TEXT", TheUrl)
    i.WrapAsIntentChooser("Open browser")
    StartActivity(i)

You can find people online talking about passing the parameter for TEXT
But that doesn't work at all.



So your thinking, why/how could I use this?

Add a Menu item, "Share My App" or "Share on Facebook"
then replace TheURL above with either your website link
or your direct link to your android market app page

This will really multiply your downloads because the people using your app
will be promoting your link easily now, to their 100 to 2000 friends on their
own facebook wall...
 
Last edited:
Upvote 0

avnersh

Member
Licensed User
Longtime User
Hi, thank you for the efforts, I'm still looking for the simple way to share text vie facebook . for now I will adoped your idea but if someone has any
suggestion about passing parameter for text in facebook i will be grateful.
Avner
 
Upvote 0

xor83

Member
Licensed User
Longtime User
How can I add my app in share list? and how can I capture share content after someone select my app for sharing

plz help
 
Upvote 0

sasetcolombia

Member
Licensed User
Longtime User
hi!
It depends on what you are trying to share. To share text you can use:
B4X:
   Dim i As Intent
   i.Initialize(i.ACTION_SEND, "")
   i.SetType("text/plain")
   i.PutExtra("android.intent.extra.TEXT", "some text")
   i.WrapAsIntentChooser("title")
   StartActivity(i)

Hi!
How to detect which option was used to share the text?
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
It depends on what you are trying to share. To share text you can use:
B4X:
   Dim i As Intent
   i.Initialize(i.ACTION_SEND, "")
   i.SetType("text/plain")
   i.PutExtra("android.intent.extra.TEXT", "some text")
   i.WrapAsIntentChooser("title")
   StartActivity(i)

i tried to do this with image and text not sharing

Sub btn_share_ClickDim share AsMESShareLibrary
share.sharebinary("file://" & File.DirDefaultExternal & "/csa_logo1.jpg", "image/png", "Share the love!", "This is the text to go in the body!")End Sub
 
Upvote 0
Top