V
V
vladymyr_olegovich2016-08-04 18:55:37
Java
vladymyr_olegovich, 2016-08-04 18:55:37

How to open an application via NFC?

I have an android application built using Cordova.
The android manifest has an application id (package) of the form "com.textid" .
I need to use nfc to open this application if the nfc tag says "com.textid" .
As I understand it, you need to somehow configure "android: scheme". Can you tell me if this is possible and if so, how?

<intent-filter>
        <action android:name="android.nfc.action.NDEF_DISCOVERED" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="text/plain" android:scheme="com.textid" />
</intent-filter>

____________________________
I found a solution, it turned out to be very simple:
<intent-filter>
    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="application/com.textid" />
</intent-filter>

If the application is not installed, it is searched for in google play.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Y
Yuri Chudnovsky, 2016-08-04
@Frankenstine

For security reasons, Android itself will not launch programs by tags. But there are tons of third party apps that do this, like https://play.google.com/store/apps/details?id=com....

D
Denis Zagaevsky, 2016-08-04
@zagayevskiy

Read the documentation , ask specific questions. There is no rocket science there. Starts with half a kick.

D
Daniel4, 2016-08-06
@Daniel4

One person was passionately interested in encryption under the guise of an IT security developer and created a crypto-ransomware.
Now someone wants the application to open through nfs. What if the victim has a root - khan to all data. This is really a security issue.

A
Alexander Kislinsky, 2016-08-13
@Luonic

Create a background service that will be launched at system startup and look at what information was contained in the label read, if it matches the format, it will open the application

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question