This week's book giveaway is in the Java in General forum.
We're giving away four copies of Java by Comparison (eBook) and have Simon Harrer, Jörg Lenhard, Linus Dietz on-line!
See this thread for details.
Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Polish and importing  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Phil Brumby
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ooooh right the device requirements in build.xml!

changed Generic/midp2 to Generic/jtwi, bingo

I have exeeeeercised the demons, thanks Shawn.

Phil.
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!