tags:

views:

331

answers:

1

Hi, I have a small issue.

Is it possible to enable or disable HSDPA connection programatically in Andoird ?

If so, how to do that? I didnt find any API in TelephonyManager.

Please help me in this..

Thanks in advance...

+1  A: 

I am answering my own question, If anything wrong, feel free to post yours.

It is not possible to enable Network(CDMA, 3G or HSDPS) programmatically as of now. As we know we can enable WiFi programatically.

But we can set the preferable network among Mobile / WiFi.

ConnectionManager.setNetworkPreference(ConnectionManager.TYPE_MOBILE/TYPE_WIFI);

Unfortunately, it is not working for me. When I tried to set TYPE_MOBILE, I am getting Security Exception even if I had required permission in my manifest.

When I tried to set TYPE_WIFI, It is not throwing exception, but while getting network preference, I am getting "-1", means there is no preferred network(No Documentation, its my prediction).

If anyone has idea about this, please share. It will help me a lot.

Thanks in advance ...

Andhravaala