×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    1

    Disable/enable WLAN with Java ME or S60/Symbian

    Hi

    I am wondering whether it is possible to disable/enable the WLAN device on a S60/Symbian platform using Java or C++.

    Until now I haven't found anything about this subject in neither the Java ME API nor for Symbian C++. Is it possible at all??

    A friend of mine is complaining that his N80 doesn't provide the option to turn the device off and thus runs out of energy rather quickly.

    Thanks for advice
    Peter

  2. #2
    Regular Contributor
    Join Date
    Feb 2004
    Location
    Budapest, Hungary, Europe
    Posts
    168

    Question Re: Disable/enable WLAN with Java ME or S60/Symbian

    Hi Peter,

    I would like to solve the same problem, i.e. enable/disable WLAN. Nevertheless, I'm almost sure that IF there is such an API, it'll be Symbian C++ and not Java. Java needs time to catch up features implemented in device native language.

    If you have any information on it, please share it with us!

    Thanks,

    Tote

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Disable/enable WLAN with Java ME or S60/Symbian

    Hi,

    First, it is possible to disable WLAN on the N80 (from a power consumption point of view). In fact that is the default situation for most phones. If you think there's a problem, check that "Settings->Connection->Wireless LAN->Show availability" is set to "Never". This prevents periodic scans checking for an available network. You can see if WLAN is on in this sense from the little icon (four boxes) on the status pane. As long as that setting is correct then WLAN is only on when you are connected to an access point.

    Next, given the above I don't think there is any public API to switch WLAN on and off apart from standard connecting and disconnecting from the access point.

    Hope that helps,
    Sorcery

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Disable/enable WLAN with Java ME or S60/Symbian

    Just to confirm what Tote wrote. Not possible through Java ME

    Hartti

  5. #5
    Regular Contributor
    Join Date
    Feb 2004
    Location
    Budapest, Hungary, Europe
    Posts
    168

    Cool Re: Disable/enable WLAN with Java ME or S60/Symbian

    I have discovered something that might be useful for my needs: namely RConnectionMonitor class and some helper classes.

    My idea is that if we cannot directly disable WLAN, then we might prevent others to make a WLAN connection. Well, it's a hack, I admit that, but might work. We could do this by using the aforementioned class and using its NotifyEventL method to get notified upon connection events, for example, when a new connection is being made. Upon reflection to that event (we know the UID of the connection as well), we can set a boolean attribute using SetBoolAttribute method along with the UID of the connection and KConnectionStop attribute and terminate the new connection. Again, it's not elegant, but might work.

    I don't know if it works, as I haven't yet made any experiments. Maybe others will be faster?

    Tote

  6. #6
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Disable/enable WLAN with Java ME or S60/Symbian

    Hi Tote,

    Just out of interest, why would you want to block WLAN altogether? If you want to stop RF output then you can just switch the phone to offline mode (the user has to then explicitly allow each WLAN connection in offline mode).

    If you only want to use 3G/GPRS connections in your application then you can filter the access points that the user gets to choose from. I can't really think of a use case for disabling it completely though.

    If you had a valid use case you may be able to get an appropriate API to shut off the power to the WLAN from Nokia though.

    Sorcery

  7. #7
    Regular Contributor
    Join Date
    Feb 2004
    Location
    Budapest, Hungary, Europe
    Posts
    168

    Thumbs up Re: Disable/enable WLAN with Java ME or S60/Symbian

    Hi Sorcery,

    Then let me tell you a use case: there is an OMA DM E2E solution, in which the system administrator wants to restrict the use(fulness) of a possibly stolen device. One of the things he/she wants to do is to not allow the thief to use the stolen device at full strength.

    Tote

  8. #8
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Disable/enable WLAN with Java ME or S60/Symbian

    Thanks Tote, that's an interesting use case!

    I expect that it is possible but thinking about it I'm not so sure Nokia would release an API because it would need to be protected by a suitably difficult to obtain capability, such as NetworkControl. If the API exists but isn't protected by a capability check in existing devices they may not want to partner it for security reasons.

    Your connection monitoring idea sounds like a good hack/workaround to me. I hope it works.

    Sorcery

  9. #9
    Regular Contributor
    Join Date
    Feb 2004
    Location
    Budapest, Hungary, Europe
    Posts
    168

    Re: Disable/enable WLAN with Java ME or S60/Symbian

    I'm sure that this API is protected by either NetworkControl or perhaps NetworkServices. Or perhaps by both. And it's officially published.

    Tote

Similar Threads

  1. J2ME MIDlet is limited, why not Java applications on mobile?
    By chen_lin99 in forum Mobile Java General
    Replies: 11
    Last Post: 2007-12-29, 01:15
  2. Question regarding Java vs Symbian C++
    By Olnex in forum Mobile Java General
    Replies: 5
    Last Post: 2006-09-27, 23:53
  3. Replies: 0
    Last Post: 2004-11-27, 17:03
  4. How develop Java games on mobile phones?
    By ericzutter in forum Mobile Java General
    Replies: 4
    Last Post: 2003-11-20, 23:14
  5. Audio Capture in Java
    By larrydb in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2003-08-25, 15:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×