Salw
Salw

Reputation: 1900

How can I test android application for network errors?

I have content management application that uses TCP/IP to fetch data. I would like to test this application for several network problems like packet loss and connection lost.

Is there some easy way to emulate network problems to test Android application?

In DDMS there is some connection and latency setting for device, hovewer it looks like this is not working. I can set denied or unregistered but fetching from server is untouched. I'm using Windows for development.


I have tried so far:

F8 - 3G icon disappears, however I'm still able to download data.

DDMS, Change of Telephony status - 3G icon disappears, however I'm still able to download data.

Settings, Mobile networks, Data enabled false - 3G icon disappears, however I'm still able to download

Airplane mode - 3G icon disappears, however I'm still able to download

Dev tools - Wifi toggle - I'm getting errors:

09-27 16:43:31.353: ERROR/Connectivity(518): EVENT_TOGGLE_WIFI
09-27 16:43:31.363: ERROR/WifiService(62): Failed to load Wi-Fi driver.

Upvotes: 4

Views: 3586

Answers (3)

Houcine
Houcine

Reputation: 24181

for testing the lost of internet connexion for example , you can desactivate the 3G connection from your emulator by pressing F8. for example; launch your application , and then while downloading data, try to disable the connection by pressing F8 , and then you can see the reaction of your app

Upvotes: 2

Pointer Null
Pointer Null

Reputation: 40391

You can use Android Dev Tools App. It's by default on Emulator, and you can copy/install it on real device.

It has option (among others) to toggle Wifi periodically by some given times.

Upvotes: 1

Che Jami
Che Jami

Reputation: 5151

I don't think you have to worry about packet loss with a TCP connection given that the delivery is reliable (lost packets are already handled and re-sent). If you are using an emulator you can set the latency in the Telephony Status section of the Emulator Control tab in DDMS.

Upvotes: 1

Related Questions