Menu (Command) using J2ME Polish and Generic MPDP2 build
I am using J2ME Polish for my application. The app itself is fairly simple but we are using polish for it's nice UI. I would like to have a popup menu (Command) that is similar to the picture attached. I am able to get this kind of UI for dev开发者_开发技巧ice specific builds, such as Nokia 6212 Classic but not for Generic MIDP2 builds.
I believe everything is being rendered on J2ME Canvas and I don't see any technical reason why this cannot be rendered for a generic device. Could anyone out there let me know if this is not possible by design?
Any pointers on how to get this working is appreciated. Thanks.
I have found the solution after going through the document 'Complete guide to J2ME Polish, The solution for professional wireless Java development", which I highly recommend for anyone making use of this library.
J2ME Polish supports "menu" mode when the device has a feature "hasCommandKeyEvents". This is available by default when you are developing for a device that is already present in the device database (devices.xml and other related xml files). But if you are developing for a custom device, this feature needs to be set for the device definition. For example, I am developing for ALL Nokia S40, S60 devices. Add the following entry in the file custom-devices.xml.
<device supportsPolishGui="true">
<identifier>Nokia/Midp2CCLDC11</identifier>
<groups> Series60,Series40</groups>
<capability name="ScreenSize" value="240x320"/>
<capability name="FullCanvasSize" value="240x320"/>
<capability name="CanvasSize" value="240x320"/>
<capability name="BitsPerPixel" value="16"/>
<capability name="JavaPackage" value="mmapi1.1, wmapi, wmapi2.0,m3g, pdaapi, nfc" />
<capability name="JavaPlatform" value="MIDP/2.0" />
<capability name="JavaConfiguration" value="CLDC/1.1" />
<capability name="JavaProtocol" value="http, https, ssl, tls, tcp, udp" />
<capability name="HeapSize" value="10 MB" />
</device>
Build for this device Nokia/Midp2CLDC11. The UI would now show the menu.
精彩评论