View Single Post
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#978
I found out a better way to use an NFC tag on my car holder than explained here.

My aim was to put my phone on my car holder (on which I put an NFC sticker on) and have it automatically switch BT on, pair with my Belkin CarAudio Connect and start some apps. Once I'd remove the phone from the cradle, BT would switch off and the apps would close.

I got this working with the previous setup but it was a little flakey at times. Most of the time my phone wouldn't connect automatically to the Belkin even though it should have. I had to press the button on the Belkin to pair it. Also, the annoying popup for NFC had to be dismissed every time. The scripts and BT switching worked reliably.

Here's a much better way:
  • Get NFC Tag Writer from the store and use the "Write Bluetooth Audio Tag"-wizard to write a unique tag for the audio device you're going to be using. Place that tag on your car holder so that it will be under the NFC antenna of the N9 when it's in the cradle. The tag will turn on BT and pair your (or anyone elses) N9 with the audio device. Don't use ProfileMatic's BT actions.
  • In ProfileMatic, create a new rule that has an NFC-condition and Custom Action. NFC condition should be for the tag you just created, so tap your phone on the tag. Leave the toggle condition off, so that this rule is active only when the phone is near the tag (i.e. the phone is in the cradle.)
  • For Custom action on rule activate (i.e. phone is put in the cradle) you can start some apps with a script explained here.
  • For Custom action on rule deactivate (i.e. phone is taken out of the cradle) you can kill those apps with:

    Code:
    killall app1 app2 app3
    where app# is the name of the process you want to kill.

    You probably want to also turn off BT at the same time. A nice way to do that, is to install Toggle BT and add to your app killer script:

    Code:
    xdg-open /usr/share/applications/toggleBT_harmattan.desktop
    For example, my start and stop scripts look like this:

    Start:
    Code:
    #!/bin/sh
    xdg-open /usr/share/applications/music-suite.desktop
    xdg-open /usr/share/applications/meegotouchhome-incar_harmattan.desktop
    Stop:
    Code:
    #!/bin/sh
    killall meegotouchhome-incar drive-qml music-suite
    xdg-open /usr/share/applications/toggleBT_harmattan.desktop

That's it! No more annoying popups and reliable automatic connecting to my BT device.
 

The Following 2 Users Say Thank You to slarti For This Useful Post: