/* WhatIsMyPIN.java
© Tensioncore Administration Services, 2011
Confidential and proprietary.*/
package com.sample;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.system.*;
import net.rim.device.api.system.DeviceInfo.*;
//blackberry applications that provide a GUI must extend UiApplication
public class WhatIsMyIP extends UiApplication
{
public static void main(Strings[] args)
{
//create a new instance of the app and start the application on the event thread
WhatIsMyPIN theApp = new WhatIsMyPIN();
theApp.enterEventDispatcher();
}
public WhatIsMyPIN()
{
//displays a new screen
pushScreen(new WhatIsMyPINScreen());
}
public static DeviceId()
{
//retrieves Device PIN
getDeviceId DeviceId = new getDeviceId();
}
}
//create a new screen that extends MainScreen which provides native app appearance.
final class WhatIsMyPINScreen extends MainScreen
{
public WhatIsMyPINScreen()
{
//invoke the MainScreen constructor
super();
//add a title to the screen
LabelField title = new LabelField("WhatIsMyPIN?", LabelField.ELLIPSIS);
setTitle (title);
//getDeviceId shows the PIN
add(new RichTextField(DeviceId));
return;
}
//override the onClose() method to display a dialog box to the user with "Goodbye" when the application closes
public boolean onClose()
{
Dialog.alert("Goodbye!");
System.exit(0);
return true;
}
}
Am I simply using return incorrectly, or is there a lot more that needs to be fixed/changed?
I've tried reading documentation for "getDeviceId()" and it's telling me to use "public static int" for it, which confuses me, because BlackBerry PINs contain letters as well as numbers...

New Topic/Question
Reply



MultiQuote






|