Android Question Making call with speaker on

raphipps2002

Active Member
Licensed User
There was a thread about this which offered the following code

I tried on my Samsung S4 the following but the speaker does NOT come on...Any ideas how to fix this?

B4X:
StartActivity(PCall.Call("xxxxxxxxxxx"))
               
  Dim rr As Reflector

rr.Target = rr.GetContent

 rr.Target = rr.RunMethod2("getSystemService", "audio", "java.lang.String")

 rr.RunMethod2("setSpeakerphoneOn", True, "java.lang.boolean")
thanks
 

raphipps2002

Active Member
Licensed User
No i havent...but i dont know how. Can you please explain how i do this

Thank you

Richard
 

raphipps2002

Active Member
Licensed User
thanks so I added this as suggested..sadly no change...the speak does not come on.

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.basic4ppc.com/forum/showthread.php?p=78136

AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
    
AddPermission(android.permission.MODIFY_AUDIO_SETTINGS)   
    
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
And the code is

B4X:
StartActivity(PCall.Call("xxxxxxxxxxx"))
                
                Dim rr As Reflector
                rr.Target = rr.GetContext
                rr.Target = rr.RunMethod2("getSystemService", "audio", "java.lang.String")
                rr.RunMethod2("setSpeakerphoneOn", True, "java.lang.boolean")
Phone calls but no speaker again :(

Richard
 
Top