HTTP Call Over 2G/3G network - Java for Android App Development

I need help in implementing one solution. I want to make HTTP call on 2G/3G network if both the networks are available(i.e Wifi and 2G/3G). I need to set the preference to use mobile cellular network.
For this I tried using the functions of ConnectivityManager class such as setNetworkPrefrence, starUsingNetworkFeature, stopUsingNetworkFeature and its working fine but it is taking 2-3 seconds to switch network traffic to 2G/3G network. Is there any other approach by which we can implement this.

Related

terminal server using VPN over umts

I am able to get a connection using Wifi with vpn and then terminal server connection to my work computer.
I am not able to do this over UMTS or GPRS, I cannot get a VPN connection.
Funny enough it seems that my UMTS connection is actually faster then when using WIFI
Your problem is interesting because I have exactly the opposite problem. I have VPN workng over UMTS, but when if I have wi-fi on & phone off, the VPN wants me to turn-on the phone to connect over UMTS!
Sorry I have no idea why this is happening.
I would like to know how both of you have done each of yours as I cant get either to work.
1. WIFI or UMTS connect...
2. Run VPN
3. Run terminal server, automatically disconnects my VPN. Servers are secure, no VPN to RDP.
Please advise your methodology as I cannot for the life of me get that VPN connection to stay on.
Dont get me wrong, UMTS, WIFI, and RDP internal of the networks works fine, just the VPN part stuffs me up
I had to create a work URL Exception under settings/connections/advanced
Once I did this there was no problem getting a VPN connection over WIFI
hmmm...
NLMCarl : may I respectuously ask wether when you turn on the wifi, it connects you to the Internet (which would explain why umts seems soo fast, since the path is the wifi then and not the umts anymore)
BBill : for your case, AFAIK, the umts is linked to the Phone provider plan (meaning the SIM card as well) so no phone means no umts at all. (very slow connection then )
Gael
Dont know if this will help but...
When I first tried a VPN over GPRS/UMTS on my Exec I, too, found that it didn't work. After a lot of testing I discovered that my provider (O2) was assigning my Exec a dynamic address on the 10.x.x.x network. Unfortuantely, my home network was also a 10.x.x.x network. Therefore, when the VPN was up and I tried to access my home network through the VPN, it didn't go through the VPN at all, but just tried to access a device on O2's local 10.x.x.x network. This, of course, didn't work.
For me, the fix was to change my ip addresses at home to avoid the conflict. I am now on 172.19.x.x at home and haven't had a problems since.
Hope this helps.
Mark

Using more than two proxies

I have a WM5 device (HTC Wizard) and have the following situation:
My "Home" connection uses a proxy to connect to the internet over GPRS (from phone company) -- this works fine.
My "Work" connection uses a different proxy to connect to the internet over wifi (from my work) -- this works fine.
If I want to connect to a third network (my home wifi connection, an internet cafe) that doesn't use a proxy (or uses a different proxy) I need to modify the "Home" connection to remove the phone company proxy settings -- then this works fine. But when I want to get back on my GPRS connection, I need to go modify the proxy configuration again to put the settings back in.
Is there an easier way to move between >2 proxy configurations than setting/clearing/modifying the proxy configuration every time I move between networks? I'm looking for solutions native in the device - I'm sure there are hacks like setting up my own proxy and screwing with the forwarding rules to identify "phone is on WLAN, go directly to internet" vs. "phone is connecting from GPRS, chain through phone company proxy" which will cause me about as many headaches as just manually entering the information. Thanks in advance for any replies.
easist way is to set up a third connection with no proxy....
Have you actually tried doing this? WM5 supports two connections - one for automatic connections (which by default it calls "Home"), one for VPN (which by default it calls "Work"). I could create another network connection profile, but that trade-off is between a) reconfiguring the single network connection profile that my "Home" connection uses (via my provider's proxy or not) for b) reconfiguring which of two network connections the "Home" network connection selects. I don't want another bunch of clicks to jump through as I move from network to network, I want it to Just Work. I'd like the decision tree to go:
if (secured resource)
..use VPN ("Work")
else
..if (preferred network available)
....// this would be my 802.11 nets
....// each of which may have proxy information associated with it
....use that network (afaict, NYI)
..else
....use GPRS ("Home")
But it appears to be:
if (secured resource)
..use VPN ("Work")
else
..use GPRS ("Home")
A bit of an ugly workaround would be to use Opera Mobile - you can manually specify HTTP and/or HTTPS proxies in its own Preferences, as well as any proxy info you might have set up in your work profile.
As of yet, I've not found a way to have more than one proxied profile preconfigured, which is annoying as different buildings in my Uni use different wifi networks with their own proxies and ports typical.

Forcing Internet connection type

I configured my private wireless network, and the needed configuration for my cellular carrier web connection.
The issue is that whenever I am trying to surf to any webpage using my wireless LAN, my trinity always trying to connect to the cellular network, without using the available wireless connection. If I'm trying to cancel the conection process, it stopped but I can't surf anywhere.
Any ideas how to force the trinity to use the wireless network when available?
Thanks,
Amir.
In your connections configuration, create a new connection and do not add any entries to the Modem Section. Just configure the Proxy setting according to your ISP requirements. You have to change the connections configuration ach time you want a different connection to the internet. This you can do easily by creating different connctions for different situations.
Regards,
Randy
It sounds as if your connection to the WLAN Router isn't being recognised.
1st thing to try is to go into the WLAn control panel, and in the Power tab, make sure the slider is fully to the left for max performance.
In the Network Cards CP, see if your router is listed, and whether Available or Unavailable.
Recheck the security settings- are you using WEP or WPA? Does your router have any Range Extender features- if so, turn them off.
Once you have a valid WLAN connection, the PPC will use that in preference to the GPRS, as long as you have WLAN conneced before opening PIE, and as long as there is no current GPRS activity when you open PIE (I find that if my Exchange Server is connecting via GPRS, then WLAN won't connect till the data session has completed)
For a quick way to force GPRS off, then on as needed, look for a great free app called Bandswitch. This allows you to force the P3600 to use GSM or 3G if needed to conserve power, and also to quickly enable/disable the various GPRS connections.

At home, GPRS vs. Wi-Fi

Everyone,
Apologies, and I know this is a stupid question, but when at home with my htc tound pro, with WiFi on, and connected, why do I need the phone on too for the WiFi to work,...?
Also, when both are on and working, which system is used, i.e., the SIM card connection or the WiFi connection,...?
WiFi I pay a flat monthly rate for unlimited data, with the SIM card I am on a fixed amount of data transfer per month,...
Thanks for listening,
ek
Well..
You may be using an application that is not Wifi aware. So, it demands a GPRS/EDGE/3G connection. So - in effect - it's not actually using the Wifi connection.
If you can use the application with Wifi on, and phone off - it's Wifi aware. (Meaning it can utilize Wifi).
If you can't use the application without the phone being on - it's not Wifi aware or has not been configured to use the Wifi.
What application are you having issues with?
thanks for getting back to me,... WM Professional 6.1 and the Internet Explorer program when going on to the web,... i'm just wondering which systems does the phone use when both are functioning,... am i using the gprs from my SIM card or am I using the wi-fi in my home,...? and why do i need the phone turned on to use the wi-fi in my home,...?
thanks again,...
ek
you can see if it's using gprs on the icon for signal str if it's showing animations
it's using gprs
otherwise it's using wifi
if you set
settings-connections-connection-advanced-select network to my homenetwork
it dont use gprs
did you set the gprs settings to your gsm provider?
i would prefer wifi over gprs/3g anyday unless if your home internet is extremely slow ( <300kbps). the battery life would be almost equal so why not a faster connection?
Rudegar said:
you can see if it's using gprs on the icon for signal str if it's showing animations
it's using gprs
otherwise it's using wifi
if you set
settings-connections-connection-advanced-select network to my homenetwork
it dont use gprs
Click to expand...
Click to collapse
I'd like to understand how WM decides which network to use when it has a choice e.g. HSDPA and WiFi. I've looked at the settings mentioned above and I currently have Internet using Contract Internet (HSDPA) and Work using WiFi as the WiFi networks I connect to are firewalled and privately addressed.
What settings should I have to ensure that when I have the choice of WiFi and HSDPA (at home) I use WiFi, and when out and about I use HSDPA?
Everytime an application wants to connect to the net:
- If wifi is connected and GSM isn't, it uses Wifi
- If wifi isn't connected, it tries connecting to GSM and will use that.
- If both are connected - we don't really know what happens.
When you're at home, check that GSM is not connected (no little E, G, 3G or H on the signal bar icon, disconnect it if connected), turn on wifi, wait until the arrows have stopped moving on the Wifi icons, and now you can launch the program that wants to connect to the net, and it will use wifi.
If at this point you get a popup about the phone connecting to GSM data again, then there's a connectivity problem on your Wifi and the device can't reach the net through it.
You might want to install Modaco Nodata, it allows you do disable automatic connection to GSM so that you can be sure it doesn't connect when you don't want it to.
mine never use gprs when it have wifi
I have a Touch HD and I can make things work fine by manually turning off the data connection then turning on WiFi in the comm manager when I'm at home or vice versa when I'm out and about.
I would have thought win mobile 6.1 would have been a mature enough OS to allow this to be configured automatically. This and Opera are my only outstanding issues with the HD.
Strange. I can easily shut my phone off, enable wifi & browse fine.

Wifi calling error "ER082 - unable to connect"

This feature used to work fine while I had service with TMobile but now that I switched providers it doesn't work at all. My wifi connection works fine and I've even tried it at Starbucks and other places with public wifi and I still get the same error. Is there any way to wifi call on this phone?
Not every provider enables wifi calling, on some tariff itÅ› possible but requires activation. So I would suggest first get in contact with your new provider. Also you could check your APN .

Categories

Resources