java-me

How to Resize Dialog Box in LWUIT?

自闭症网瘾萝莉.ら 提交于 2019-12-11 09:48:08
问题 I have Created one Program Using Lwuit,Midlet. In that program I am showing Dialog box on the screen (LWUIT component) when I press mobile key. It shows default size. But I want to resize it. How can I resize the Dialog Box in LWUIT ? 回答1: Use this Dialog#Show method for showing resized Dialog. For example, Dialog dialog = new Dialog("Information"); dialog.show(0, 100, 11, 11, true); 来源: https://stackoverflow.com/questions/8799366/how-to-resize-dialog-box-in-lwuit

Send port SMS to any mobile?

。_饼干妹妹 提交于 2019-12-11 09:29:32
问题 I have a midlet that could send sms. in J2me the sms is with a port number. But I want it sent to any mobile without specifying the port number. Could I achieve that? Or is it possible if I send from server sider through SMS gateway API to any mobiles? 回答1: As far as I know if you specify the port number to 0, it will send the SMS as a standard SMS and the other phone will receive it and put the message in the Inbox. String url = "sms://1234567:0"; MessageConnection conn = (MessageConnection

LWUIT Uncaught exception: java.lang.OutOfMemoryError(stack trace incomplete)

孤人 提交于 2019-12-11 09:19:17
问题 I developed an Rss Application using LWUIT Tabs,i want to display Rss Feed Titles and images on my Lwuit Tab screen,but when i run my application i am able to display three List (title with image)items Sucessfully,after that i am facing java.lang.OutOfMemoryError(stack trace incomplete) Eventhough there are list items present?can any one help......thanks... Here my Code: public class Process { protected XMLMidlet midlet; Form form1; Image image; Tabs tabs; private List myNewsList; private

Read lines in Java ME

梦想与她 提交于 2019-12-11 08:56:32
问题 Does Java ME allow you to read a line from an InputStream ? 回答1: This is not as trivial as it sounds. Unfortunately, lines could end with '\r', '\n' or '\r\n'. The following class will handle all of these cases. public class LineReader{ private Reader in; private int bucket=-1; public LineReader(Reader in){ this.in=in; } public boolean hasLine() throws IOException{ if(bucket!=-1)return true; bucket=in.read(); return bucket!=-1; } //Read a line, removing any /r and /n. Buffers the string

FileIOException in Blackberry

拜拜、爱过 提交于 2019-12-11 08:53:41
问题 I am having a fileIOException: File system out of resources when i tried to read some files on my blackberry torch. What can I do to prevent this from happening? 回答1: You probably have too many files open simultaneously, or you haven't properly closed previous file connections. There is a global limit on the number of open file connections on the BlackBerry, something like 16 open at any time. You should close connections as soon as you don't need them. 来源: https://stackoverflow.com/questions

Display an EditField in a ListField of BlackBerry

你离开我真会死。 提交于 2019-12-11 08:07:08
问题 In my app i have to display list of items with price in EditField . How can i add EditField in list? For ListField , i am using this code public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width) { this.listField=listField; String text=(String) get(listField, index); if(holder[index]==null) { holder[index]=placeholder; } graphics.setColor(rgb); graphics.setFont(Utility.getBigFont(DConfig.getFSize()+4)); graphics.drawBitmap(3,y+7,placeholder.getWidth(),

Float or double on Blackberry?

折月煮酒 提交于 2019-12-11 07:40:35
问题 Can you use double or float on Blackberry? If so, in which OS version or hardware model? Edit: I believe the answers I get here, but then something else must be the problem. 回答1: Apparently floating point doesn't work on some versions of Blackberry; see the comments. Bow, if a J2ME device implements the CLDC 1.0 profile, the manufacturer is not required to include support for floating point arithmetic in the platform: see http://cmer.cis.uoguelph.ca/cs1cs3/slides.ppt In CLDC 1.1, floating

Commands sometimes don't work

余生长醉 提交于 2019-12-11 07:21:28
问题 There is a Canvas which has two Command s. The problem is that when the canvas is first opened then the commands work , but when I open it for the second time then the command doesn't work! Here is the code: package view; import java.io.IOException; import java.io.InputStream; import javax.microedition.io.Connector; import javax.microedition.io.file.FileConnection; import javax.microedition.lcdui.Canvas; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener;

Closing the default camera in Blackberry programatically after taking a picture

↘锁芯ラ 提交于 2019-12-11 07:19:18
问题 In my application, Im using the default blackberry camera player to capture images using this.. - Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments(CameraArguments.ARG_CAMERA_APP)); But after capturing the image, the user has to click the back button inorder to navigate to the next screen. Is there any option to close the player automatically, after capturing the image. 回答1: Check this post. The idea is to use EventInjector to simulate two Escape button presses while being

Convert int val to format “HH:MM:SS” using JDK1.4

回眸只為那壹抹淺笑 提交于 2019-12-11 07:02:06
问题 What is the most efficient method of converting an int val to its string counterpart in this format - "HH:MM:SS" 10 becomes 00:00:10 70 becomes 00:01:10 3610 becomes 01:00:10 I need this to be JDK1.4 compliant. What I've come up with is a series of if statements and then constructing a string based on the current int val. This is not very efficient. Is there a better way? 回答1: Instead of a heap of code, how about just one line? String time = new SimpleDateFormat("HH:mm:ss") {{setTimeZone