java-me

LWUIT TextArea question

て烟熏妆下的殇ゞ 提交于 2019-12-20 02:49:06
问题 Is there any way to write in a textArea without going to a LCDUI window? I want to edit my textArea in my LWUIT app but everytime I try to do this, the app send me to a LCDUI window. 回答1: To disable the LWUIT edit control trigger you can use the following code. textArea.setNativeTextboxTrigger(false); You need to implement the following code in the LWUIT TextArea source code static final String CLIENT_PROPERTY_FIRE_ACTION_TIMES = "FIRE-ACTION-TIMES"; static final String CLIENT_PROPERTY

OpenID authentication from an installed application

隐身守侯 提交于 2019-12-20 01:41:42
问题 I'm currently planning a new web project. Clients are going to connect using a regular web browser and, in case of regular java-enabled cell phones, j2me client. I would really like to make use of the OpenID authentication. In case of regular web browser things are pretty straightforward. However, I am really not sure about installed applications (such as j2me client installed on a mobile device) - regular OpenID authentication is performed by entering username/password on a webpage of

Get filename from an inputstream (Java)

我们两清 提交于 2019-12-19 19:38:28
问题 if I have this code, how could I keep the filename of the original file or reassign it to the new one?: InputStream input= assetInfo.openStream(); File t = new File(""); OutputStream out = new FileOutputStream(t); int read=0; byte[] bytes = new byte[1024]; while((read = input.read(bytes))!= -1){ out.write(bytes, 0, read); } 回答1: An input stream can be created to read from a file or from any other source of data. Therefore it makes no sense to have a filename attached to an input stream. Look

Asin, Acos, Atan in J2ME

断了今生、忘了曾经 提交于 2019-12-19 11:43:33
问题 How could I use Math.asin() (.. etc.) in a J2ME application? (I've looked at Real Java (and it looks like it could do this) but it says I should avoid converting from a string. How could I create a new Real from a double value?) 回答1: Since MIDP 2.0 this should work: public static double asin(double a) { // -1 < a < 1 // The function isn't very precise final double epsilon=1.0E-7; // Use this to adjust precision double x=a; // Newton's iterative method do x-=(Math.sin(x)-a)/Math.cos(x); while

BlackBerry - how to occupy a complete button with image

前提是你 提交于 2019-12-19 10:44:12
问题 I have written BlackBerry code to add an image to a ButtonField. I want the whole button to be occupied by the image, but the image is not displayed completely on the ButtonField. There is a lot of margin on the top, left and right of the button. I tried to use cellpadding but it didn't work. How can I reduce the width and height of the ButtonField so it matches the original image size of 41 x 41? 回答1: Instead of adding an image to a button extend the image class and turn that into a button

How can I convert a cp1251 byte array to a utf8 String?

无人久伴 提交于 2019-12-19 10:26:47
问题 We don't have the cp1251 code page available on a phone, so new String( data, "cp1251" ) doesn't work. We need a function with signature something like String ArrayCp1251toUTF8String(byte data[]); 回答1: First, there's no such thing as a "UTF-8 string" in Java, they're just strings. But you don't need to worry about the string's encoding, just the encoding of the bytes you're converting. Since cp1251 (or windows-1251 ) is a single-byte encoding, decoding is a simple matter of using the byte

How do I enforce a timeout on a webservice call using ksoap 2?

喜欢而已 提交于 2019-12-19 10:08:17
问题 I need to add a timeout to a J2ME application that uses ksoap 2 to connect to a web service. I've tried the method described as a possible pseudo timeout at http://ksoap2.sourceforge.net/doc/api/org/ksoap2/transport/HttpTransport.html, but it doesn't seem to function on this device. I'd run the connection on another thread and kill it if a timer fires but there's no way to kill a thread before it finishes executing in J2ME per http://developers.sun.com/mobility/midp/articles/threading2/ (this

BlackBerry barcode scanning library?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-19 09:17:30
问题 Anyone got a good handle on a barcode scanning library that can be used to read in UPC-A, EAN-13 or other major barcode formats based on input from the digital camera? Does RIM have a standard library already available for this? I know that BlackBerry Messenger has 2D barcode scanning built-in so I'm guessing there must be something available, though not sure if it's proprietary or not. Update: I'll go with the zxing library for now and see how that pans out since there aren't any official

BlackBerry barcode scanning library?

旧时模样 提交于 2019-12-19 09:17:23
问题 Anyone got a good handle on a barcode scanning library that can be used to read in UPC-A, EAN-13 or other major barcode formats based on input from the digital camera? Does RIM have a standard library already available for this? I know that BlackBerry Messenger has 2D barcode scanning built-in so I'm guessing there must be something available, though not sure if it's proprietary or not. Update: I'll go with the zxing library for now and see how that pans out since there aren't any official

Are there any PDF libraries for J2ME? [closed]

若如初见. 提交于 2019-12-19 08:52:42
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . We need to create a basic PDF reader running on J2ME. While there are several PDF libraries for Java, I'm not sure whether they