1

I have an android device which is locked in airplane mode. NFC is still enabled though. How can I program the NFC tag to turn off airplane mode? I don't need alternative solutions, it has to be with an NFC tag.

I have tried {"status":"ok","actions":[{"action":"enable_wifi"},{"action":"setprop"}]}, I can see it's written on the NFC tag, but when I read it with the device, nothing changed.

Tom Shen
  • 1,045
  • 3
  • 11
  • 29
  • 2
    According to this http://stackoverflow.com/questions/5533881/toggle-airplane-mode-in-android it's not possible anymore since Android 4.2 because of security reasons (decision made by Google of course). – Luke Jul 07 '16 at 17:52
  • What about developer mode? Can developer mode be turned on by nfc tag? – Tom Shen Jul 07 '16 at 18:21
  • 1
    You need rooted device for this. You can although open settings with `startActivity` and passing an `Intent` with `android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS` like [here](http://stackoverflow.com/questions/22067055/android-programmaticaly-check-developer-options) – Luke Jul 07 '16 at 18:37

1 Answers1

2

Basically you can write anything to NFC tag and handle each value in your own app. So in general you can do whatever is allowed by Android framework.

Some sort of things are predefined by Android OS to handle. Depending on the type it can perform some actions (connect to wifi, open a browser, open a contact etc.) Check out the official documentationhere.

There are no predefined actions for toggling airplane mode or developers settings. These things are forbidden from the newest regular API.

So if you want to do something specific on tapping NFC tag

Luke
  • 2,539
  • 2
  • 23
  • 40