Android Question Share video via bluethooth

Discussion in 'Android Questions' started by Sasuke Sama, Aug 26, 2019.

  1. Sasuke Sama

    Sasuke Sama Active Member Licensed User

    Hi
    Im trying to share videos via bluethooth or other methodes ( telegram , messenger .. etc)
    im trying this code
    Code:
    Dim index As Int = CLV1.GetItemFromView(Sender)
        ur=
    list.Get(index)
        
    Dim in As Intent
        
    in.Initialize(in.ACTION_SEND, "")
        
    in.SetType("video/*")
        
        
    in.PutExtra("android.intent.extra.STREAM", Starter.Provider.GetFileUri(ur))
        
    in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION
        StartActivity(in)
    but it only workes with text files
    when i set the in.SetType("video/*") to any thing other than text it doesnt work
    any ideas?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    What happens if you remove the mime type?
     
  3. Sasuke Sama

    Sasuke Sama Active Member Licensed User

    Code:
    Error occurred on line: 453 (Main)
    java.lang.SecurityException: Permission Denial: starting 
    Intent { act=android.intent.action.SEND flg=0x20001 cmp=com.viber.voip/.messages.ui.forward.ForwardActivity clip={null U:content://seven.zero.nvp.provider/name/storage/emulated/0/ADM/357742d1633dab655d2a557SD.mp4} (has extras) } from ProcessRecord{2f5aac5 31976:seven.zero.nvp/u0a803} (pid=31976, uid=10803) not exported from uid 10166
        at android.os.Parcel.createException(Parcel.java:1953)
        at android.os.Parcel.readException(Parcel.java:1921)
        at android.os.Parcel.readException(Parcel.java:1871)
        at android.app.IActivityManager$Stub$Proxy.startActivity(IActivityManager.java:3701)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1675)
        at android.app.Activity.startActivityForResult(Activity.java:4651)
        at android.app.Activity.startActivityForResult(Activity.java:4609)
        at android.app.Activity.startActivity(Activity.java:4970)
        at android.app.Activity.startActivity(Activity.java:4938)
        at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:859)
        at seven.zero.nvp.main._delete_click(main.java:1356)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
        at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
        at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
        at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
        at android.view.View.performClick(View.java:6614)
        at android.view.View.performClickInternal(View.java:6591)
        at android.view.View.access$3100(View.java:786)
        at android.view.View$PerformClick.run(View.java:25948)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6806)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
    Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.am.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1861)
        at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:751)
        at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:552)
        at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:1214)
        at com.android.server.am.ActivityStarter.execute(ActivityStarter.java:494)
    without removing it the share dialog opens but whatever app i chose to share with it says media is not supported
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Try to set the type to: file/*
     
  5. Sasuke Sama

    Sasuke Sama Active Member Licensed User

    same not supported message
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Try to find a Java solution and we will help you port it. Not sure that it is possible.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice