Bleutooth Handsfree control

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can add the following intent filter with the manifest editor:
B4X:
AddActivityText(main,  <intent-filter android:priority="1000">
        <action android:name="android.intent.action.VOICE_COMMAND" />
      <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
)
You should then call Activity.GetStartingIntent in Activity_Resume and check the intent action type.
 
Upvote 0

tamayo461

Member
Licensed User
Longtime User
and add the code but do not understand the message I take to start the app:

android.intent.action.MAIN
android.intet.category.LAUNCHER

THIS NO DETECT BUTTON HEADSET BLUETOOTH excuse my ignorance, I've never worked with Intents and I'm new with B4A.
 
Upvote 0

tamayo461

Member
Licensed User
Longtime User
** Activity (main) Pause, UserClosed = true **
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
** Activity (main) Create, isFirst = false **
(Main, 63) FullScreen or IncludeTitle properties in layout file do not match the activity attributes settings. (warning #1004)
(Main, 63) FullScreen or IncludeTitle properties in layout file do not match the activity attributes settings. (warning #1004)
** Activity (main) Resume **
** Activity (main) Resume **
(Intent) Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=anywheresoftware.b4a.samples.gps/.main bnds=[240,485][360,620] }
(Intent) Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=anywheresoftware.b4a.samples.gps/.main bnds=[240,485][360,620] }


...not seem to capture the event. :(
 
Upvote 0

tamayo461

Member
Licensed User
Longtime User
Thanks Erel, voice commands were active, and my program Reconce the event:

(Intent) Intent {act = android.intent.action.VOICE_COMMAND flg = 0x10000000 cmp = anywheresoftware.b4a.samples.gps/.main (has extras)}

;)
 
Upvote 0
Top