3g-network

How to check whether 3g is active or not in android

♀尐吖头ヾ 提交于 2020-01-23 07:36:08
问题 i am trying to check whether 3G is active or not in my handset and after that i have to fire an Intent. So plz anybody help me out Thanks in advance:) 回答1: another snippet from an applilcation I've written recently: TelephonyManager telManager; telManager = (TelephonyManager) getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); int cType = telManager.getNetworkType(); String cTypeString; switch (cType) { case 1: cTypeString = "GPRS"; break; case 2: cTypeString = "EDGE"; break;

How to switch from 3G and 2G/EDGE vice versa?

强颜欢笑 提交于 2020-01-01 03:31:11
问题 I am trying to switch the network preference from 3G to 2G/EDGE through code and vice versa. I can able to switch on and off the mobile data connection. Now i need know how to switch between 3G to 2G/EDGE and vice versa through code. can somebody help me here. Thanks in advance. 回答1: I've stumbled upon a way to solve this with reflection and system call commands, and decided to report it even though the thread is old and there are some caveats: Root required Hackish and maybe ROM-specific

NSURLConnection IOS 3G issue

人走茶凉 提交于 2019-12-07 06:00:59
问题 I have used NSURLConnection (asynchronous) in my app which is working fine on wifi (iOS5 & iOS6). But its creating an issue with 3G. When I run my app 3G connection then I dont get any data in my didReceiveData method. I have putted logs in my delegate methods, but while using 3G, The request is getting timed out. What can be the issue. EDIT: On server side -> It shows that my request has been sent to server & server has also sent the response to the client. EDIT 2: The code which I have

How to turn off 3G data connection programmatically in android?

♀尐吖头ヾ 提交于 2019-12-06 13:16:47
问题 I want to Enable/Disable 3G and other Data connections separately.Is it possible to access 3G individually?That means if the user selects the option 3G, then Enable/Disable 3G data connection only.And if the user selects the option Data Services, enable/disable data connections except 3G.Is it possible? I tried the following methods enableDataConnectivity(); and disableDataConnectivity(); of TelephonyManager But i think these methods turn off/on all data services in whole.I want to access 3G

NSURLConnection IOS 3G issue

99封情书 提交于 2019-12-05 11:07:49
I have used NSURLConnection (asynchronous) in my app which is working fine on wifi (iOS5 & iOS6). But its creating an issue with 3G. When I run my app 3G connection then I dont get any data in my didReceiveData method. I have putted logs in my delegate methods, but while using 3G, The request is getting timed out. What can be the issue. EDIT: On server side -> It shows that my request has been sent to server & server has also sent the response to the client. EDIT 2: The code which I have written is as follows. NSURL *url = [NSURL URLWithString:@"someURL"]; NSMutableURLRequest *req = [

How to check whether 3g is active or not in android

和自甴很熟 提交于 2019-12-05 09:38:44
i am trying to check whether 3G is active or not in my handset and after that i have to fire an Intent. So plz anybody help me out Thanks in advance:) another snippet from an applilcation I've written recently: TelephonyManager telManager; telManager = (TelephonyManager) getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); int cType = telManager.getNetworkType(); String cTypeString; switch (cType) { case 1: cTypeString = "GPRS"; break; case 2: cTypeString = "EDGE"; break; case 3: cTypeString = "UMTS"; break; case 8: cTypeString = "HSDPA"; break; case 9: cTypeString = "HSUPA";

How to turn off 3G data connection programmatically in android?

淺唱寂寞╮ 提交于 2019-12-04 20:34:35
I want to Enable/Disable 3G and other Data connections separately.Is it possible to access 3G individually?That means if the user selects the option 3G, then Enable/Disable 3G data connection only.And if the user selects the option Data Services, enable/disable data connections except 3G.Is it possible? I tried the following methods enableDataConnectivity(); and disableDataConnectivity(); of TelephonyManager But i think these methods turn off/on all data services in whole.I want to access 3G separately. How to do this? Neal This code sample should work for android phones running gingerbread

UDP hole punching not going through on 3G

故事扮演 提交于 2019-12-03 02:53:59
问题 I'm trying to implement in a software a hole punching feature. The thing is, I'm implementing this with an already made TCP Server to communicate with Users. Here's what I have so far : "A" sends a message to an UDP Server "US" (on port 9333) "US" sends back to "A" the port it has connected to (port 31000 - localport 31005) "A" sends a message to a TCP Server "TS" saying he want's to connect to B (and give the port 31000) "TS" sends a message to "B" giving him the "A"'s port (31000) and ip "B

Getting the IP address of the android device when connected to 3G mobile network

南笙酒味 提交于 2019-11-26 16:48:15
问题 When I am connected to WiFi, I can obtain the IP address of the Android phone. However, when on the mobile network like 3G connection, is it still possible to obtain the IP address of the Android phone? If yes, kindly post the code for the same. 回答1: try something like this String ipAddress = null; try { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); for (Enumeration<InetAddress> enumIpAddr =