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.
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.
An IDE is no substitute for an Intelligent Developer.
Did you just should on me? You should read this tiny ad:
Thread Boost - a very different sort of advertising