×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    16

    Post Get Battery Level in J2ME

    How can I check the battery level using J2ME?
    Can this be done?
    If yes? Is there some library I should import, where from?

    P.S:
    - I'm using a Nokia with S60 2nd Edition.
    - I'm developing using the Sun Wireless Toolkit.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Get Battery Level in J2ME

    As far as I know it's not possible possible on S60 2nd ed, but only on 3rd edition FP2 (with com.nokia.mid.batterylevel system property)

    Pit

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    16

    Re: Get Battery Level in J2ME

    Assuming I would use a 3rd Edition FP2 device,
    How can I integrate com.nokia.mid.batterylevel to the Sun Wireless Toolkit?

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Get Battery Level in J2ME

    The following line:
    Code:
    System.getProperty("com.nokia.mid.batterylevel");
    returns the battery level (in percentage). Anyway, on Sun WTK it'll return null.

    For System properties reference see this page:

    http://wiki.forum.nokia.com/index.ph...tem_properties

    Pit

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    16

    Re: Get Battery Level in J2ME

    Works for me.
    Thanks

Similar Threads

  1. Notification for change in battery level
    By venunet in forum Symbian
    Replies: 4
    Last Post: 2009-05-21, 08:43
  2. Detecting battery level with Javaphone API
    By cassioli in forum Mobile Java General
    Replies: 17
    Last Post: 2007-03-19, 20:16
  3. How to read battery level in J2ME?
    By cassioli in forum Mobile Java General
    Replies: 4
    Last Post: 2007-02-01, 20:19
  4. battery level and Network strength using j2me
    By renjithptvm in forum Mobile Java General
    Replies: 1
    Last Post: 2006-10-27, 19:00
  5. 3100 and wrong battery charge level
    By vastar in forum General Development Questions
    Replies: 0
    Last Post: 2004-06-10, 06:29

Posting Permissions

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