wood burning stoves 2.0*
The moose likes Java Micro Edition and the fly likes install WMA RI into Sun one Studio Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "install WMA RI into Sun one Studio" Watch "install WMA RI into Sun one Studio" New topic
Author

install WMA RI into Sun one Studio

Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
Hi All,
I want to use Sun one studio 4 mobile edition for developing wireless applications for Nokia j2me enabled phones . However, i have no idea how can i install the wireless Messaging API into it.
Anyone out there got any idea ?

Thanks in advance.
Ying Hui


Regards,<br />Ying Hui
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Adding WMA RI to SunONE IDE is not easy. The RI itself is just a JAR file that can be added to classpath. But to run it on an emulator, you have to pass many runtime parameters (see WMA page). I am not sure how flexible SunONE's native build and execution utilities are.
I just run ANT inside SunONE to take care of my build process.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
hi there,
Can you tell me which WMA page should i refer to? Because most of the pages i read didn't tell bout the runtime parameter that i should pass. Second, where should i place the WMA jar file?
Thanks again!
Loh Ying Hui
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
You can download the WMA package from
http://java.sun.com/products/wma/
Download the PDF documentation and RI.
SunONE studio take every directory in your mounted "filesystem" as part of the classpath. So, just mount the WMA JAR file to your project "filesystem".
Or, if you can wait, I have an article discussing details of WMA in IBM developerWorks in Dec.
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
For instance, if my filesystem is under d:\myDirectory\MyPackage,
Where should i mount the WMA jar file ? Is it under d:\myDirectory ? The WMA i downloaded is a zipped file, so, should i load the other zipped file into the same dir as the WMA jar file as well ?
Yes, I will be hoping to read your article..and in the mean time, try to work this out.
thanx
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

Any other reference implementation Michael?
[ November 30, 2002: Message edited by: Ashik uzzaman ]

Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Ying Hui: You need to "mount" the JAR file in your "file system".
Ashik: There is only one "reference implementation". Device specific implementations are expected to come out when major device vendors come out with MIDP 2.0 devices (in Q2-Q3 2003).
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
IBM developerWorks finally published my tutorial article on WMA.
Enjoy!
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
Cool... Thanks a lot!
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
I have downloaded the sample coding in the document and I am using the Sun one studio toolkit to build it. Where should I specify the reference implementation's runtime properties ? I can't find any internal config file in the tool. And I am not running the application using command line..
Plz help. thanks.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Originally posted by Loh Ying Hui:
I have downloaded the sample coding in the document and I am using the Sun one studio toolkit to build it. Where should I specify the reference implementation's runtime properties ? I can't find any internal config file in the tool. And I am not running the application using command line..
Plz help. thanks.

OK, SunOne studio does have some problems with emulator command line options. Sorry, it just seems to be a limitation of the IDE.
That is why I was never a big fan of IDEs -- They automate a lot of things to make it easy for simple tasks. But when you need power and flexibility, they are often awkward to use ...
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
well, guess i'll have to go back to the manual way of running an emulator from the command prompt. :roll:
Another question i would like to ask, is it posible to run 2 emulators at the same time, one emulator sending a sms and another emulator receives it ? Thanks.
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
hi,
I received below error while trying to run the WMA tester source code. Is there any setting i missed out ? I've already added the required runtime properties in the internal.config file.
Besides that, i also have error while trying to access com.sun.midp.Configuration.getProperty(propName), the message i get is that there is no com.sun.midp.Configuration package.. What is wrong actually ?
Plz help! Thanks in advance.
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(+174)
at java.lang.Integer.parseInt(+6)
at com.sun.cldc.io.j2me.datagram.Protocol.getPort(+48)
at com.sun.cldc.io.j2me.datagram.Protocol.open(+66)
at com.sun.cldc.io.ConnectionBase.openPrim(+7)
at com.sun.midp.io.InternalConnector.openPrim(+231)
at com.sun.midp.io.InternalConnector.open(+26)
at javax.microedition.io.Connector.open(+6)
at javax.microedition.io.Connector.open(+6)
at javax.microedition.io.Connector.open(+5)
at com.sun.midp.io.j2me.sms.DatagramImpl.open(+53)
at com.sun.midp.io.j2me.sms.Protocol.<init>(+236)
at java.lang.Class.runCustomCode(+0)
at com.sun.midp.io.InternalConnector.openPrim(+216)
at com.sun.midp.io.InternalConnector.open(+9)
at javax.microedition.io.Connector.open(+6)
at javax.microedition.io.Connector.open(+6)
at javax.microedition.io.Connector.open(+5)
at message.messageAlert.startApp(+10)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+225)
at com.sun.midp.dev.DevMIDletSuiteImpl.schedule(+7)
at com.sun.midp.Main.runLocalClass(+20)
at com.sun.midp.Main.main(+68)
Error in server receiving
java.lang.SecurityException: Untrusted read operation.
at com.sun.midp.io.j2me.sms.Protocol.receive(+72)
at message.messageAlert$SMSServer.run(+15)
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Originally posted by Loh Ying Hui:

Another question i would like to ask, is it posible to run 2 emulators at the same time, one emulator sending a sms and another emulator receives it ? Thanks.

Yes, you can run two emulators on the same machine.
As of the errors you had: It seems that they are all related to the config file where your specify the command line options. Maybe you should consult Enrique's article for more info ...
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
I can finally run the application.. I guess the error i am having is the wireless toolkit i m using is a 2.0 version and there's some security problem.
Micheal, in your article you mention about the MIDP 2.0 AMS (Application Management Software). When a registered connection comes in, the AMS invokes a corresponding MIDlet to handle it. When the AMS picks up an SMS incoming message, it will first buffer the message and then trigger the handling MIDlet. The MIDlet can read and delete the message. Is this posible with the wireless toolkit 1.0.4 ?
thanx.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Originally posted by Loh Ying Hui:
I can finally run the application.. I guess the error i am having is the wireless toolkit i m using is a 2.0 version and there's some security problem.

J2MEWTK v2.0 emulator does not allow you to override javax namespace. But the WMA RI does provide classes in that namespace. So, unless WMA is somehow bundled into the WTK in the future, you have to obfuscate the application (change class names etc.) before you deploy.

Micheal, in your article you mention about the MIDP 2.0 AMS (Application Management Software). When a registered connection comes in, the AMS invokes a corresponding MIDlet to handle it. When the AMS picks up an SMS incoming message, it will first buffer the message and then trigger the handling MIDlet. The MIDlet can read and delete the message. Is this posible with the wireless toolkit 1.0.4 ?
thanx.

No, The PUSH architecture is only available in MIDP v2.0. The 1.0.4 emulator would not work.
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
That's too bad.. , is there any other emulator you would like to suggest ?
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
quote:
--------------------------------------------------------------------------------
Originally posted by Loh Ying Hui:
Another question i would like to ask, is it posible to run 2 emulators at the same time, one emulator sending a sms and another emulator receives it ? Thanks.
--------------------------------------------------------------------------------
Yes, you can run two emulators on the same machine.

Hello there,
I've try doing with 2 emulator and it works. What about running two emulators on different machine ? Is it possible ? Where do i set the ip address ?
Thanks !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: install WMA RI into Sun one Studio