aspose file tools*
The moose likes Java Micro Edition and the fly likes Polish and importing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Polish and importing" Watch "Polish and importing" New topic
Author

Polish and importing

Phil Brumby
Greenhorn

Joined: Jul 08, 2005
Posts: 17
Ok i shouldn't be making hard work of this but i am, if someone could help i'd be very grateful.

Developing in NetBeans 4.1 with Polish and am trying to include the wireless media package. So in my source i have:

import javax.wireless.messaging.*;

And in build.xml i have in the classpath:

<property name="polish.home" value="C:\Program Files\J2ME-Polish" />

<taskdef name="j2mepolish"
classname="de.enough.polish.ant.PolishTask"
classpath="${polish.home}/import/enough-j2mepolish-build.jar:${polish.home}/import/jdom.jar:${polish.home}/import/proguard.jar:${polish.home}/yguard-lib.jar:${wtk.home}/wtklib/kenv.zip:${polish.home}/import/wmapi.jar:"/>

Yet when i run it in test mode or release mode (it's just the demo polish project) i get package not found:

F:\Source\NetBean Projs\NewPolish1\build\test\Generic\midp2\en_US\source\de\enough\polish\example\MenuMidlet.java:37: package javax.wireless.messaging does not exist

import javax.wireless.messaging.*;

1 error

What simple step am i missing here?

Thanks,
Phil.
Shawn Fitzgerald
author
Greenhorn

Joined: May 07, 2004
Posts: 25
Well I don't know about NetBeans, but in the WTK you would need to select in the settings that the project was to include the WMA APIs.
Messaging is not part of the standard MIDP2.0 specification, but is part of the JTWI specification. So you might also want to make that a requirement of the project.

Also don't forget to add permissions for calls to the WMA services, such as SMS. That would be an issue at runtime and would not get in your way for the compiling of your project.

Hope that helps.
-Shawn


DFW J2ME Sig co-leader<br />Author: <a href="http://www.cafepress.com/sms_midp2" target="_blank" rel="nofollow">SMS for MIP2.0</a>
Phil Brumby
Greenhorn

Joined: Jul 08, 2005
Posts: 17
Thanks Shawn but all of that seems fine, within the project settings of NetBeans i have under Optional Packages Wireless Messaging API ticked and building project within NetBeans environment is fine, no error...

(i run a netbeans build to use debug, and polish to make use of it's UI stuff)

The problem comes with the ant run build.xml polish version, with it i'm assuming i have to include the wireless api in the classpath settings in the build.xml but it won't compile??

Anyone else shed some light?

Phil Brumby
Greenhorn

Joined: Jul 08, 2005
Posts: 17
Ooooh right the device requirements in build.xml!

changed Generic/midp2 to Generic/jtwi, bingo

I have exeeeeercised the demons, thanks Shawn.

Phil.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Polish and importing