Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Pulsar » why this jar created by pulsar is invalid on my nokia 5800
why this jar created by pulsar is invalid on my nokia 5800 [message #535321] Sat, 22 May 2010 09:44 Go to next message
negito Missing name is currently offline negito Missing nameFriend
Messages: 4
Registered: May 2010
Junior Member
The followings are the content in the Application Descriptor
MIDlet-Version: 1.0.0
MIDlet-Vendor: MIDlet Suite Vendor
MIDlet-Jar-URL: GetFromUrl.jar
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.1
MIDlet-Name: GetFromUrl MIDlet Suite

The following is the .mtj file
<?xml version="1.0" encoding="UTF-8"?>
<mtjMetadata jad="GetFromUrl.jad" version="1.1.0.v200909181641">
<device group="MOTODEV SDK for Java(TM) ME 3.x" name="QWERTY"/>
<signing projectSpecific="false" signProject="false">
<alias/>
</signing>
<configurations>
<configuration active="false" name="QWERTY">
<device group="MOTODEV SDK for Java(TM) ME 3.x" name="QWERTY"/>
<symbolSet name="QWERTY">
<symbol name="jsr177_pki.jar" value="1.0"/>
<symbol name="screen.isColor" value="true"/>
<symbol name="MMAPI" value="1.1"/>
<symbol name="MOTO3D" value="1.0"/>
<symbol name="MOTBRC" value="1.0"/>
<symbol name="JSR75FILE" value="1.0"/>
<symbol name="screen.bitDepth" value="16"/>
<symbol name="JSR82" value="1.0"/>
<symbol name="JSR226" value="1.0"/>
<symbol name="MIDP" value="2.0"/>
<symbol name="CLDC" value="1.1"/>
<symbol name="JSR179" value="1.0"/>
<symbol name="WMA" value="2.0"/>
<symbol name="jsr177_jcrmi.jar" value="1.0"/>
<symbol name="JSR172" value="1.0"/>
<symbol name="jsr177_crypto.jar" value="1.0"/>
<symbol name="screen.width" value="320"/>
<symbol name="JSR177_APDU" value="1.0"/>
<symbol name="JSR238" value="1.0"/>
<symbol name="screen.isTouch" value="false"/>
<symbol name="JSR239" value="1.0"/>
<symbol name="JSR211" value="1.0"/>
<symbol name="JSR234" value="1.1"/>
<symbol name="JSR75PIMENH" value="1.0"/>
<symbol name="MOTOSCALEIMAGEENH" value="1.0"/>
<symbol name="JSR184" value="1.0"/>
<symbol name="MOTFUNLIGHT" value="1.0"/>
<symbol name="JSR180" value="1.0"/>
<symbol name="screen.height" value="240"/>
</symbolSet>
</configuration>
<configuration active="true" name="TOUCH">
<device group="MOTODEV SDK for Java(TM) ME 3.x" name="TOUCH"/>
<symbolSet name="TOUCH">
<symbol name="jsr177_pki.jar" value="1.0"/>
<symbol name="MMAPI" value="1.1"/>
<symbol name="screen.isColor" value="true"/>
<symbol name="MOTO3D" value="1.0"/>
<symbol name="screen.bitDepth" value="18"/>
<symbol name="JSR75FILE" value="1.0"/>
<symbol name="MOTBRC" value="1.0"/>
<symbol name="JSR82" value="1.0"/>
<symbol name="JSR226" value="1.0"/>
<symbol name="MIDP" value="2.0"/>
<symbol name="CLDC" value="1.1"/>
<symbol name="JSR179" value="1.0"/>
<symbol name="WMA" value="2.0"/>
<symbol name="jsr177_jcrmi.jar" value="1.0"/>
<symbol name="JSR172" value="1.0"/>
<symbol name="jsr177_crypto.jar" value="1.0"/>
<symbol name="screen.width" value="240"/>
<symbol name="JSR177_APDU" value="1.0"/>
<symbol name="JSR238" value="1.0"/>
<symbol name="screen.isTouch" value="true"/>
<symbol name="JSR239" value="1.0"/>
<symbol name="JSR211" value="1.0"/>
<symbol name="JSR234" value="1.1"/>
<symbol name="JSR75PIMENH" value="1.0"/>
<symbol name="MOTOSCALEIMAGEENH" value="1.0"/>
<symbol name="JSR184" value="1.0"/>
<symbol name="MOTFUNLIGHT" value="1.0"/>
<symbol name="JSR180" value="1.0"/>
<symbol name="screen.height" value="320"/>
</symbolSet>
</configuration>
</configurations>
</mtjMetadata>

The following is the code
package myj2me;

import java.io.IOException;
import java.io.InputStream;

import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.TextBox;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class GetFromUrl extends MIDlet {
private StringBuffer content;
private Display display;
private TextBox textBox;

public GetFromUrl() {
display = Display.getDisplay( this );
content = new StringBuffer( " " );
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub

}

protected void pauseApp() {
// TODO Auto-generated method stub

}

protected void startApp() throws MIDletStateChangeException {
String url = "http://javacourse.com/hello.txt";
try {
getFromUrl( url );
} catch (IOException e) {
Alert alert
= new Alert( "IO Alert",
"Failed to get content from URL: \r\n"
+ url + "\r\nReason: " + e.getMessage(),
null, AlertType.ERROR );
display.vibrate( 10000 );
alert.setTimeout( 10000 );
}

textBox = new TextBox( "GetFromUrl", content.toString(), 10000, 0 );
display.setCurrent( textBox );
}

private void getFromUrl( String url ) throws IOException
{
content.delete( 0, content.length() );

StreamConnection sc = null;
InputStream is = null;
try {
sc = ((StreamConnection)Connector.open(url));
is = sc.openInputStream();
int c;
while( ( c = is.read() ) >= 0 )
{
content.append( (char) c );
}
}
finally
{
if( null != sc ) {
sc.close();
}
if( null != is ) {
is.close();
}
}
}

}
Re: why this jar created by pulsar is invalid on my nokia 5800 [message #535439 is a reply to message #535321] Sun, 23 May 2010 14:34 Go to previous message
negito Missing name is currently offline negito Missing nameFriend
Messages: 4
Registered: May 2010
Junior Member
I found the reason. In the Application Descriptor, there is no the following text in the first line.
MIDlet-1: MIDlet GetFromUrl,,myj2me.GetFromUrl
When I added this line, and regenerated the package, it works on my nokia 5800.
Previous Topic:J2ME x Java ME
Next Topic:why this jar created by pulsar is invalid on my nokia 5800
Goto Forum:
  


Current Time: Sun Dec 21 13:41:38 GMT 2014

Powered by FUDForum. Page generated in 0.01563 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software