开发者

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 开发者_Python百科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.


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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜