Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,780,891 Members 50,080 Now Online
XDA Developers Android and Mobile Development Forum

[Q] SOLVED: Turning on/off WiMax for Epic 4g in code, how?

Tip us?
 
Delvorak
Old
(Last edited by Delvorak; 3rd February 2011 at 09:46 PM.)
#11  
Senior Member - OP
Thanks Meter 35
Posts: 117
Join Date: Nov 2007
I figured it out!

I used "adb bugreport", which returns a list of all running services. Turns out the correct string to use with getSystemService is "WiMax". That exact case. HTC uses "wimax".

I also found that it doesn't use "getWimaxState" to determine if it's enabled/disabled, it uses "getWimaxStatus".

For anyone who cares, here's the entire list of functions for Samsung's WimaxManager object:

public boolean android.net.wimax.WimaxManager.CheckWimaxState()
public int android.net.wimax.WimaxManager.OdbAddReq(byte[])
public int android.net.wimax.WimaxManager.OdbDeleteReq(byte[])
public int android.net.wimax.WimaxManager.OdbReadReq(byte[])
public int android.net.wimax.WimaxManager.OdbUpdateReq()
public int android.net.wimax.WimaxManager.OdbWriteReq(byte[])
public boolean android.net.wimax.WimaxManager.checkUSBstate()
public int android.net.wimax.WimaxManager.connect(java.lang.S tring,java.lang.String,java.lang.String,java.lang. String)
public int android.net.wimax.WimaxManager.connectDefaultNetwo rk()
public android.net.wimax.WimaxManager$MulticastLock android.net.wimax.WimaxManager.createMulticastLock (java.lang.String)
public android.net.wimax.WimaxManager$WimaxLock android.net.wimax.WimaxManager.createWimaxLock(int ,java.lang.String)
public android.net.wimax.WimaxManager$WimaxLock android.net.wimax.WimaxManager.createWimaxLock(jav a.lang.String)
public int android.net.wimax.WimaxManager.deleteStaticIP()
public boolean android.net.wimax.WimaxManager.disconnect()
public java.util.List android.net.wimax.WimaxManager.getAvailableNetwork s()
public android.net.wimax.structs.NspInfo android.net.wimax.WimaxManager.getConnectedNSP()
public android.net.wimax.WimaxInfo android.net.wimax.WimaxManager.getConnectionInfo()
public android.net.wimax.ConnectionStatistics android.net.wimax.WimaxManager.getConnectionStatis tics()
public android.net.wimax.DeviceInfo android.net.wimax.WimaxManager.getDeviceInformatio n()
public android.net.DhcpInfo android.net.wimax.WimaxManager.getDhcpInfo()
public void android.net.wimax.WimaxManager.getMruList()
public java.util.List android.net.wimax.WimaxManager.getMruListRsp()
public boolean android.net.wimax.WimaxManager.getMruUpdate(java.u til.List,int)
public void android.net.wimax.WimaxManager.getNeighborList()
public int android.net.wimax.WimaxManager.getNetworkConnectio nSetting()
public [I android.net.wimax.WimaxManager.getNetworkEntryComp leteTimes()
public java.util.List android.net.wimax.WimaxManager.getNetworkList()
public boolean android.net.wimax.WimaxManager.getPersistedWimaxEn abled()
public void android.net.wimax.WimaxManager.getRadioInfo()
public android.net.wimax.RadioInfo android.net.wimax.WimaxManager.getRadioInfoRespons e()
public void android.net.wimax.WimaxManager.getRadioInfoTempera ture()
public int android.net.wimax.WimaxManager.getWimaxMode()
public android.net.wimax.WimaxState android.net.wimax.WimaxManager.getWimaxState()
public int android.net.wimax.WimaxManager.getWimaxStatus()
public int android.net.wimax.WimaxManager.getWorkModeState()
public boolean android.net.wimax.WimaxManager.isMulticastEnabled( )
public boolean android.net.wimax.WimaxManager.isWimaxEnabled()
public int android.net.wimax.WimaxManager.makeOdbTlvData(byte[],int,int,int,int,byte[])
public java.lang.String android.net.wimax.WimaxManager.readStaticIP(int)
public void android.net.wimax.WimaxManager.release_sWakeLock()
public int android.net.wimax.WimaxManager.saveStaticIP(java.l ang.String,java.lang.String,java.lang.String,java. lang.String,java.lang.String)
public boolean android.net.wimax.WimaxManager.setFactoryDefault(i nt)
public void android.net.wimax.WimaxManager.setMruWorking(boole an)
public int android.net.wimax.WimaxManager.setVirtualIdleWhile APsleep(byte)
public boolean android.net.wimax.WimaxManager.setWimaxEnabled(boo lean)
public int android.net.wimax.WimaxManager.setWimaxMode(int,bo olean)
public void android.net.wimax.WimaxManager.setWimaxStatus(int)
public boolean android.net.wimax.WimaxManager.setWorkModeState(in t)
public boolean android.net.wimax.WimaxManager.startScan()
public boolean android.net.wimax.WimaxManager.startScan(boolean)
private static int android.net.wimax.WimaxManager.CheckRSSILevel(int)
static int android.net.wimax.WimaxManager.access$000(android. net.wimax.WimaxManager)
static int android.net.wimax.WimaxManager.access$008(android. net.wimax.WimaxManager)
static int android.net.wimax.WimaxManager.access$010(android. net.wimax.WimaxManager)
public static int android.net.wimax.WimaxManager.calculateSignalLeve l(int,int,int)
public static int android.net.wimax.WimaxManager.compareSignalLevel( int,int)

Hopefully this will help someone else!

Scott
The Following User Says Thank You to Delvorak For This Useful Post: [ Click to Expand ]
 
unnamedapps
Old
#12  
Junior Member
Thanks Meter 1
Posts: 7
Join Date: May 2011
Quote:
Originally Posted by Delvorak View Post
I figured it out!

I used "adb bugreport", which returns a list of all running services. Turns out the correct string to use with getSystemService is "WiMax". That exact case. HTC uses "wimax".
Sorry to bring up an old thread, but I just got a Nexus S 4G and am trying to enable/disable the 4g in my application.

When I do adb bugreport I see "DUMP OF SERVICE WiMax", just like the on the Epic, However when I try to do:

Code:
Object wimax = context.getSystemService("WiMax");
Object is returned as null. Is there anything else I need to do get the Wifi Manager object correctly? Any Suggestions?

Thanks,
Nick
 
Delvorak
Old
#13  
Senior Member - OP
Thanks Meter 35
Posts: 117
Join Date: Nov 2007
Quote:
Originally Posted by unnamedapps View Post
Sorry to bring up an old thread, but I just got a Nexus S 4G and am trying to enable/disable the 4g in my application.

When I do adb bugreport I see "DUMP OF SERVICE WiMax", just like the on the Epic, However when I try to do:

Code:
Object wimax = context.getSystemService("WiMax");
Object is returned as null. Is there anything else I need to do get the Wifi Manager object correctly? Any Suggestions?

Thanks,
Nick
Sorry for the delay in replying.

I'm reviewing my code on this subject, and no, there shouldn't be anything else that you need to do. I'm running essentially the same code for the EVO/Epic, and it resolves out to an object.

Did you try using just "wimax"? Or "WIMAX"? Or "Wimax"? Seems stupid, but odds are it's a variation of the word Wimax.

If none of those work, then either they've blocked you from retrieving the WiMax manager from the getSystemService call (unlikely), or the parameter is wrong.

Can you reply and attach the contents of the debugreport? I might see something you missed.

Scott
 
unnamedapps
Old
(Last edited by unnamedapps; 22nd May 2011 at 05:12 PM.)
#14  
Junior Member
Thanks Meter 1
Posts: 7
Join Date: May 2011
Quote:
Originally Posted by Delvorak View Post
Sorry for the delay in replying.

I'm reviewing my code on this subject, and no, there shouldn't be anything else that you need to do. I'm running essentially the same code for the EVO/Epic, and it resolves out to an object.

Did you try using just "wimax"? Or "WIMAX"? Or "Wimax"? Seems stupid, but odds are it's a variation of the word Wimax.

If none of those work, then either they've blocked you from retrieving the WiMax manager from the getSystemService call (unlikely), or the parameter is wrong.

Can you reply and attach the contents of the debugreport? I might see something you missed.

Scott
Scott,

Thanks very much for responding. Yeah, I have tried every variation of "wimax" I can think of, nothing has worked. Seems unlikely they are blocking it to me also, especially since they aren't on the Epic, but I am out of other ideas. I'm out of town tonight, but I will be back tomorrow and will post the bugreport. I also decompiled the samsung vendor jars posted in the Nexus S forum with apktool and it looked the service name was "WiMax" in there as well.

Thanks again,
Nick
 
unnamedapps
Old
(Last edited by unnamedapps; 22nd May 2011 at 05:09 PM.) Reason: typo
#15  
Junior Member
Thanks Meter 1
Posts: 7
Join Date: May 2011
Scott,

The bugreport is attached, I toggled on 4G right before I captured it, in case that helps. Thanks for looking at this for me.

Nick
Attached Files
File Type: zip bugreport.zip - [Click for QR Code] (337.4 KB, 16 views)
The Following User Says Thank You to unnamedapps For This Useful Post: [ Click to Expand ]
 
joeykrim
Old
(Last edited by joeykrim; 22nd May 2011 at 11:52 PM.) Reason: Added simple android app
#16  
Recognized Developer
Thanks Meter 1,261
Posts: 1,929
Join Date: Jan 2009
Quote:
Originally Posted by unnamedapps View Post
Scott,

The bugreport is attached, I toggled on 4G right before I captured it, in case that help. Thanks for looking at this for me.

Nick
Wow! I've never seen a 741 page bugreport for an android device. Learned a few more WiMAX constants Samsung uses ... like WIMAX_DATA_USED.
We're researching the same issue you are ... although we're hoping to modify our WimaxHelper.java to handle Samsung's WiMAX implementation in the NS4G. Our goal appears to be quite lofty after researching the simple question of how to toggle 4G on/off ...
Sorry, I'm not of much help to answer the question, but I am very interested in the answer. Was hoping we wouldn't have to start reversing WiMAXSettings.apk ..
Appreciate any help provided on the topic of setting up the WiMAX object and controlling it...

EDIT: posted up a basic app which does the toggle information given in the first few posts ... not working on ns4g, but works on the EVO. Oddly enough the code mentioned above for the Epic works on the EVO with CM7 ...
https://github.com/joeykrim/testWiMAX
 
autoprime
Old
#17  
autoprime's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 4,761
Posts: 1,608
Join Date: Jun 2010

 
DONATE TO ME
any update on wimax controls and the ns4g? would there be any way to use the epics wimax framework on the nexus.. along with the wimax apk's from the epic?

Tags
epic, java, wimax
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes