开发者

j2me code for blackberry application to display battery level

开发者 https://www.devze.com 2023-01-04 18:55 出处:网络
How can I make a Blackberry applica开发者_开发百科tion display the battery level using J2ME?if you\'re developing a native cldc blackberry app i\'d rather use

How can I make a Blackberry applica开发者_开发百科tion display the battery level using J2ME?


if you're developing a native cldc blackberry app i'd rather use

net.rim.device.api.system.DeviceInfo.getBatteryLevel();

if you're developing MIDlet the only chance is to use the mobile sensor api.


You also can have it display in the titlebar if you are making an app for newer devices

StandardTitleBar TitleBar = new StandardTitleBar()
        //.addIcon("my_logo.png")
        .addTitle("App title")
        .addNotifications()
        .addNotifications()
        .addSignalIndicator();
        TitleBar.setPropertyValue(StandardTitleBar.PROPERTY_BATTERY_VISIBILITY,
                StandardTitleBar.BATTERY_VISIBLE_ALWAYS);
        setTitleBar(TitleBar);

PS, its also very nice for you to mark something as answered.

0

精彩评论

暂无评论...
验证码 换一张
取 消