java-me

Sorting with BlackBerry

 ̄綄美尐妖づ 提交于 2019-12-25 00:37:45
问题 I have a file consisting of entries like Paula 100, Steve 150, Julian 200. I want to sort this. Can I use the Collections framework in BlackBerry to sort file entries consisting of numbers and names? I can't find any sorting program for blackberry. So I am wondering if I can use Collections.sort()? 回答1: There are sortable collections in the BlackBerry API that you can use. Search the JavaDocs for things like SimpleSortingVector and BigVector. 回答2: Unfortunately, BlackBerry uses J2ME which

J2ME chat application?

▼魔方 西西 提交于 2019-12-24 21:30:59
问题 I want to develop a chat application using J2ME.Any reference code example or code or any kind help can help me...... in my application.In my application message will go from one mobile to the server(Tomcat) first there i will save it in my database and then look msisdn and forword this message to the that msisdn 回答1: After a quick google search I found this: http://www.java2s.com/Code/Java/J2ME/Socketconnection.htm Read the documentation on StreamConnection and Connection. That should get

How to determine tomorrow's date in J2ME for use in a DateField?

匆匆过客 提交于 2019-12-24 19:08:10
问题 I basically want to be able to show tomorrows date I have this which shows today date private Date date = new Date(); i tried this but this gave me jan 1 1970 private Date date = new Date(+1); please help 回答1: The integer (actually long) parameter for the Date constructor is for specifying the milliseconds of offset from January 1st, 1970, GMT. You need to use a Calendar instead Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, 1); Date date = cal.getTime(); 回答2: Note, the Date

Help parsing simple JSON (using JSON for JAVA ME)

删除回忆录丶 提交于 2019-12-24 18:33:54
问题 I new to parsing JSON - up until this point, I've been purely XML. Anyways, I am using JSON (Java ME) to parse something with the following structure: {"name" : "JACK","name" : "JILL","name" : "JOHN","name" : "JENNY","name" : "JAMES","name" : "JIM"} Here is my code: try { JSONObject json = new JSONObject(response); JSONArray jsonArray = outer.getJSONArray("name"); System.out.println("ARRAY SIZE:" + jsonArray.length()); } catch (JSONException ex) { } My problem is that I cannot even get the

lwuit calendar with button event

浪尽此生 提交于 2019-12-24 18:13:18
问题 i tried to show the calendar on button click using form but i'm unable to change the date and very much struggled to find where the focus . ... Button mdate=new Button("change date"); mdate.addActionListener(this); ... public void actionPerformed(ActionEvent ae) { Form cal= new Form(); com.sun.lwuit.Calendar c =new com.sun.lwuit.Calendar(); c.setFocus(true); c.addActionListener(this); cal.addComponent(c); cal.show(); } how to show and hide calendar on button click in a better way 回答1: Better

Screen brightness in J2ME

风格不统一 提交于 2019-12-24 16:28:30
问题 Do you know of any means for changing the screen brightness in J2ME. That is using a vendor-specific API, like Samsung's, etc. Thanks! 回答1: I think the closest is Display.flashBacklight(int duration) http://www.microemu.org/microemu-midp/apidocs/javax/microedition/lcdui/Display.html#flashBacklight%28int%29 Also see http://support.developer.motorola.com/cgi-bin/motodev.cfg/php/enduser/std_adp.php?p_faqid=592&p_created=1170311265&p_topview=1 回答2: There is away to do it with the Nokia-specific

How to convert 12 hours time to 24 hours time in j2me?

你说的曾经没有我的故事 提交于 2019-12-24 16:27:24
问题 I am getting time from server it's like this 12:00PM-3:00PM,7:00PM-10:30PM This time in 12 Hours format. I applied some operation on this string and I separated all times. Now I have four strings like following (aftr1=> 12:00PM aftr2=> 3:00PM) (evng1=> 7:00PM evng2=> 10:30PM) Now I want to convert them in 24 hours time, because I want to check the time which was entered by user it is between afternoon time 12:00pm to 3:00pm or in evening 7:00pm to 10.30pm. Or any other idea how to complete

LWUIT ComboBox popup theming problem

僤鯓⒐⒋嵵緔 提交于 2019-12-24 15:56:38
问题 I want to customize the look of the ComboBox pop-up list in LWUIT. Nonetheless when I tried to change the ComboBox , ComboBoxFocus , ComboBoxItem , ComboBoxList , ComboBoxPopup components in LWUIT Theme Creator, nothing happened. The popup preview in Theme Creator still shows the pop-up in black text on white background. Am I missing something? How to change the theme of this pop-up? I am using LWUIT 1.4 回答1: Use the following styles in LWUIT resource edit, Unselected#ComboBoxItem#Color for

J2ME button command not working

会有一股神秘感。 提交于 2019-12-24 15:34:53
问题 I'm currently working on an j2me application and I'm having a hard time dealing with command button. Can someone please help me. The button was suppose to direct in a second form but when I click it, it's not working. Here's my code: import javax.microedition.midlet .*; import javax.microedition.lcdui .*; import javax.microedition.lcdui.StringItem; import javax.microedition.lcdui.TextField; import javax.microedition.lcdui.DateField; import javax.microedition.lcdui.Command; import javax

how to disable the button using bitmapbuttonfield in advanced ui examples in blackberry

為{幸葍}努か 提交于 2019-12-24 15:34:52
问题 I am using bitmap button field in advanced ui examples. By default no method is working for disabling the button in 5.0 jre, so i have added the below code for disabling and then disabling functionality of the button is working but setchangelistener is not working that is my problem .. here is my code that i added for disabling the button..please check. do i need to change anything in invoke action method? public boolean isDisable() { return isDisable; } public void setDisable(boolean