s rolands

Greenhorn
+ Follow
since Jun 16, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by s rolands

Such a simple question, but nobody can answer it? Guess I am just to much of a "newbie".
16 years ago
Hi

Thanks for the reply. I think you are right about it being null, but , I DO know for a fact this phone can do this. (I have a application that does it on my phone). I think the problem is I forgot to Install the SDK for my phone. I have done that but it now needs to be added to my WTK somehow? Here's more info :

I have installed WTK, and it has been working but I realized I forgot to add the iden SDK for my motorola phone. I installed the SDK but I assume I need to link the files to WTK somehow?

What I am wanting to do :

----------------------------------



The SDK has a class file called StatusManager which can retrieve phone battery level...

From documentation:
"Field Detail
BATTERY_LEVEL

public static final int BATTERY_LEVEL

This is the value passed to the status manager to retrive the battery levels

The return value is in the range of [0 - 3] with 0 being no charge and 3 being a full battery.
BATTERY_LEVEL has a value of 0"

QUESTION IS: Where do I put the SDK files so WTK can use them? I am lost here.
I found the StatusManager.class file in :
C:\Program Files\Motorola\iDEN SDK for J2ME (MIDP 2_0)\lib\i730\com\mot\iden\device\

Can someone give me the detailed process of using the SDK with WTK... please??

Do I use the StatusManager.class file alone with my Midlet... or?
16 years ago
Can anyone see whats wrong with this... It builds ok in WTK 2.5.1 but when loaded to i415 Motorola phone it says "Unhandled Exception"

Just trying to get the battery level from the phone. I KNOW this CAN be done on Motorola i415 but I just cannot seem to figure it out. 3 days is enough searching... please help!

Code:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.location.*;



public class HelloMidp extends MIDlet implements CommandListener {
private Command exitCommand;



Display display;
Form mainForm;

public HelloMidp () {
exitCommand = new Command("Exit", Command.EXIT, 1);
mainForm = new Form ("HelloMidp");
String batt = System.getProperty("batterylevel");
mainForm.append (batt);




}

protected void startApp()
{
mainForm.addCommand(exitCommand);
mainForm.setCommandListener(this);
Display.getDisplay(this).setCurrent(mainForm);

}
/**
* This method is called to notify the MIDlet to enter a paused
* state. The MIDlet should use this opportunity to release
* shared resources.
*/
protected void pauseApp() {}

/**
* If the MIDlet was using resources, it should release
* them in this method.
*/
protected void destroyApp(boolean bool) {}

public void commandAction(Command cmd, Displayable disp)
{
if (cmd == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
[ June 16, 2007: Message edited by: Bear Bibeault ]
16 years ago