Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use a 3G internet connection in my Android App?

Tags:

android

port

3g

I have made an App that can connect to a program that I am running on a server, but it only seems to work with WiFi. When I try to use 3G it doesn't make the connection. Is there something special that I have to turn on or set in order to use 3G?

like image 292
Nick Banks Avatar asked May 13 '10 13:05

Nick Banks


People also ask

How can I use 3G internet?

To access 3G Internet, a user must have a 3G compatible device like a mobile phone or a tablet. Most service providers require a subscription to use their 3G networks. There can also be geographical limitations on service, based on the provider and their coverage area.

Can I use 3G for Wi-Fi?

Yes you can. You can obtain an internet signal from the mobile-phone network, rather than the WiFi network, by using a dongle. This is a small device about the size of a key ring, which plugs into your laptop.

Why does my app say no Internet connection?

Restart your device. If restarting doesn't work, switch between Wi-Fi and mobile data: Open your Settings app and tap Network & internet or Connections. Depending on your device, these options may be different. Turn Wi-Fi off and mobile data on, and check if there's a difference.


2 Answers

At the application level you (normally) don't have to worry about what data connection is available to the phone.

Have you looked into problems such as when you use WiFi you web server is accessible since you are hitting it from within your network. Whereas, it may not be accessible at all from the public internet which is how the 3G connection will be trying to connect to the server.

What error / exception do you get on 3G?

like image 147
Prashast Avatar answered Oct 07 '22 16:10

Prashast


The problem was the port I was using. I was using 4444, but it turns out that many networks block that port. Port 1024 seems to work for most.

like image 22
Nick Banks Avatar answered Oct 07 '22 16:10

Nick Banks