This program is basically the HelloWorld application and I'm trying to retrieve the battery level by way of getBatteryLevel() to bnum. I'm pretty unaware of why I get the "Cannot find symbol area" seeing as I imported the needed classes supposedly and it only returns a int, but here it goes:
Code:
/*
* InfoProgram.java
*
* © <your company here>, 2003-2005
* Confidential and proprietary.
*/
package src;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.system.RadioInfo.*;
import net.rim.device.api.system.DeviceInfo;
/**
*
*/
class InfoProgram extends UiApplication
{
public static void main(String[] args)
{
InfoProgram App = new InfoProgram();
App.enterEventDispatcher();
}
public InfoProgram()
{
pushScreen(new InfoProgramScreen());
}
}
final class InfoProgramScreen extends MainScreen
{
public InfoProgramScreen()
{
super();
LabelField title = new LabelField("InfoProgram", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
setTitle(title);
int bnum = getBatteryLevel();
add(new RichTextField("Battery Level: "+bnum));
}
public boolean onClose()
{
Dialog.alert("Goodbye!");
System.exit(0);
return true;
}
}