From Google CardBoard to auto-launch cards in the car

    The topic for writing this note was born unexpectedly when I received the famous Cardboard from China.
    I ordered cardboard glasses about a month ago, when I saw that enterprising Chinese had launched the production of cheap assembly kits.
    For those who are not yet in the know about glasses: Google engineers, apparently impressed by the Oculus Rift, made glasses into which the phone was inserted from a cardboard box of pizza, Velcro, lenses and magnets. They also created an API and demo application that generates the correct stereo image. A magnetic field sensor and telephone gyroscopes are used for control.

    I collected points just a day ago and have not yet managed to figure out how to control the application using magnets. In my version, the magnets are located only on the central partition (unlike the above picture, where there is a magnet on the side) and somehow contribute little to control. Even having pulled the partition and waving it around the phone, it’s hard to find the movement perceived as a click. The image in focus is obtained only if you move the phone a few millimeters from the desired position. Plus, literally in 20 minutes of testing, a trace of sweat from the forehead appeared on the cardboard. In general, the cardboard turned out to be quite controversial and it will be necessary to try to print more advanced glasses for this business on a 3D printer + to solve the issue with magnets.

    I collected the glasses, but I was in no hurry to glue the NFC tag.
    Today was a bit of free time, and I decided to see what you can do with the label. The first idea is to force the application to start when presented to the label. No sooner said than done: NFC ReTag remembered both the tag and the fact that you need to run cards by contact with the tag. But then it turned out that when I put a tag on my Nexus 5, a window for selecting applications that can work with tags starts. Moreover, it is not possible to establish the default. Those. Either remove all applications except one, or poke each time in this NFC ReTag. Both options are somehow uninteresting: I have not yet memorized the metro map, and by poking at the screen I could start maps without a mark.
    After that, I started looking for a way around the problem and came across NFC Tools and NFC Tasks.

    What impressed me the most was the fact that 137 bytes of the phone can be written to this piece of paper. Here, of course, someone will say what is there, everyone has long known about this. But it’s one thing to know, and another thing to write down a link to the application you need in a sticker. In general, after recording the links, the cards started to run without any questions. “Class!” I thought. And he wondered - what about the screen lock? After all, perhaps the most difficult thing when starting cards in the car is not to click on the shortcut, but to unlock the screen by entering a PIN code. I immediately remembered about the NFCRing project. If there is a ring with a label for unlocking, then Android has the ability to unlock it.
    Search software led me to NFC LockScreenOff Enabler
    For its work, you need the Xposed Installer, which in turn installs the Xposed framework on the phone. This framework is considered a fairly safe way to customize any firmware. Therefore, in order to bring the idea to the end, I got root rights using towelroot and installed the applications described above. Entering the mark in the trusted list and setting the NFC reading mode only when the screen is on, I received the treasured magic. Now, inserting the phone into the car holder, the following occurs:
    • The phone turns on the screen due to wireless charging in the holder.
    • Due to the coincidence of the serial, the device is unlocked.
    • Maps are launched by the link from the tag.

    If someone knows how to achieve the same effect without getting root rights, I will gladly add an alternative path to the article.

    Also popular now: