INTENT ID (Share intents and anothers important Intents)

karyadi

Member
Licensed User
Longtime User
Hi all,

i try to intent to share image
using this code
B4X:
Sub ImageView5_Click
    'facebook
    If File.Exists(File.DirRootExternal, "temp.png") = True Then
        clipb.setText("#URBANGIGS #GENERATION_G #THEINTERNS_"& Main.USERNAME &" @_GENERATION_G")
        If INTENT.ShareImage_Facebook(File.DirRootExternal, "temp.png") = False Then
            ProgressDialogShow("Error On Facebook")
        End If
    Else
        ProgressDialogShow("No Picture Files")
    End If
End Sub

but when i click it, it's allways error
B4X:
Error occurred on line: 209 (menu4b)
java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.BA.setLastException(java.lang.Exception)' on a null object reference
    at b4a.example.intentid._shareimage_facebook(intentid.java:1043)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
    at android.view.View.performClick(View.java:5204)
    at android.view.View$PerformClick.run(View.java:21153)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5480)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
** Activity (main) Resume **

can anyone help me?

thanks
 

ilpesce

Member
Licensed User
Longtime User
Thanks for the great work
I'm trying this useful library, I encountered a problem with "ShareFile_GoogleDrive", let me explain
using a Samsung device, Ver.1.3 works, ver.1.2 not working
using a huawei device, ver.1.2 works, Ver.1.3 is not working ???
if you have a time please fix it
greetings and thanks again
 

bjf

Member
Licensed User
Longtime User
Fantastic work!
Any chance of adding Skype for business (former lync)?
 
Last edited:

analizer3816

Member
Licensed User
Longtime User
I found a problem is when I share text or textandimage
it shows app list for sharing only first time
when I share it next time, it show last sharing app always
 

rafaelbr20

Member
Licensed User
Longtime User
Hi Everyone !

I´m testing this 2 intents and it is not working .... i get a white screen

INTENT.OpenApp_GooglePlay("anywheresoftware.b4a.b4abridge")
INTENT.OpenCompany_GooglePlay("ID+Desenvolvimento")

Someone can help me ?

Thanks
 

analizer3816

Member
Licensed User
Longtime User
Hi Everyone !

I´m testing this 2 intents and it is not working .... i get a white screen

INTENT.OpenApp_GooglePlay("anywheresoftware.b4a.b4abridge")
INTENT.OpenCompany_GooglePlay("ID+Desenvolvimento")

Someone can help me ?

Thanks

I use this code for redirect to my app in playstore (xxx.yyy is app's package name)

B4X:
        Dim market As Intent, uri As String
        uri="market://details?id=xxx.yyy"
        market.Initialize(market.ACTION_VIEW,uri)
        StartActivity(market)

and use this code for open my company(show my all app in playstore) (xxx is company name)

B4X:
        Dim market As Intent, uri As String
        uri="market://search?q=xxx"
        market.Initialize(market.ACTION_VIEW,uri)
        StartActivity(market)
 

Almora

Active Member
Licensed User
Longtime User
hi..
image share


ShareImage_WhatsApp (folder As String, imagefile As String) As Boolean

SHARE IMAGE ON WHATSAPP
File.DirDefaultExternal OU File.DirRootExternal


B4X:
INTENT.ShareImage_WhatsApp(File.DirRootExternal, "xx.jpg")

This code is not working. Where am I making mistakes.
 

rafaelbr20

Member
Licensed User
Longtime User

Thanks so Much ! I use this code also, but i would like to use INTENT ID Library !
 

Douglas Farias

Expert
Licensed User
Longtime User
Hi all, i will try update this lib today to fix all errors.
i will add a scan to show the correct list of intents based on app installeds and the versions.
 

kostefar

Active Member
Licensed User
Longtime User
Hi all, i will try update this lib today to fix all errors.
i will add a scan to show the correct list of intents based on app installeds and the versions.

What a beautiful piece of work!

Can any of these be used to set up a video/voicechat using hangouts,skype etc? I only found sharing of video files.
 

FrankDev

Active Member
Licensed User
Longtime User
hi

tested the 'demo' and lib 1.3
in every case i have the following error

java.lang.NullPointerException: Attempt to read from field 'java.lang.ref.WeakReference anywheresoftware.b4a.BA$SharedProcessBA.activityBA' on a null object reference

but this is not the only lib from Douglas i have problems.
Maybe there is settings problem ?

i use
b4a 7.01
Android\android-sdk\platforms\android-25\android.jar


regards Frank
 

GEoffT

Member
Licensed User
Longtime User
i am having the same problem
 

Almora

Active Member
Licensed User
Longtime User
hi..
Have you solved this problem?
 

Douglas Farias

Expert
Licensed User
Longtime User
Hi all.
i made one update.
Unfortunately I had to remove several direct intents for applications.

Lib 1.4 Functions



Example of use (Share image on SNAPCHAT)
B4X:
    'GET THE LIST OF APPLICATIONS THAT CAN SHARE IMAGE
    Private containsSnapChat As Boolean = False
    Private snapIntent As String
    Private l As List = intent.GetImage_Intents(File.DirAssets,"14-29.jpg")
    For i = 0 To l.Size - 1
        Private s As String = l.Get(i)
        If s.Contains("com.snapchat.android") Then 'CHECK FOR SNAPCHAT APP
            containsSnapChat = True
            snapIntent = s
        End If
    Next
 
    'SHARE IMAGE ON SNAPCHAT IF SNAPCHAT APP ACCEPT IMAGES
    If containsSnapChat = True Then
        intent.ShareImageOn_Intent(File.DirAssets,"14-29.jpg",snapIntent)
    End If

this code above will check if snapchat app is installed and if this allow receive image via intent.

Another way to share on snapchat now is (1 line only)
B4X:
intent.ShareImageOn_Intent(File.DirAssets,"14-29.jpg","com.snapchat.android")



Another example (Share Audio on WhatsApp)
B4X:
intent.ShareAudioOn_Intent(File.DirAssets,"audio.mp3","com.whatsapp")

just put a package name of app and its done.

Now the files can be in assets

EXAMPLE DOWNLOAD

Any bug, feel free to let me know.
thx
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
How can i open the Dialog? So the user can choose the app?

if i use this:

B4X:
Private intent As INTENTID
If intent.IsInitialized = False Then intent.Initialize
intent.ShareImage(File.DirInternalCache,"mypic.png")
then it open every time snapchat.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…