java-me

LWUIT: Styling a Button

∥☆過路亽.° 提交于 2019-12-11 18:04:44
问题 I have a J2ME LWUIT app and I'm trying to change the width and background color of a button. The button is in a BoxLayout. I'm using code like this: btnLogout.setPreferredW(210); btnLogout.getStyle().setFgColor(0x00dcc5); btnLogout.getStyle().setBgColor(0x302d36); Only the setFgColor line seems to work. The width remains unchanged and the background remains white. How can I change the style of the button? I haven't had this problem with other components (labels, text fields, etc...) 回答1: If

SMS goes to the inbox when the mobile is disconnected

只愿长相守 提交于 2019-12-11 17:17:52
问题 I'm using J2ME WMA to send/receive SMS into a specific port, wich in my case is port 50000. When one of the mobile devices is not running the application the message goes to the inbox, which by default is port 0. Is there any way to prevent this from happening? 回答1: PushRegistry resolves the issue but it's only available in WMA 2.0. Check the WMADemo sample at JavaME SDK 3.0. 来源: https://stackoverflow.com/questions/4932972/sms-goes-to-the-inbox-when-the-mobile-is-disconnected

Does getting a Cell id of mobile device will work to get accurate position of mobile phone in j2me

删除回忆录丶 提交于 2019-12-11 16:52:50
问题 If I get the cell id Will it work to get the exact location of the mobile devices through j2me programming? I got to know how to get cell id by this link: Can I fetch position of mobile device in j2me having no GPS service using information from cell tower But whether to get location accurate is still a question? 回答1: One Single cell is not enough to get you the accurate location. you need at least 3 different cell to get a location as accurate as GPS What the cell information can do for you

Restore recordstore after exit application

别等时光非礼了梦想. 提交于 2019-12-11 16:19:56
问题 I have written a LWUIT application that involves two RecordStores recordStore and recordStore2 . Two methods method getRecordData for retriving all records of recordStore, method getRecordData2 for retriving all records of recordStore2 . two Radiobuttons rb and rb2 are added ButtonGroup called group A TextField called tf addition button for adding a record for either recordstore or recordstore2 after rb or rb2 is selected a text which must written into tf TextField as a record Two lists

How to detect inactivity/idle time since last keypressed on j2me

余生颓废 提交于 2019-12-11 14:53:35
问题 I have an application with a lot of screens (followed by MVC pattern), and I want to be able to receive in a fashion way the information that last key was pressed x seconds ago (120 sec let's say). Is there standard way to do this or I have to start a timer and every time when I pressed a key I have to override a variable and in the timer I have to check the difference time between that time and current time? 回答1: Yes, just record the system timer when a key is pressed. long epoch = System

Add new menu item in blackberry to launch my app

南楼画角 提交于 2019-12-11 14:38:54
问题 In my application, I want to to add an item to the BlackBerry menu items and this item can launch my simple application. how can I do that? I am using blackberry JDE 7.1. 回答1: Import the Blackberry sample "MenuDemo" from Blackberry samples; Then you can understand; To Import Blackberry Samples; Go to File-->Import-->Blackberry-->ImportBlackberrySamples-->DeselectAll-->and select the MenuDemo from samples; and click finish;(you can change the version at "Use a project Specific JRE"); 回答2: The

Neither float nor double works on Blackberry OS 4.5

☆樱花仙子☆ 提交于 2019-12-11 14:25:37
问题 As soon as I add a float or a double variable to my program, it stops working on BB models 8100 and 8800, both running OS 4.5. I have a couple of newer phones with OS 5 and 6, respectively, and the same binary works just fine on those. Why would this be? Also, see "Float or double on Blackberry?" which led to this question. When the application is started, before it really starts, it shows an error message to the effect of "modules bla blah can not verify blah". I'll update the message to the

LWUIT Tabs click event?

大城市里の小女人 提交于 2019-12-11 14:06:43
问题 I have created LWUIT Tabs. I want to identify the enduser tab click event and need to place some logic?How to identify tab click Event? Here my Code: topnews = new Vector(); topstory = new Vector(); cinemanews = new Vector(); newsList = new List(topnews); newsList.setScrollVisible(false); newsList.setRenderer(new NewsListCellRenderer()); myNewsList = new List(topstory); myNewsList.setScrollVisible(false); myNewsList.setRenderer(new NewsListCellRenderer()); cinemaNewsList = new List(cinemanews

Make j2me Alert Dismiss button invisible

吃可爱长大的小学妹 提交于 2019-12-11 13:19:32
问题 Is there any way to not show the default dismiss button when I set Alert to FOREVER? I was following the following post but it shows me a button with no characters. http://code-gotcha.blogspot.com/2011/09/dismiss-button-in-nokia-alert.html?showComment=1346738220258#c4876777871081894195 alert.addCommand(new Command("\u200B", Command.OK, 1)); //we dont like to see the DISMISS command, so adding an invisible command I am using LWUIT forms but have just invoked j2me native alerts to give the app

How to detect network type(2G/3G) in J2ME?

孤者浪人 提交于 2019-12-11 12:45:29
问题 In my J2ME application i want to detect network type whether it is 2G or 3G. According to network type, i need to take some different actions. How can it be done by code? 回答1: For Network type following syntax is used String value = System.getProperty("com.nokia.network.access"); You can check this artical. The return values can be as follows, pd - Packet data in GSM network pd.EDGE - Packet data in EDGE network pd.3G - Packet data in 3G network pd.HSDPA - High speed downlink packet access