Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP Delvorak

3rd February 2011, 08:07 PM   |  #11  
OP Senior Member
Thanks Meter: 35
 
117 posts
Join Date:Joined: 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
Last edited by Delvorak; 3rd February 2011 at 10:46 PM.
The Following User Says Thank You to Delvorak For This Useful Post: [ View ]
11th May 2011, 03:40 AM   |  #12  
Junior Member
Thanks Meter: 1
 
7 posts
Join Date:Joined: May 2011
Quote:
Originally Posted by Delvorak

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
20th May 2011, 01:17 PM   |  #13  
OP Senior Member
Thanks Meter: 35
 
117 posts
Join Date:Joined: Nov 2007
Quote:
Originally Posted by unnamedapps

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
21st May 2011, 05:05 AM   |  #14  
Junior Member
Thanks Meter: 1
 
7 posts
Join Date:Joined: May 2011
Quote:
Originally Posted by Delvorak

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
Last edited by unnamedapps; 22nd May 2011 at 06:12 PM.
21st May 2011, 11:55 PM   |  #15  
Junior Member
Thanks Meter: 1
 
7 posts
Join Date:Joined: 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, 17 views)
Last edited by unnamedapps; 22nd May 2011 at 06:09 PM. Reason: typo
The Following User Says Thank You to unnamedapps For This Useful Post: [ View ]
22nd May 2011, 01:42 AM   |  #16  
Recognized Developer
Thanks Meter: 1,287
 
1,940 posts
Join Date:Joined: Jan 2009
Quote:
Originally Posted by unnamedapps

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
Last edited by joeykrim; 23rd May 2011 at 12:52 AM. Reason: Added simple android app
3rd July 2011, 10:22 PM   |  #17  
autoprime's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter: 6,258
 
1,773 posts
Join Date:Joined: 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?

Post Reply Subscribe to Thread

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

Advanced Search
Display Modes