Yritin tässä alkaa väsäämään MIDlettejä. Kokeilin ensin tehdä midletin Ktoolbar:illa... EI onnistunut. Väitti ettei ollut jotakin asennettuna vaikka juuri olin kaikki mikrobitin ohjeissa mainitut ohjelmat asentanut. Kokeilin kääntää koodin käsin javac:illa mutta antaa törkeästi erroreita.
Gamedev.net turoiaalista:
import javax.microedition.midlet.*;
public class Startup
extends MIDlet
{
/*
* Default constructor used by AMS to create an instance
* of our main MIDlet class.
*/
public Startup()
{
//Print message to console when Startup is constructed
System.out.println("Constructor: Startup()");
}
/*
* startApp() is called by the AMS after it has successfully created
* an instance of our MIDlet class. startApp() causes our MIDlet to
* go into a "Active" state.
*/
protected void startApp()
throws MIDletStateChangeException
{
//Print message to console when startApp() is called
System.out.println("startApp()");
}
/*
* destroyApp() is called by the AMS when the MIDlet is to be destroyed
*/
protected void destroyApp( boolean unconditional )
throws MIDletStateChangeException
{
}
/*
* pauseApp() is called by the AMS when the MIDlet should enter a paused
* state. This is not a typical "game" pause, but rater an environment pause.
* The most common example is an incoming phone call on the device,
* which will cause the pauseApp() method to be called. This allows
* us to perform the needed actions within our MIDlet
*/
protected void pauseApp()
{
}
}Siirrytõõn hakemistoon...
C:\Documents and Settings\uuseri\Omat tiedostot\java\eka\Startup.java:
1: package javax.microedition.lcdui does not exist
import javax.microedition.lcdui.*;
^
C:\Documents and Settings\uuseri\Omat tiedostot\java\eka\Startup.java:
4: cannot resolve symbol
symbol : class MIDlet
location: class Startup
extends MIDlet
^
C:\Documents and Settings\uuseri\Omat tiedostot\java\eka\Startup.java:
22: cannot resolve symbol
symbol : class MIDletStateChangeException
location: class Startup
throws MIDletStateChangeException
^
C:\Documents and Settings\uuseri\Omat tiedostot\java\eka\Startup.java:
32: cannot resolve symbol
symbol : class MIDletStateChangeException
location: class Startup
throws MIDletStateChangeException
^
4 errorsMinuakin kiinnostaa MIDletien ohjelmointi, kun tuli ostettua NGage QD. Missä Mikrobitissä tuo mainitsemasi juttu on?
Tämänkuun numerossa.
Lisää classpathiin joku puuttuva jar tai zip. Itselläni ainakin jotkut vanhat midlet luokat löytyivät classes.zip nimisestä paketista.
javac -cp .;classes.zip *.java
Eipä ole tuollaisia tiedostoja mulla...
Saint toimimaan!!! Olin asentanu väärän sdk:n.
Aihe on jo aika vanha, joten et voi enää vastata siihen.