Today, I’m gonna share about a simple Android Developer tips to help testers and developers in developing their datacore related app.
DataCore app means app that requires online connection to sync and push data.
For this tip to work, we will need the following.
- Android 4 NFC enabled phone/tablet.
- A standard readonly / free NFC nDEF card (in Malaysia our TouchNGo or even our IDCard is suffice). To check if the card/tag has NFC NDef simply touch it behind the phone and you will hear some beep tone playing.
- Wifi hotspot or router environment setup with Internet Access.
- A simple jamming device to jam wifi and 3G signal thus dropping the line and simulate a no connection scenario.
- Write some script to disable internet connection over some given interval time.
- Or do it the simple way – pull down the settings shortcut above and switch the phone to airplane mode during the test.
- Download an app called Trigger here (This is the main app that will do alot of NFC based automation)
- Then download it’s plugin app called Trigger for Reuse Tags (This plugin allows the app to relate a task with a readonly card/ tag).
- Make sure NFC is enable on your Android Device.
- Launch Trigger and Create a new Task (tap the + NEW TASK).
- Setup trigger to NFC by press + and select NFC. Tap Next To select an Action.
- Add Actions by tapping +, Choose Wireless & Networks. For this case, let’s make an automated seemless wifi toggler. Select Wifi On/Off. And Select Next
- When prompted Configure Action, select for Toggle instead of Enable. Tap OK.
- Name this Task (Instead of Task #) something meaningful just above the Next Button. Let’s called it Wifi Toggler. Tap on Next
- The next screen is optional, for our simple toggler case, we dont need a additional action for it. Tap Done to proceed with assigning the related tag.
- When prompted to place the tag for recognition. Simply place your card at the bottom top of the phone / tablet. You will get an indication of the app saying Could not Write to this tag but still it will work due to the plugin installed (2). To Save, tap the Done button at the left hand corner. Exit the app and give it a try, you can now toggle wifi on/off at your wish simply by touching the card at the phone.
BEST Part, you can now simulate a disconnect scenario without doing any other stuff. Just move the device you are testing with the card. BEEP Wifi instant disconnect!!! Simple and yet neat!