deimos1988
deimos1988

Reputation: 6086

Android - differences between WLAN and 3G connection

I would like to know what exactly the differences are between a WLAN connection to the internet, or a 3G connection to the internet.

I am coding an App which uses session handling, which works fine when I'm connected via WLAN, but not at all when I'm connected via 3G. How can that be? Is there something I need to be aware of that I am not?

Upvotes: 2

Views: 780

Answers (2)

deimos1988
deimos1988

Reputation: 6086

I figured out what the problem was. When calling the webservice, I am receiving "HeaderProperties", and one of them contains the cookie I need. When connected via WLAN, I get the cookie with HeaderProperties.get(2).getValue(). However when connected via 3G, .get(2) only contains a timestamp, to get the cookie, I need to get the fourth entry (i.e. HeaderProperties.get(3).getValue()).

Upvotes: 0

Christopher Orr
Christopher Orr

Reputation: 111575

For accessing the internet, Android doesn't do anything special relating to the type of connection you're using.

However, there are some potential reasons why your session-handling mechanism may not work:

  • the mobile network you're on may filter out certain packets or items, such as HTTP headers, that your app uses for session tracking
  • if you started a session while on WLAN, then continue your session over a mobile connection, the server will see you have a different IP address - this could cause the server to see you as a separate user
  • similarly, the mobile network could be presenting a different IP to the server with each connection you make from the phone

How does the session-handling mechanism work?
Do you have access to the server so that you could identify any differences between the two types of requests?

Upvotes: 3

Related Questions