midp

Disable TextField in J2ME

[亡魂溺海] 提交于 2019-12-08 04:26:06
问题 Is it possible to dynamically make TextField element disabled and enabled during the run time in Java ME? 回答1: according to API documentation, setConstraints(TextField.UNEDITABLE) could do something like that: Sets the input constraints of the TextField... Note if you need to preserve contents and modifier flags, parameter passed to above method might require some tweaking, like setConstraints((getConstraints() & TextField.CONSTRAINT_MASK) | TextField.UNEDITABLE) // "disable" - set UNEDITABLE

J2ME: platformRequest Issue

无人久伴 提交于 2019-12-08 04:12:29
I want to call a number in below format using platformRequest: platformRequest("tel:*123*33584744#"); But it gives me error Invalid number on the phone. But if i call this number manually by typing on phone then it works fine. Even below works fine: platformRequest("tel:33584744"); So i suspect problem lies when i put * or # chars in the number. As i said when i type these chars in the number manually and press the call button on the mobile it works fine but not with platformrequest. What is wrong I am doing? Any alternative to platformrequest method? How to call a number in below format: *123

In J2ME, How I obtain reference of all controls of the form to record form's controls state changes?

五迷三道 提交于 2019-12-07 20:46:28
In my J2ME app, I want show an alert dialog box only when the user changes the state of any controls—that is, when the user uses any of the control of the form and then try to cancel the form without saving typed data. For example among all 5-6 controls of form if the user types in 1-2 textfields and tries to cancel the form without saving that typed data into database. An alert box should then display with the message "Save changes?" with Yes, No command. How to do this? This is my code which does not give the desired result: import javax.microedition.lcdui.*; import javax.microedition.midlet

Using boolean var for stopping threads

 ̄綄美尐妖づ 提交于 2019-12-07 17:29:52
问题 I have a Java book I'm learning from and in one of the examples, I saw something suspicious. public class ThreadExample extends MIDlet { boolean threadsRunning = true; // Flag stopping the threads ThreadTest thr1; ThreadTest thr2; private class ThreadTest extends Thread { int loops; public ThreadTest(int waitingTime) { loops = waitTime; } public void run() { for (int i = 1; i <= loops; i++) { if (threadsRunning != true) { // here threadsRunning is tested return; } try { Thread.sleep(1000); }

MIDP 2.0 version issues: $method is undefined for $type

两盒软妹~` 提交于 2019-12-07 10:40:58
问题 I've written a MIDlet that does several "advanced" things: fetching images from the web, resizing them, saving them on the phone, displaying them. This all works perfectly in the Nokia S60 3rd Edition FP1 emulator. This device has MIDP 2.0 and CLDC 1.1 support (also JSR75, which I need in order to save files). It also works as it should on the Nokia E71 (physical device). I then tried to run the MIDlet on several other emulators. One of them, the DefaultCldcJtwiPhone2 from the Java ME SDK 3.0

MIDP Java implementation of SQLite DB

耗尽温柔 提交于 2019-12-07 07:27:20
问题 Are there any MIDP implementation of SQLite db available for use of sqlite db within a MIDlet, rather than using RMS. Of course, there are Floggy and OpenBaseMovil, however they are based on RMS, but are there any implementations that allows to perform operations in an sqlite db file? 回答1: There are 2 ways of doing something like that: take the open source code of SQLite (written in C) and write something similar in JavaME. nobody has done that yet. There is an ongoing effort to write a

J2ME: Convert transparent PNG image to grayscale

守給你的承諾、 提交于 2019-12-07 07:18:26
is there any possiblity in J2ME to convert an image (loaded from a png file with alpha) to a new transparent grayscale image? Until now I only got the rgb values, but not the alpha. Thanks. Edit: yes, it should be 32 bit grayscale. I found the solution and here is the code: public Image getGrayScaleImage() { int[] rgbData = new int[getWidth() * getHeight()]; image.getRGB(rgbData, 0, getWidth(), 0, 0, getWidth(), getHeight()); for (int x = 0; x < getWidth() * getHeight(); x++) { rgbData[x] = getGrayScale(rgbData[x]); } Image grayImage = Image.createRGBImage(rgbData, getWidth(), getHeight(),

Is HTTP PUT supported in J2ME?

时光怂恿深爱的人放手 提交于 2019-12-07 07:03:38
问题 I just noticed a strange thing in MIDP 2.0 API: The HttpConnection class apidocs make explicit references to methods GET, POST and HEAD, but no other methods. Does this mean that they are not supported? http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/io/HttpConnection.html I also tried checking the MIDP 2.0 spec, but couldn't find any hard facts about this. I can give this a try on some phone(s), but can't try them all. Does anyone know which HTTP methods are required to

Disable TextField in J2ME

主宰稳场 提交于 2019-12-06 21:38:34
Is it possible to dynamically make TextField element disabled and enabled during the run time in Java ME? according to API documentation, setConstraints(TextField.UNEDITABLE) could do something like that: Sets the input constraints of the TextField... Note if you need to preserve contents and modifier flags, parameter passed to above method might require some tweaking, like setConstraints((getConstraints() & TextField.CONSTRAINT_MASK) | TextField.UNEDITABLE) // "disable" - set UNEDITABLE above to disable, and to enable back, something like: setConstraints((getConstraints() & TextField

How to get and set JSONObject , JSONArray in J2ME

无人久伴 提交于 2019-12-06 19:53:23
I am new to JSON programming in J2ME. I discovered that Json is used to exchange data much like XML. I want to know about the exchange in Array object from JSONtoObject and vice versa Below written is code where I convert from JSON to Object and vice versa. But I don't know about how to do for complex data structure like arrays etc. // App Loader import javax.microedition.midlet.MIDlet; import javax.microedition.midlet.MIDletStateChangeException; public class AppLoader extends MIDlet { public AppLoader() { // TODO Auto-generated constructor stub // Converting Object to JSON UserData data=new