B4A Library Share Library - Beta!

Hi folks,

This has been raised many times on the forum, unfortunately the intent library in B4A seems to have problems placing images as attachment.

Please find attached a new share library.

This library has the option to show the share window, and I've tested it works with following:

Facebook
Twitter
Messaging
Picasa
WhatsApp
Email client

It does not work with the default GMail (Google Mail) app. I've searched online and it is an issue with GMail app itself I think (many people have raised similar issue). Will keep looking for a solution.

It also lessens down the share code for images to 2 lines :D

I need your help in testing this library!

Please feedback whether it works or not.

Sample code:

B4X:
Dim share As MESShareLibrary
share.sharebinary("file:/" & File.DirDefaultExternal & "/Image1.png", "image/png", "Do you see this?")

Enjoy!

-Bill
 

Attachments

  • MESShareLibrary.zip
    2.5 KB · Views: 1,990
Last edited:

FJS

Active Member
Licensed User
Longtime User
Good night,

Sorry but it doesnt work...
with the following code:
B4X:
Dim share As MESShareLibrary
share.sharebinary("file://" & File.DirDefaultExternal & "/bs_logo.png", "image/jpg","game", "game: they are iqual" & score)

I would like to share a picture, a text, a score (integer)

Could you tell me whay it doesnt work?

Thank you very much

Best regards
 

Douglas Farias

Expert
Licensed User
Longtime User
/bs_logo.png you need put
image/png <<<<<
 

FJS

Active Member
Licensed User
Longtime User
Sorry, but I changed that, but it doesnt work

Is there any updating of this librery?, is there any other librery about share??

Thank in advance
 

Douglas Farias

Expert
Licensed User
Longtime User
i use this in my app
B4X:
FP = File.DirDefaultExternal

share.sharebinary( "file://" & FP & "/QRCODELIKE.png","image/png", "Compartilhe", "Olá, este é meu QR CODE, quer fazer o seu ? baixe agora mesmo o aplicativo QR CODES da Like Apps - WWW.LIKEAPPS.NET")
 

hookshy

Well-Known Member
Licensed User
Longtime User
crashed on device here: https://www.dropbox.com/s/rxyebmx5q278ygg/share_pressed.txt
Could be this related to messharelibrary ?
Error came up after pressing the button sharring a wav file .
Is the code bellow correct ?
The code works just fine sending wav files to whatapp ,gmail,yahoo
B4X:
Dim share As MESShareLibrary
share.sharebinary("file://" & File.DirDefaultExternal & "/"&filename, "audio/wav", "Share recording", "")
 

diego

Member
Licensed User
Longtime User
Thanks for this library. In the method:

B4X:
 sharebinary (p_path As String, p_type As String, p_msg As String, p_textval As String)

could you tell me the different values for p_type?
audio/<extension>
image/<extension>
...
¿what more?
 

Douglas Farias

Expert
Licensed User
Longtime User
any chance to update this lib? i think this is the most important lib for marketing on this forum
 

base64

Member
Licensed User
Longtime User
Question:
My app shares jpeg images, and is able to receive jpeg images from other app.
So when I call share.sharebinary(...) in my app, my app is shown as one of the target apps.

How do I exclude my own app from the choices of app receiving the image?

If it's not possible to this with this library, how do I do this with intent?
 

Shahid Saeed

Active Member
Licensed User
Longtime User
@ssg thanks for this great library, is there anyway to share link or text instead of image file, like me many others are already asking for the similar question?
 

ibra939

Active Member
Licensed User
Longtime User
Hi folks,

This has been raised many times on the forum, unfortunately the intent library in B4A seems to have problems placing images as attachment.

Please find attached a new share library.

This library has the option to show the share window, and I've tested it works with following:

Facebook
Twitter
Messaging
Picasa
WhatsApp
Email client

It does not work with the default GMail (Google Mail) app. I've searched online and it is an issue with GMail app itself I think (many people have raised similar issue). Will keep looking for a solution.

It also lessens down the share code for images to 2 lines :D

I need your help in testing this library!

Please feedback whether it works or not.

Sample code:

B4X:
Dim share As MESShareLibrary
share.sharebinary("file:/" & File.DirDefaultExternal & "/Image1.png", "image/png", "Do you see this?")

Enjoy!

-Bill


I test the code with littel change ............but the problem is not share for facebook or whatapp or other ?
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
I'll try this with an html page. I"d like to share it with an email or post it on facebook.
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Great, it gave me a few options: evernote, email, gmail, drive... no facebook.

What is the last parameter ? p_textval

Sent it as a gmail attachment no problems.
 

tagwato

Member
Licensed User
Longtime User
Thanks @ssg !
Summary of my tests:
- Gmail/mail: ok
- Whatsup: ok
- Evernote: ok
- Google+: ok
- Hangout: ok
- Facebook: only image, no text
- Phone default sms apk: only image, no text

Please, if someone managed to send Text + Image to FaceBook, post the solution here!

(See test project attached)
 

Attachments

  • TestShareWithLib.zip
    7.9 KB · Views: 340
Last edited:
Top