Discussion:
Need to set emulator in J2ME platform to MIDP 1.0
Hugh Beyer
2005-03-04 22:45:27 UTC
Permalink
I'm having a terrible time with our mobile app-it needs to run on MIDP 1.0
devices, but all the Nokia development platforms I can find for some reason
insist that your app be tagged MIDP 2.0. I'm pursuing that question on their
forums, but I'm thinking there must be a way to spoof the emulators-some
property or setting that would allow me to redefine it as allowing MIDP 1.0.
So far, I've found various references to MIDP 2.0 in .xml and .properties
files and set them to 1.0 but so far, nothing convinces NetBeans to make the
change. I have been removing the platform from NetBeans and then adding it
back in again. NetBeans scans the platform and then cheerfully announces it
supports 2.0.

Any thoughts on how I can do this?



Hugh



Hugh R. Beyer, CTO
InContext
Ph: 603 966-7188
Email: ***@incent.com
Martin Ryzl
2005-03-06 19:01:26 UTC
Permalink
Well, if an SDK says it is MIDP 2.0 it means it provides classpath
with MIDP 2.0 classes. You can compile and run MIDP 1.0 with a MIDP
2.0 SDK as it is backward compatible.

In NetBeans, if an SDK is MIDP 2.0 only you still can change a propery
of the application descriptor/manifest - go to project's properties |
Application Descriptor | Attributes | Add | choose MicroEdition-Profile
| and set it to MIDP-1.0.

The only problem is that you have to check whether you are not using
MIDP 2.0 classes yourself because IDE is using SDK's classpath for
code completion and compilation and that classpath is unfortunately
MIDP 2.0.

-Martin
I’m having a terrible time with our mobile app—it needs to run on MIDP
1.0 devices, but all the Nokia development platforms I can find for some
reason insist that your app be tagged MIDP 2.0. I’m pursuing that
question on their forums, but I’m thinking there must be a way to spoof
the emulators—some property or setting that would allow me to redefine
it as allowing MIDP 1.0. So far, I’ve found various references to MIDP
2.0 in .xml and .properties files and set them to 1.0 but so far,
nothing convinces NetBeans to make the change. I have been removing the
platform from NetBeans and then adding it back in again… NetBeans scans
the platform and then cheerfully announces it supports 2.0.
Any thoughts on how I can do this?
Hugh
*Hugh R. Beyer, CTO
InContext
Ph: 603 966-7188
--
_______________________________________________________
Martin Ryzl <***@sun.com>
Sun Microsystems, Inc., Prague (GMT+1)
Phone: +420 233 009 130 (x49130), Fax: +420 233 009 299
Hugh Beyer
2005-03-07 15:13:56 UTC
Permalink
I know this is how it *should* work. But on all the Nokia emulators, the
MIDP 1.0 button is grayed out. I'd like to know what switch or property is
NetBeans using to decide whether to gray out that button? If I can find the
right switch I can spoof it. Otherwise, NetBeans insists on creating a 2.0
MIDlet and then I have a lot of hand work to undo it. (I'm not using any
MIDP 2.0 features.)

Thanks.

Hugh

-----Original Message-----
From: Martin Ryzl [mailto:***@Sun.COM]
Sent: Sunday, March 06, 2005 2:01 PM
To: ***@netbeans.org
Subject: [nbusers] Re: Need to set emulator in J2ME platform to MIDP 1.0

Well, if an SDK says it is MIDP 2.0 it means it provides classpath
with MIDP 2.0 classes. You can compile and run MIDP 1.0 with a MIDP
2.0 SDK as it is backward compatible.

In NetBeans, if an SDK is MIDP 2.0 only you still can change a propery
of the application descriptor/manifest - go to project's properties |
Application Descriptor | Attributes | Add | choose MicroEdition-Profile
| and set it to MIDP-1.0.

The only problem is that you have to check whether you are not using
MIDP 2.0 classes yourself because IDE is using SDK's classpath for
code completion and compilation and that classpath is unfortunately
MIDP 2.0.

-Martin
Post by Hugh Beyer
I'm having a terrible time with our mobile app-it needs to run on MIDP
1.0 devices, but all the Nokia development platforms I can find for some
reason insist that your app be tagged MIDP 2.0. I'm pursuing that
question on their forums, but I'm thinking there must be a way to spoof
the emulators-some property or setting that would allow me to redefine
it as allowing MIDP 1.0. So far, I've found various references to MIDP
2.0 in .xml and .properties files and set them to 1.0 but so far,
nothing convinces NetBeans to make the change. I have been removing the
platform from NetBeans and then adding it back in again. NetBeans scans
the platform and then cheerfully announces it supports 2.0.
Any thoughts on how I can do this?
Hugh
*Hugh R. Beyer, CTO
InContext
Ph: 603 966-7188
--
_______________________________________________________
Martin Ryzl <***@sun.com>
Sun Microsystems, Inc., Prague (GMT+1)
Phone: +420 233 009 130 (x49130), Fax: +420 233 009 299
Martin Ryzl
2005-03-07 17:12:47 UTC
Permalink
bin/emulator -version returns list of supported configurations
and profiles. IDE also analyses classpath jar files.

Anyway, are there any other issues than the "MicroEdition-Profile"
attribute in jad/manifest? If this is the only issue - see how-to below
in my previous post.

Regards,
-Martin
Post by Hugh Beyer
I know this is how it *should* work. But on all the Nokia emulators, the
MIDP 1.0 button is grayed out. I'd like to know what switch or property is
NetBeans using to decide whether to gray out that button? If I can find the
right switch I can spoof it. Otherwise, NetBeans insists on creating a 2.0
MIDlet and then I have a lot of hand work to undo it. (I'm not using any
MIDP 2.0 features.)
Thanks.
Hugh
-----Original Message-----
Sent: Sunday, March 06, 2005 2:01 PM
Subject: [nbusers] Re: Need to set emulator in J2ME platform to MIDP 1.0
Well, if an SDK says it is MIDP 2.0 it means it provides classpath
with MIDP 2.0 classes. You can compile and run MIDP 1.0 with a MIDP
2.0 SDK as it is backward compatible.
In NetBeans, if an SDK is MIDP 2.0 only you still can change a propery
of the application descriptor/manifest - go to project's properties |
Application Descriptor | Attributes | Add | choose MicroEdition-Profile
| and set it to MIDP-1.0.
The only problem is that you have to check whether you are not using
MIDP 2.0 classes yourself because IDE is using SDK's classpath for
code completion and compilation and that classpath is unfortunately
MIDP 2.0.
-Martin
Post by Hugh Beyer
I'm having a terrible time with our mobile app-it needs to run on MIDP
1.0 devices, but all the Nokia development platforms I can find for some
reason insist that your app be tagged MIDP 2.0. I'm pursuing that
question on their forums, but I'm thinking there must be a way to spoof
the emulators-some property or setting that would allow me to redefine
it as allowing MIDP 1.0. So far, I've found various references to MIDP
2.0 in .xml and .properties files and set them to 1.0 but so far,
nothing convinces NetBeans to make the change. I have been removing the
platform from NetBeans and then adding it back in again. NetBeans scans
the platform and then cheerfully announces it supports 2.0.
Any thoughts on how I can do this?
Hugh
*Hugh R. Beyer, CTO
InContext
Ph: 603 966-7188
--
_______________________________________________________
Martin Ryzl <***@sun.com>
Sun Microsystems, Inc., Prague (GMT+1)
Phone: +420 233 009 130 (x49130), Fax: +420 233 009 299
Hugh Beyer
2005-03-08 20:49:41 UTC
Permalink
Ah. You're saying I can *override* the platform setting. Great, that works.

Thanks.

-----Original Message-----
From: Martin Ryzl [mailto:***@Sun.COM]
Sent: Monday, March 07, 2005 12:13 PM
To: ***@netbeans.org
Subject: [nbusers] Re: Need to set emulator in J2ME platform to MIDP 1.0

bin/emulator -version returns list of supported configurations
and profiles. IDE also analyses classpath jar files.

Anyway, are there any other issues than the "MicroEdition-Profile"
attribute in jad/manifest? If this is the only issue - see how-to below
in my previous post.

Regards,
-Martin
Post by Hugh Beyer
I know this is how it *should* work. But on all the Nokia emulators, the
MIDP 1.0 button is grayed out. I'd like to know what switch or property is
NetBeans using to decide whether to gray out that button? If I can find the
right switch I can spoof it. Otherwise, NetBeans insists on creating a 2.0
MIDlet and then I have a lot of hand work to undo it. (I'm not using any
MIDP 2.0 features.)
Thanks.
Hugh
-----Original Message-----
Sent: Sunday, March 06, 2005 2:01 PM
Subject: [nbusers] Re: Need to set emulator in J2ME platform to MIDP 1.0
Well, if an SDK says it is MIDP 2.0 it means it provides classpath
with MIDP 2.0 classes. You can compile and run MIDP 1.0 with a MIDP
2.0 SDK as it is backward compatible.
In NetBeans, if an SDK is MIDP 2.0 only you still can change a propery
of the application descriptor/manifest - go to project's properties |
Application Descriptor | Attributes | Add | choose MicroEdition-Profile
| and set it to MIDP-1.0.
The only problem is that you have to check whether you are not using
MIDP 2.0 classes yourself because IDE is using SDK's classpath for
code completion and compilation and that classpath is unfortunately
MIDP 2.0.
-Martin
Post by Hugh Beyer
I'm having a terrible time with our mobile app-it needs to run on MIDP
1.0 devices, but all the Nokia development platforms I can find for some
reason insist that your app be tagged MIDP 2.0. I'm pursuing that
question on their forums, but I'm thinking there must be a way to spoof
the emulators-some property or setting that would allow me to redefine
it as allowing MIDP 1.0. So far, I've found various references to MIDP
2.0 in .xml and .properties files and set them to 1.0 but so far,
nothing convinces NetBeans to make the change. I have been removing the
platform from NetBeans and then adding it back in again. NetBeans scans
the platform and then cheerfully announces it supports 2.0.
Any thoughts on how I can do this?
Hugh
*Hugh R. Beyer, CTO
InContext
Ph: 603 966-7188
--
_______________________________________________________
Martin Ryzl <***@sun.com>
Sun Microsystems, Inc., Prague (GMT+1)
Phone: +420 233 009 130 (x49130), Fax: +420 233 009 299
Martin Ryzl
2005-03-09 21:46:21 UTC
Permalink
Yes. Good to hear it works for you now :).

-Martin
Post by Hugh Beyer
Ah. You're saying I can *override* the platform setting. Great, that works.
Thanks.
-----Original Message-----
Sent: Monday, March 07, 2005 12:13 PM
Subject: [nbusers] Re: Need to set emulator in J2ME platform to MIDP 1.0
bin/emulator -version returns list of supported configurations
and profiles. IDE also analyses classpath jar files.
Anyway, are there any other issues than the "MicroEdition-Profile"
attribute in jad/manifest? If this is the only issue - see how-to below
in my previous post.
Regards,
-Martin
Post by Hugh Beyer
I know this is how it *should* work. But on all the Nokia emulators, the
MIDP 1.0 button is grayed out. I'd like to know what switch or property is
NetBeans using to decide whether to gray out that button? If I can find
the
Post by Hugh Beyer
right switch I can spoof it. Otherwise, NetBeans insists on creating a 2.0
MIDlet and then I have a lot of hand work to undo it. (I'm not using any
MIDP 2.0 features.)
Thanks.
Hugh
-----Original Message-----
Sent: Sunday, March 06, 2005 2:01 PM
Subject: [nbusers] Re: Need to set emulator in J2ME platform to MIDP 1.0
Well, if an SDK says it is MIDP 2.0 it means it provides classpath
with MIDP 2.0 classes. You can compile and run MIDP 1.0 with a MIDP
2.0 SDK as it is backward compatible.
In NetBeans, if an SDK is MIDP 2.0 only you still can change a propery
of the application descriptor/manifest - go to project's properties |
Application Descriptor | Attributes | Add | choose MicroEdition-Profile
| and set it to MIDP-1.0.
The only problem is that you have to check whether you are not using
MIDP 2.0 classes yourself because IDE is using SDK's classpath for
code completion and compilation and that classpath is unfortunately
MIDP 2.0.
-Martin
Post by Hugh Beyer
I'm having a terrible time with our mobile app-it needs to run on MIDP
1.0 devices, but all the Nokia development platforms I can find for some
reason insist that your app be tagged MIDP 2.0. I'm pursuing that
question on their forums, but I'm thinking there must be a way to spoof
the emulators-some property or setting that would allow me to redefine
it as allowing MIDP 1.0. So far, I've found various references to MIDP
2.0 in .xml and .properties files and set them to 1.0 but so far,
nothing convinces NetBeans to make the change. I have been removing the
platform from NetBeans and then adding it back in again. NetBeans scans
the platform and then cheerfully announces it supports 2.0.
Any thoughts on how I can do this?
Hugh
*Hugh R. Beyer, CTO
InContext
Ph: 603 966-7188
--
_______________________________________________________
Martin Ryzl <***@sun.com>
Sun Microsystems, Inc., Prague (GMT+1)
Phone: +420 233 009 130 (x49130), Fax: +420 233 009 299
Daniel Garcia
2005-03-08 13:48:50 UTC
Permalink
I am using Netbeans 4.0 with the J2ME MIDP plug in.
And the application I developed while running it on the Java Emulator
works fine,
when I run the prc file on my Palm Tungsten C an error shows up when I
use an Alert and add a button to it.
The error says:

Alert does not accept commands - java.lang.IllegalStateException.

But when I read the specifications of the Alert class, it is clearly
shown that I am allow to do so

public void addCommand(Command cmd).

What is going on?
Is the VM on my Tungsten C too old that is not supporting it? Or what?

Thanks

Daniel
Martin Ryzl
2005-03-09 21:44:22 UTC
Permalink
Post by Daniel Garcia
public void addCommand(Command cmd)
Commands are not allowed on Alerts, so this method will always throw IllegalStateException whenever it is called.
addCommand in class Displayable
cmd - the Command
IllegalStateException - always
it seems that the Palm VM support MIDP 1.0 only.

-Martin
Post by Daniel Garcia
I am using Netbeans 4.0 with the J2ME MIDP plug in.
And the application I developed while running it on the Java Emulator
works fine,
when I run the prc file on my Palm Tungsten C an error shows up when I
use an Alert and add a button to it.
Alert does not accept commands - java.lang.IllegalStateException.
But when I read the specifications of the Alert class, it is clearly
shown that I am allow to do so
public void addCommand(Command cmd).
What is going on?
Is the VM on my Tungsten C too old that is not supporting it? Or what?
Thanks
Daniel
--
_______________________________________________________
Martin Ryzl <***@sun.com>
Sun Microsystems, Inc., Prague (GMT+1)
Phone: +420 233 009 130 (x49130), Fax: +420 233 009 299
David Strupl
2005-03-09 21:56:30 UTC
Permalink
Post by Martin Ryzl
it seems that the Palm VM support MIDP 1.0 only.
IBM Java VM v 2.2.012 for Palm Tungsten C (currently installed on my
palm device) should be fully MIDP 2.0 compliant (IBM claim).

Maybe he should upgrade?

Best,

David

Mr. Wolf
2005-03-09 11:25:05 UTC
Permalink
Post by Hugh Beyer
I know this is how it *should* work. But on all the Nokia emulators, the
MIDP 1.0 button is grayed out. I'd like to know what switch or property is
NetBeans using to decide whether to gray out that button? If I can find the
right switch I can spoof it. Otherwise, NetBeans insists on creating a 2.0
MIDlet and then I have a lot of hand work to undo it. (I'm not using any
MIDP 2.0 features.)
This might be usefull. (Call me lazy if you will, its just a shell
script, not a program).

---snip [change.sh] ---
#!/bin/sh
#Usage: change.sh name
#where name is basename of jar/jad file without extension
sed -e "s/MIDP-2.0/MIDP-1.0/" <$1.jad >$1.tmp
mv $1.tmp $1.jad

unzip $1.jar META-INF/MANIFEST.MF
sed -e "s/MIDP-2.0/MIDP-1.0/" <META-INF/MANIFEST.MF >META-
INF/MANIFEST.tmp
mv META-INF/MANIFEST.tmp META-INF/MANIFEST.MF
zip -f $1.jar META-INF/MANIFEST.MF
---snip---
Post by Hugh Beyer
Thanks.
Hugh
--
Syren Baran
Sun certified mobile application developer for the Java2 plattform, Micro Edition
Nelseestr. 23
63739 Aschaffenburg
Germany, DE
Fon: +49 6021 909489
Mobil: +49 176 29486949
Email: ***@wolfs-lair.de
Martin Ryzl
2005-03-09 21:49:06 UTC
Permalink
no need for such solution - see my other post ;-)

-Martin
Post by Mr. Wolf
Post by Hugh Beyer
I know this is how it *should* work. But on all the Nokia emulators, the
MIDP 1.0 button is grayed out. I'd like to know what switch or property is
NetBeans using to decide whether to gray out that button? If I can find the
right switch I can spoof it. Otherwise, NetBeans insists on creating a 2.0
MIDlet and then I have a lot of hand work to undo it. (I'm not using any
MIDP 2.0 features.)
This might be usefull. (Call me lazy if you will, its just a shell
script, not a program).
---snip [change.sh] ---
#!/bin/sh
#Usage: change.sh name
#where name is basename of jar/jad file without extension
sed -e "s/MIDP-2.0/MIDP-1.0/" <$1.jad >$1.tmp
mv $1.tmp $1.jad
unzip $1.jar META-INF/MANIFEST.MF
sed -e "s/MIDP-2.0/MIDP-1.0/" <META-INF/MANIFEST.MF >META-
INF/MANIFEST.tmp
mv META-INF/MANIFEST.tmp META-INF/MANIFEST.MF
zip -f $1.jar META-INF/MANIFEST.MF
---snip---
Post by Hugh Beyer
Thanks.
Hugh
--
_______________________________________________________
Martin Ryzl <***@sun.com>
Sun Microsystems, Inc., Prague (GMT+1)
Phone: +420 233 009 130 (x49130), Fax: +420 233 009 299
Mr. Wolf
2005-03-09 11:07:46 UTC
Permalink
Post by Hugh Beyer
I know this is how it *should* work. But on all the Nokia emulators, the
MIDP 1.0 button is grayed out. I'd like to know what switch or property is
NetBeans using to decide whether to gray out that button? If I can find the
right switch I can spoof it. Otherwise, NetBeans insists on creating a 2.0
MIDlet and then I have a lot of hand work to undo it. (I'm not using any
MIDP 2.0 features.)
Had that problem as well already. Only found the dirty solution to edit
both the jad file and the META-INF/MANIFEST.MF file in the jar.
The jar file can be opened with any zip-tool, just extract, edit and
refresh the file.
Post by Hugh Beyer
Thanks.
Hugh
--
Syren Baran
Sun certified mobile application developer for the Java2 plattform, Micro Edition
Nelseestr. 23
63739 Aschaffenburg
Germany, DE
Fon: +49 6021 909489
Mobil: +49 176 29486949
Email: ***@wolfs-lair.de
Loading...