📜 ⬆️ ⬇️

From Google CardBoard to automatically launch cards in the car

The topic for writing this note was born quite unexpectedly when I received the famous Cardboard from China.
I ordered the cardboard glasses about a month ago, when I saw that enterprising Chinese started producing cheap kits for assembly.
For those who are not yet in the know about glasses: Google engineers, apparently impressed with Oculus Rift, made a cardboard box from a pizza, velcro, lens and magnet box. They also created an API and demo application that generates the correct stereo image. To control, use the magnetic field sensor and gyroscopes phone.

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


I collected the glasses, but I was in no hurry to glue the NFC tag.
Today I had some free time, and I decided to see what can be done with the label. The first idea is to force the application to run when it is brought to the label. It is said - done: NFC ReTag remembered both the label and the fact that it is necessary to launch the cards through the contact with the label. But it turned out that when I put the tag to my Nexus 5, the window for selecting applications that can work with tags is launched. And to establish the default is not possible. Those. either remove all applications except one, or poke every time into this NFC ReTag. Both options are somehow uninteresting: I haven’t memorized the metro scheme yet, and by poking at the screen I could even launch maps without a tag.
After that, I began to look for a way around the problem and came across NFC Tools and NFC Tasks applications.

What impressed me the most was the fact that 137 pieces of telephone can be written into this piece of paper. Here, of course, someone will say that there is such a thing, everyone has long known about it. But one thing is to know, and another thing is this way and write a link to the desired application in a sticker. In general, after recording the link, the cards started to run without any questions. "Class!" - I thought. And wondered - what about the screen lock? After all, perhaps the most difficult thing when starting a card in a car is not to click on the label, but to unlock the screen by entering a pincode. Immediately remembered the project NFCRing. Once there is a ring with a label to unlock, then on Android there is the possibility of such unlocking.
Search programs led me to NFC LockScreenOff Enabler
Xposed Installer is needed for its operation, which in turn installs the Xposed framework on the phone. This framework is considered to be a fairly safe way to customize any firmware. Therefore, in order to complete the venture, I got the root of the right with towelroot and installed the above applications. Putting the label in the list of trusted ones and setting the NFC reading mode only when the screen is on, I received the cherished magic. Now inserting the phone into the car holder the following happens:



If someone knows how to achieve the same effect without getting root rights, I’ll be happy to add an alternative way to the article.

')

Source: https://habr.com/ru/post/233593/


All Articles