You can manage wifi connectivity, and you can kind of manage 3G, but what about 4G, more specifically WiMAX? I saw an API on ClearWire's website, but I am not sure if Google is planning to include WiMAX as part of the SDK. Does anyone have an insight? I am looking for connect/disconnect functionality, failover connection settings, etc. Thanks!
+1
A:
WiMAX was added to Android with Android 2.2. You "manage" it to the same extent you manage any other connectivity type.
CommonsWare
2010-10-19 19:20:15
Mark, thanks for your answer. I saw the link that you provided. It appears that the only way for me to connect to WiMAX is by using setNetworkPreference to set preference to WiMAX. This method however does not work (even SDK's description of the method is done). I wonder how one would instruct Android to use WiMAX when other technologies are available. I don't see a solution right now.
Lenik
2010-10-19 20:45:28
@Lenik: "I wonder how one would instruct Android to use WiMAX when other technologies are available." -- you don't, I suspect. Ignoring WiMAX for the moment, if WiFi is available, Android uses it, falling over to mobile data when there is no configured WiFi access point. My guess is that WiMAX is just another mobile data approach, so if WiFi is there, Android will use it. IOW, I doubt that WiMAX has changed anything in this area from the way Android has behaved all along.
CommonsWare
2010-10-19 21:10:10
@Mark, I agree, I don't think WiMAX technology works differently; however, there was a method setNetworkPreference that provides a way to to specify a technology with the highest priority, so if you specify WiMAX and then you go to the area where WiMAX is available it will switch from whatever technology to WiMAX. Based on trying and Google searches, this method no longer works, so I am trying to figure out how I can manage connections now.
Lenik
2010-10-19 23:00:14
@Lenik: Ah. Which device are you trying this on?
CommonsWare
2010-10-19 23:10:11
i used galaxy s with 2.1 update, and I also used HTC EVO with 2.2.
Lenik
2010-10-19 23:24:58
@Mark, I wonder why setNetworkPreference does not actually work in 2.2
Lenik
2010-10-19 23:29:26
@Lenik: Hmmmm... Well, 2.1 didn't officially support WiMAX, so I can see where there would be problems there. However, I would have expected the EVO to fare better. I see no issues on b.android.com related to this. If you can create a program that demonstrates the problem, I suggest you open an issue on b.android.com, attaching the Android project as a sample.
CommonsWare
2010-10-19 23:29:30
you mentioned here ( http://stackoverflow.com/questions/2230389/android-application-setting-connection-type) that method is not working. Was it officially deprecated?
Lenik
2010-10-19 23:30:05
@Lenik: Also, bear in mind you need the `CHANGE_NETWORK_STATE` permission to use `setNetworkPreference()`, according to the source code.
CommonsWare
2010-10-19 23:30:49
@Lenik: I probably was unaware of `setNetworkPreference()` at that time. Plus, the method is undocumented. Hence, I am not even certain what it really winds up doing, even based on a cursory examination of the source code.
CommonsWare
2010-10-19 23:32:42
@Mark, thanks, I tried setting the necessary permissions, but the method still does not work (i.e. throws an exception).
Lenik
2010-10-19 23:40:59
@Lenik: What exception?
CommonsWare
2010-10-19 23:52:05
@Mark, the exception is that a certain permission needs to be added to my manifest file, even though it's already added. My guess is that the system does not grant the permission even though I request it b/c I don't sign the app. I am new to Android, so I thought permissions were magically granted to me...
Lenik
2010-10-20 00:00:53
@Lenik: Ah. Probably `CHANGE_NETWORK_STATE` requires you to be signed by the firmware signing key, then. That means `setNetworkPreference()` is off-limits. Sorry!
CommonsWare
2010-10-20 00:06:24
@Mark, thanks! last question: how do I obtain the key or are there workarounds? I read something about rooting the phone and putting my app under system folders...
Lenik
2010-10-20 00:23:35
@Lenik: Well, you can't get the key, without a team of armed robbers. Now, it could be that simply having the app somewhere in the system area will suffice, but I don't know anything about that.
CommonsWare
2010-10-20 00:26:10