Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Wifi/3G network selection at App level

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

Is there a way in Android 2.2/2.1 to programaticaly select/de-select
the network (WiFi/3G) used by the application.

Once user de-selects WiFi and selects (3G/2G) from the application
settings, Android should use 3G/2G for any further network
communication for that app. The device level settings should not be
changed. Which means other application should still be able to use
WiFi network for their communication.

Is that possible? If yes, what are the relevant APIs.
 
Saloon Keeper
Posts: 25459
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not how TCP/IP networking works. In a TCP/IP network, you can have multiple network interfaces all operating at the same time - WiFi, 3G, Bluetooth, USB, even infrared.

The network software makes a determination based on various metrics as to which network interface(s) it will use to satisfy transmission needs. The application does not, need not, and should not know which of these interface(s) is/are being used. Note the optional plural. Smart networks may run requests in parallel over multiple devices.

You can take a given interface offline, but the network stack will simply stop using it as a means to route data. For all apps, not just a given app.
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic