Hari, I won't write code for you, but am giving you clues, that then require you to do a little more research in order get the configuration just right for your situation.
DesiredCapabilities capabilities = DesiredCapabilities.android();
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
Proxy proxy = new Proxy();
proxy.callAppropriateMethodsHere(); //not a real method but can set proxy settings various ways from Java docs
capabilities.setCapability(CapabilityType.PROXY, proxy);
driver = new AndroidDriver(capabilities);
- the other way I mentioned was setting the telephony databases via adb shell. It sounds like maybe you tried that, but that's what is working for me with android-server-2.21.0.apk on Android 4.0 emulator with the latest updates in SDK manager.
- you might also check with your company's network guys to see if they can provide any feedback. You can use packet capturing tools to determine where things are dying, but it can be a tedious process