raphipps2002 Active Member Licensed User Longtime User Mar 4, 2018 #1 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? Code: Copy 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
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? Code: Copy 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
Erel B4X founder Staff member Licensed User Longtime User Mar 5, 2018 #2 Have you added this permission: android.permission.MODIFY_AUDIO_SETTINGS ? Upvote 0
raphipps2002 Active Member Licensed User Longtime User Mar 5, 2018 #3 No i havent...but i dont know how. Can you please explain how i do this Thank you Richard Upvote 0
Peter Simpson Expert Licensed User Longtime User Mar 5, 2018 #4 Add the following line to your manifest file. Code: Copy AddPermission(android.permission.MODIFY_AUDIO_SETTINGS) Enjoy... Upvote 0
Add the following line to your manifest file. Code: Copy AddPermission(android.permission.MODIFY_AUDIO_SETTINGS) Enjoy...
raphipps2002 Active Member Licensed User Longtime User Mar 5, 2018 #5 thanks so I added this as suggested..sadly no change...the speak does not come on. Code: Copy '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.b4x.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 Code: Copy 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 Upvote 0
thanks so I added this as suggested..sadly no change...the speak does not come on. Code: Copy '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.b4x.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 Code: Copy 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
Erel B4X founder Staff member Licensed User Longtime User Mar 6, 2018 #6 I guess that the phone app itself changes the audio routing. Upvote 0