Tips for Testing Connectivity Apps on Android

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.
In normal cases, dealing and handling datacore information requires a “disconnect” event handling test. This is where tester will either use the following :
  1. A simple jamming device to jam wifi and 3G signal thus dropping the line and simulate a no connection scenario.
  2. Write some script to disable internet connection over some given interval time.
  3. Or do it the simple way – pull down the settings shortcut above and switch the phone to airplane mode during the test.
I found out that this process of testing is not only obstructive and is not very efficient. Fortunately, I found a simpler and neater way of testing using whatever we have around us. Here is my steps I setup around my workplace.
  1. Download an app called Trigger here (This is the main app that will do alot of NFC based automation)
  2. 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).
  3. Make sure NFC is enable on your Android Device.
  4. Launch Trigger and Create a new Task (tap the + NEW TASK).
  5. Setup trigger to NFC by press + and select NFC. Tap Next To select an Action.
  6. 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
  7. When prompted Configure Action, select for Toggle instead of Enable. Tap OK.
  8. Name this Task (Instead of Task #) something meaningful just above the Next Button. Let’s called it Wifi Toggler. Tap on Next
  9. 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.
  10. 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!

 

Comments

comments