2009年10月30日 星期五
Mobile Tips Tricks Hacks Cracks Reviews: Get a Mobile Dictionary for Nokia Phones
Yes!I install it on my Nokia 5800. It's cool and I will post an Chinese article about this software.
2009年10月29日 星期四
3 言 2 語: SmartCam and Nokia 5800
This is useful for my nokia 5800. I can put the video on my blog.
It will be very cool.
NetBeans Java ME CLDC/MIDP Development Quick Start Guide
This is from NetBeans Java ME CLDC/MIDP Development Quick Start Guide,but some is old. So I update it here.
his document guides you through the basic steps of using NetBeans IDE to create a Java™ Platform, Micro Edition (Java™ ME platform), Mobile Information Device Profile (MIDP) application and is designed to get you started with mobile application development as quickly as possible. The tutorial takes you through some of the basic steps of working with the project system. We show you two ways to create a Java ME MIDP project named "MyHello" that displays the text "Make my day" in a device emulator. This tutorial prepares you to use other IDE features for developing CLDC/MIDP applications.
Contents
- Tutorial Requirements
- Creating an Application in the Visual Mobile Designer
- Creating Applications in the Source Editor
- Next Steps
Requirements
To complete this tutorial, you need the following software and resources:
Software or Resource
Version Required
NetBeans IDE with Java ME
Version 6.7
Java Development Kit (JDK)
Version 6 or
version 5
For help getting your system set up, please see the installation instructions.
MacOS users should refer to the MIDP Development on Mac OS Set Up Guide.
Creating a MIDP Application Using the Visual Mobile Designer
The NetBeans IDE provides a wizard that enables you to quickly create a MIDP project. When creating the project, you can choose to develop your application in the Visual Mobile Designer (VMD) or in the Source Code Editor. Using the Visual Mobile Designer gives you the ability to graphically plan out the flow of the application and design the screens the application uses. The designer automatically creates the code for the application.
Creating a MIDP/CLDC Application
- Choose File > New Project (Ctrl+Shift+N). Under Categories, select Java ME. Under Projects, select Moblie Application and click Next.
- Enter
MyHello
in the Project Name field. Use the default Project Location, or change it to the directory you prefer on your system. In this tutorial we refer to this directory as D:\source\java. - Check the Set as Main Project and Create Hello MIDlet check boxes (both are checked by default). Click Next.
- Select the Java(TM) Platform Micro Edition SDK 3.0 as the Emulator Platform and use the remaining defaults. Click Next.
- Click Finish. The IDE creates the
D:\source\java\MyHello
project folder. The project folder contains all of your sources and project metadata, such as the project Ant script. The application itself is displayed in the Flow Design window of the Visual Mobile Designer.Note: for a complete description of the available palette components, please refer to the Visual Mobile Designer Palette Reference.
Editing the Java Source Code
Now let's edit the text displayed by the MIDlet.
- Click on Screen. This opens the Screen Designer window, and displays the Device screen, which is the only screen available in the application.
- In the Palette window, click Text Field and replace the text “Hello, World!”into "Make my day".
- The Screen view displays a preview of the text you enter in the Text Field.
Compiling and Running the Project
- Choose Run > Run Main Project (F6) from the Run menu. Follow the progress of the project compilation in the Output window. Note that the
HelloMIDlet.java
file is built before it is executed. A device emulator opens to display the results of the executed MIDlet. The default device emulator isClamshellCldcPhone1
. - In the device emulator window, click on the button below the Launch command. The device emulator launches the MIDlet and displays the text you entered in the source code.
- Click on the button to close the MIDlet. Then click on the button in the upper right corner of the device to close the emulator window.
Creating a MIDP Application Using the Source Editor
Using the Source Code Editor, you manually create the code for your MIDlets. Creating code in the Source Code Editor gives you more flexibility when editing the code, and enables you to insert preprocessor code blocks. Next we create the MyHello
application using the New Project and New File wizards, and complete the code using the Source Editor.
Creating a New Java ME MIDP Project
- Choose File > New Project (Ctrl-Shift-N). Under Categories, select Java ME. Under Projects, select Moblie Application and click Next.
- Enter
MyHelloMIDlet
in the Project Name field (note that "MID" is in upper case letters). Use the default Project Location, or change it to the directory you prefer on your system. We refer to this directory as D:\source\java in this tutorial. - Check the Set as Main Project checkbox and remove the check from the Create Hello MIDlet checkbox. Click Next.
- Select the Java(TM) Platform Micro Edition SDK 3.0 as the Emulator Platform and use the remaining defaults. Click Next.
- Expand "Configuration templates provided by installed CLDC platforms" and "Java(TM) Platform Micro Edition SDK 3.0" folders. Check the boxes next to each of the configurations. The IDE automatically creates a new project configuration for each template listed.
- Click Finish. The IDE creates the
D:\source\java\MyHelloMIDlet
project folder. The project folder contains all of your sources and project metadata, such as the project Ant script. - Right-click the
MyHelloMIDlet
node in the Explorer window and choose New > MIDlet - Enter
HelloMIDlet
as the MIDlet name (note that "MID" is in upper case letters by default). Click Finish. TheHelloMIDlet.java
file is created and the source code is displayed in the IDE's Editor window. - Click in the Source Editor and change
public class HelloMIDlet extends MIDlet
to
public class HelloMIDlet
extends MIDlet implements javax.microedition.lcdui.CommandListener
{
- Add the following text before the
startApp()
method:
private void initialize() {
javax.microedition.lcdui.Display.getDisplay(this).setCurrent(get_helloTextBox());
}
public void commandAction(javax.microedition.lcdui.Command command, javax.microedition.lcdui.Displayable displayable) {
if (displayable == helloTextBox) {
if (command == exitCommand) {
javax.microedition.lcdui.Display.getDisplay(this).setCurrent(null);
destroyApp(true);
notifyDestroyed();
}
}
}
private javax.microedition.lcdui.TextBox get_helloTextBox() {
if (helloTextBox == null) {
helloTextBox = new javax.microedition.lcdui.TextBox(null, "Make My Day", 120, 0x0);
helloTextBox.addCommand(get_exitCommand());
helloTextBox.setCommandListener(this);
}
return helloTextBox;
}
private javax.microedition.lcdui.Command get_exitCommand() {
if (exitCommand == null) {
exitCommand = new javax.microedition.lcdui.Command("Exit", javax.microedition.lcdui.Command.EXIT,
1);
}
return exitCommand;
}
javax.microedition.lcdui.TextBox helloTextBox;
javax.microedition.lcdui.Command exitCommand;
- Add a line
initialize();
to thestartApp()
method, so it looks like the following:
public void startApp() {
initialize();
}
Editing the Java Source Code
Now let's add some text for our MIDlet to display.
- In the
get_helloTextBox()
method, replace the "test string" code with the text of your choice. For example, "Make my day."
Note: For a complete guide to using the Java Source Editor in NetBeans see Java Editing in NetBeans IDE.
Compiling and Running the Project
- Choose Run > Run Main Project (F6) from the Run menu. Follow the progress of the project compilation in the Output window. Note that the
HelloMIDlet.java
file is built before it is executed. A device emulator opens to display the results of the executed MIDlet. The default device emulator isClamshellCldcPhone1
. - In the device emulator window, click on the button below the Launch command. The device emulator launches the HelloMIDlet and displays the text you entered in the source code.
Night Walker: Change NetBeans IDE interface language
This parameter is very useful for me.
2009年10月6日 星期二
Making A Million Dollar
I look the site million dollar home page and say "wa". It is very cool.
2009年10月1日 星期四
pyDanny: Feedparser does not work with Google App Engine
Now may be Goole App Engine do not offer feedparser api to fetch feed.
I always get the errors:
No module named feedparser