Bluetooth GPS app, external GPS antenna and send intent

882 views
Skip to first unread message

ktmom

unread,
Sep 7, 2012, 6:02:54 PM9/7/12
to tas...@googlegroups.com
I'm using an app Bluetooth GPS to force a connection to my external antenna and it works fine run from the app's widget.

Now I want to make use of the intent available with the app so I can use Tasker to force the connection and then launch a car mode task.  The information on the intent available on the app's Play page is;

Now you can start/stop the service from other apps by sending the service or broadcast Intent :

Start - googoo.android.btgps.action.SERVICE_START
Stop - googoo.android.btgps.action.SERVICE_STOP
Toggle - googoo.android.btgps.action.SERIVCE_TOGGLE

So I set-up an intent:

Send Intent [ Action:googoo.android.btgps.action.SERVICE_START Cat:Default Mime Type: Data: Extra: Extra: Package: Class: Target:Broadcast Receiver ]

I also tried it as a service in the target.

Am I going about this wrong?

Sinan Ghareb

unread,
Sep 7, 2012, 6:48:29 PM9/7/12
to tas...@googlegroups.com
Try this one, its free and has Tasker plugin.
I hope it works for you:

https://play.google.com/store/apps/details?id=de.refluxa.android.bac&hl=en

Elizabeth Laughlin

unread,
Sep 7, 2012, 7:03:46 PM9/7/12
to tas...@googlegroups.com

I'll give it a shot.  Thanks.

Elizabeth Laughlin

unread,
Sep 7, 2012, 7:36:16 PM9/7/12
to tas...@googlegroups.com

That app won't (doesn't) work for a couple of reasons: 
1) I'm on ICS (cm9) and
That2) it only forces a connection, the original app I linked makes the connection and handles the mock location for the antenna.

Maybe someone could help me with the intent?

Matt R

unread,
Sep 7, 2012, 7:43:47 PM9/7/12
to tas...@googlegroups.com
I'm definitely no intent expert, but you could try different categories and/or mime types (or contact the other app's developer to see if they can provide them).  May also require a package or class.
 
Matt

Sinan Ghareb

unread,
Sep 7, 2012, 11:48:43 PM9/7/12
to tas...@googlegroups.com
Hi,


"Now I want to make use of the intent available with the app so I can use Tasker to force the connection and then launch a car mode task"

thats exactly what this app allowed me to do, force connect to a bluetooth device.
I'm on CM9 as well and it worked for my HP Touchpad.

What you can do is use this app to force the connection, and have a context to check if bluetooth is connect then run some task.

I also have the bluetooth gps app, but as you know it needs interaction with it in order for the connection to work (you need to select the BT device and then tap
connect)

This one didn't need that. Maybe for your specific situation you need a different functionality. I was hoping this would help.

Sinan

Sinan Ghareb

unread,
Sep 9, 2012, 3:39:16 AM9/9/12
to tas...@googlegroups.com
I'm sad to report this stopped working today :(

I will have to keep trying/debugging to see how I can achieve the force connection to bluetooth device.
This is ridiculous! this should be easy and not so hard to accomplish !

Sinan 

ktmom

unread,
Sep 9, 2012, 5:02:38 PM9/9/12
to tas...@googlegroups.com
I have a version working.  But first, I want to keep the internal GPS as the default so I don't want to change the Settings -> Location Services -> GPS source to anything but the internal.  To make the Bluetooth Autoconnect app work, that's what I had to do.  Works great if you are willing to use only the external GPS, but if I'm not in my car, I want to use the internal GPS without any manual intervention. I am not aware of a way to programmatically change the GPS source, although I thought I ask on this forum.  Maybe it can be done under Java.

So that leaves a helper app to make the connection for me without using the internal GPS service.  I settled on the free Bluetooth GPS app because the developer added several intents which would allow tasker to trigger it's service and shut it down.  From my first post, all that was "wrong" was the Cat:Default should be Cat:None.  Now I can launch the service for Bluetooth GPS which does the work.  For any of the following to work, you must be able to connect through the app itself and have all of the settings figured out first.  If it doesn't work directly launching Bluetooth GPS, it will not work by calling the service.

Next problem for me, and I gather by reading the web, for many people regardless what external antenna helper app they are using, the connection fails multiple times with a service discovery error before you can actually make the connection. This is reflected in needing to tap the app widget (or connect button inside the app) several times before getting the connection.  So, I set-up a loop that mimics this behaviour and as of today, have been able to get wait times in my loop configured that allow a connection every time I launch the task.  It does run through the loop multiple times before succeeding.  I have a separate profile that monitors the connect status to help with this process.  While it's kludgy, the following has been working for me with a TomTom external GPS antenna, Sprint Epic 4g and ICS (CM9). 

<sidebar> That TomTom antenna dates back to the Palm Lifedrive. </sidebar>

Profile: Car Dock (2)
  Event: Button: Long Search
  State: Power [ Source:Any ]
      Enter: Car Dock (113)
A1: Bluetooth [ Set:On ]
A2: Popup [ Title:Bluetooth GPS Text:Make sure the external antenna is turned on! Background Image: Layout:Popup Timeout (Seconds):5 Show Over Keyguard:On ] // I had issues remembering to turn on the silly thing
<intent>
A3: Send Intent [ Action:googoo.android.btgps.action.SERVICE_START Cat:None Mime Type: Data: Extra: Extra: Package: Class: Target:Broadcast Receiver ]
A4: Wait [ MS:0 Seconds:7 Minutes:0 Hours:0 Days:0 ]
A5: Goto [ Type:Action Label Number:2 Label:intent ] If [ %extGPS !~ connected ]
A6: Wait [ MS:0 Seconds:20 Minutes:0 Hours:0 Days:0 ]
A7: Goto [ Type:Action Label Number:1 Label:intent ] If [ %extGPS !~ connected ]
A8: Variable Set [ Name:%carDock To:true Do Maths:Off Append:Off ]

Profile: External GPS (60)
  State: Bluetooth Connected [ Name:* Address:00:00:00:00:00:00 ] // actual mac address or use the name field whatever
      Enter: Anon (61)
A1: Variable Set [ Name:%extGPS To:connected Do Maths:Off Append:Off ]
A2: Flash [ Text:Ext GPS = %extGPS Long:On ]
     Exit: Anon (109)
A1: Variable Set [ Name:%extGPS To:disconnected Do Maths:Off Append:Off ]


David Graver

unread,
Aug 22, 2015, 8:31:10 AM8/22/15
to Tasker
Just wanted to let you know, 3 years  later, this helped me so much. I was looking for this exact solution and you were the only 1 on the internet with an answer. Just saying thanks!

Elizabeth Laughlin

unread,
Aug 22, 2015, 8:34:46 AM8/22/15
to tas...@googlegroups.com

Well how cool is that!  Thanks for letting me know.  I'm still using that setup on a nexus 6.

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/HyFpAZ_jWz4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages