brelto85 Active Member Licensed User Longtime User Mar 30, 2013 #1 After my post, i need to determinate if the bluetooth headset is connected looking for the internet i found the isBluetoothScoOn() method: Code: Sub IsBluetoothHeadsetOn As Boolean Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "audio", "java.lang.String") Return r.RunMethod("isBluetoothScoOn") End Sub but this method not works on my phone and in this link explains that this feature works only on rooted devices There are other solutions? someone has tested? thanks alberto
After my post, i need to determinate if the bluetooth headset is connected looking for the internet i found the isBluetoothScoOn() method: Code: Sub IsBluetoothHeadsetOn As Boolean Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "audio", "java.lang.String") Return r.RunMethod("isBluetoothScoOn") End Sub but this method not works on my phone and in this link explains that this feature works only on rooted devices There are other solutions? someone has tested? thanks alberto
Erel B4X founder Staff member Licensed User Longtime User Apr 5, 2013 #21 Note that this event is only available in Android 4+. You will not be able to get the immediate result (because of the "sticky" intent) without writing a small library. You can however add an intent filter and track the events. Again, it doesn't matter whether your application is running or not. The process will be started when the event fires. Upvote 0
Note that this event is only available in Android 4+. You will not be able to get the immediate result (because of the "sticky" intent) without writing a small library. You can however add an intent filter and track the events. Again, it doesn't matter whether your application is running or not. The process will be started when the event fires.
brelto85 Active Member Licensed User Longtime User Apr 5, 2013 #22 Erel, now i understand what you meant when you wrote that the recorded intent is executed even if the application is not active Anyway, the first time you install the application and the first time runs, nothing will be recorded until connect or disconnect the bluetooth headset. I ask at this point: 1. is there a way to force the disconnect and reconnect the Bluetooth headset? 2. there is a type "ACTION_ACL_CONNECTED" but only intercepts the type bluetooth headset and not all bluetooth devices? 3. when you run the intent (especially when the application is not active), how can i save the state of bluetooth headset? through the StateManager? thanks Upvote 0
Erel, now i understand what you meant when you wrote that the recorded intent is executed even if the application is not active Anyway, the first time you install the application and the first time runs, nothing will be recorded until connect or disconnect the bluetooth headset. I ask at this point: 1. is there a way to force the disconnect and reconnect the Bluetooth headset? 2. there is a type "ACTION_ACL_CONNECTED" but only intercepts the type bluetooth headset and not all bluetooth devices? 3. when you run the intent (especially when the application is not active), how can i save the state of bluetooth headset? through the StateManager? thanks
Erel B4X founder Staff member Licensed User Longtime User Apr 5, 2013 #23 1. Probably not. 2. You can listen to the other intent in Android 4+. 3. You can use StateManager.SetSetting and then StateManager.SaveSettings. There are other possible ways. Upvote 0
1. Probably not. 2. You can listen to the other intent in Android 4+. 3. You can use StateManager.SetSetting and then StateManager.SaveSettings. There are other possible ways.
brelto85 Active Member Licensed User Longtime User Apr 5, 2013 #24 1. Ok 2. For example? i need an Intent that works for all android versions 3. Then StateManager works also if the application is not running? Upvote 0
1. Ok 2. For example? i need an Intent that works for all android versions 3. Then StateManager works also if the application is not running?
Erel B4X founder Staff member Licensed User Longtime User Apr 6, 2013 #26 Please do not "bump" threads. As far as I know the only intents available on all Android devices is the ACL connected / disconnected intents. Then StateManager works also if the application is not running? Click to expand... As I wrote about 5 times in this thread the process will start when the intent is received. While the activity will not be displayed the application will actually run. Upvote 0
Please do not "bump" threads. As far as I know the only intents available on all Android devices is the ACL connected / disconnected intents. Then StateManager works also if the application is not running? Click to expand... As I wrote about 5 times in this thread the process will start when the intent is received. While the activity will not be displayed the application will actually run.