java-me

Serial communication using commConneciton API in j2me

你离开我真会死。 提交于 2019-12-11 12:40:22
问题 I have develop one j2me application for Centrino chip. That chip connected to one EZ power meter. I want to read data from EZ meter over serial communication RS-232 using Modbus protocol. I have some code for send Modbus request for read Holding Register. //declare variable here CommConnection commConn; InputStream inStream; OutputStream outStream; // here open com port using commconnection String strCOM = "comm:COM1;baudrate=9600;bitsperchar=8;stopbits=1;parity=even;blocking=on;autocts=off

LWUIT HtmlComponent

人走茶凉 提交于 2019-12-11 12:38:16
问题 I've an Html String: String html="<p><img border=\"1\" align=\"left\" width=\"150\" vspace=\"2\" hspace=\"2\" height=\"159\" src=/"tmdbuserfiles/ntr-vv-vinayak-pics.jpg\" alt=\"Prithvi II, ballistic missile, DRDO, armed forces,Chandipur, Balasore district, Odisha State\" />The Strategic Forces Command of the armed forces successfully flight-tested the surface-to-surface Prithvi II missile from Chandipur in Balasore </P>"; I want to display the text as well as Image on my LWUIT Form Screen,For

J2ME - PNG created in PhotoShop not displaying in emulator

时间秒杀一切 提交于 2019-12-11 12:08:17
问题 My midlet is showing some images fine, but not others. They are all 8-bit PNGs, but the ones that aren't displaying are the ones I have created myself in PhotoShop. So I am thinking maybe my PhotoShop (CS6) settings are wrong... PNG-8, Selective, Diffusion, Colors: 256, Dither: 100%, Matte: None, Web Snap: 0%, Convert to sRGB: ticked, Width: 48, Height: 48, Percent: 100%, Quality: Bicubic. I've experimented with a few of these settings, but to no avail. Any ideas? There is a similar problem

J2ME bouncycastle incompatible types required: Throwable found DataLengthException

耗尽温柔 提交于 2019-12-11 11:53:44
问题 I have some code with bouncycastle that generates an exception, but even if i surround with try catch, the catch statement still give me this error : incompatible types required: java.lang.Throwable found: org.bouncycastle.crypto.DataLengthException here is my code: int decryptedLength; try { decryptedLength = cipher.processBytes(cipherBytes, 0, cipherBytes.length, decryptedBytes, 0); } catch (DataLengthException ex) { } the catch statement doesn't accept the exception, how to solve this ?

Custom BitmapField bug on unfocus and scroll (BlackBerry)

别来无恙 提交于 2019-12-11 11:44:08
问题 I have been having this annoying problem when trying to implement a picture gallery on BlackBerry 6. Everything works, however when the focus changes from the top buttons to say the pictures further down the screen, the images seem to glitch and not paint themselves correctly. Please see the images below for an example: (Focus is on the top of the screen(not shown)) (Focus is now on the bottom left image, note that the top image is now blank for an unknown reason) And this happens no matter

Fetch all Image names from blackberry Device

别等时光非礼了梦想. 提交于 2019-12-11 11:43:56
问题 Is there any way to iterate through all images stored in a blackberry device. I have seen this example which iterates over the whole file system and scans each file. I am wondering is there any cheaper way of doing the same. Something that directly looks into the image directory? Thanks 回答1: Using System.getProperty(String key) it is possible to get image storage dirs on device: Key "fileconn.dir.memorycard.photos". Returns default directory for storing photos on SD Card. It should be

how to make a gridview in J2me

房东的猫 提交于 2019-12-11 11:24:08
问题 Hi I'm new in j2me & i make a application in j2me how to create a grid view in j2me and how to insert an image in j2me please give me the suggestion. 回答1: Better way is you can easily achieve this with LWUIT framework for Java ME application. You can use Grid layout and here you can set the BGImage or BGColor for Components . 回答2: Better to use CustomItem and draw the lines like table. 来源: https://stackoverflow.com/questions/6807471/how-to-make-a-gridview-in-j2me

How do I fix a “broken” debugger in EclipseME (MTJ)?

人盡茶涼 提交于 2019-12-11 10:56:54
问题 How do I fix a broken debugger, one that just won't start, in EclipseME (now Mobile Tools Java)? (This question has an answer which will be transferred from another question soon) 回答1: The most annoying issue with EclipseME for me was the "broken" debugger, which just wouldn't start. This is covered in docs, but it took me about an hour to find this tip when I first installed EclipseME, and another hour when I returned to JavaME development a year later, so I decided to share this piece of

Insert Form with gauge in Canvas J2ME

北城余情 提交于 2019-12-11 10:45:48
问题 I want to know if it is possible to somehow show a gauge in a canvas? I want to make a custom alert with a spinner. But I want to reduce the height of the form to let's say 1/4th of the screen size. Could anyone tell me if its possible? 回答1: If you want something like a spinner in a Canvas you need to draw it yourself using graphics primitives, and animate using Display.callSerially(). Instead of drawing it yourself you could include each frame of the spinner as an image. You'd still need to

How to make a j2me project in NetBeans 7.0?

耗尽温柔 提交于 2019-12-11 10:01:19
问题 I have installed Netbeans 7.0 (in window xp SP3) and I also installed "Wireless Toolkit 2.5". But when I open Netbeans File->New Project then there is only option for Java SE and Java EE. Not for Java ME. I also try Tools-> Plugin -> and search for Java ME but I was not able to find "Java ME". 回答1: At first install 'Mobility' plugin for NetBeans IDE for J2ME development. You can do this from Tools > Plugins > (Select and install). Then DO this.. In netbeans, Tools > Java Platforms >Select Add