midp

Image in button - j2me

佐手、 提交于 2019-12-02 07:02:19
I am trying to build a simple menu-based GUI with J2ME. The menu entries are currently objects of classes derived from the class Button. Is there any way I can: Replace the text in the button and have an image show instead, sort of an icon? Make the text and image appear side by side on the same menu bar. If my question is not clear, please let me know and I will edit it. You can create your own Item that looks like a button by extending the CustomItem class . This is a working MIDlet with a good MyButton class: import javax.microedition.lcdui.Canvas; import javax.microedition.lcdui.CustomItem

JME: How to get the complete screen in WHITE without buttons, etc etc

别来无恙 提交于 2019-12-02 06:54:33
问题 Please have a look at the following code First, Please note I am a 100% newbie to Java Mobile. In here, I am making the light on and vibrate on when user click the button. However, I really wanted to create a SOS application which turn the whole screen into white, and go to black, like that, in the thread. I guess I didn't achieve that by this app because even the lights are on, the buttons are still there. I tried to turn the "Form" color to "white" but it seems like JME has no "Color" class

HttpConnection - javax.microedition, returning -1 for getLength() method

不想你离开。 提交于 2019-12-02 05:54:47
I am trying to program a very simple Mobile Application (J2ME) in java. The idea is to access a website via URL input and read the contents of the website into a buffer. Here's the problem. This works perfectly fine for some URL's but not others? The example below (wikipedia) works fine. But take "http://java.com/en/about/" as an example and the "HttpConnection hc" returns -1 for getLenght() so there is no content to read into the buffer? Here's my code: String url = "http://en.wikipedia.org/wiki/RSS"; //Sets up HttpConnection and InputStream using the URL variable HttpConnection hc = null;

JME: How to get the complete screen in WHITE without buttons, etc etc

大兔子大兔子 提交于 2019-12-02 04:47:46
Please have a look at the following code First, Please note I am a 100% newbie to Java Mobile. In here, I am making the light on and vibrate on when user click the button. However, I really wanted to create a SOS application which turn the whole screen into white, and go to black, like that, in the thread. I guess I didn't achieve that by this app because even the lights are on, the buttons are still there. I tried to turn the "Form" color to "white" but it seems like JME has no "Color" class. import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Midlet extends

How to lock the landscape mode in j2me app?

℡╲_俬逩灬. 提交于 2019-12-01 05:59:10
问题 I want to show my app only in portrait mode. I have to restrict the landscape mode in my app. There are separate attributes for each devices. For Nokia, Nokia-MIDlet-App-Orientation : Portrait . For Samsung, MIDlet-ScreenMode : Portrait . After adding these in JAD, I tried to install it in Nokia C5. I am unable to install it. I am getting Compulsory attribute missing error because custom JAD property shouldn't start with MIDlet- . I am unable to install it because of MIDlet-ScreenMode :

Data in J2ME RecordStore does not persist across sessions

三世轮回 提交于 2019-12-01 01:03:19
I'm building a mobile app with J2ME, and I've found that the data I write into a RecordStore can be accessed while the program is still running but it is lost after quitting and restarting it. No exception is thrown, the data is simply lost. UPDATE: Thanks everyone for your suggestions. I'm using NetBeans on Windows 7. I'm not sure if it is using the WTK version I have previously installed or another one it has installed somewhere else. I've checked my WTK folder for the files Pavel wrote about, but couldn't find them. Now I'm testing the features requiring persistence on my phone and

How to deal with the most common classes missing on J2ME

馋奶兔 提交于 2019-11-30 05:01:07
I'm trying to code an application which runs un different java platforms like J2SE, J2ME, Android, etc. I already know that I'll have to rewrite most of the UI for each platform, but want to reuse the core logic. Keeping this core portable involves three drawbacks that I know of: Keeping to the old Java 1.4 syntax , not using any of the nice language features of Java 5.0 only using external libraries that are known to work on those platforms (that is: don't use JNI and don't have dependencies to other libs which violate this rules) only using the classes which are present on all those

You must include the platform port before the LWUIT in the classpath runtime exception

与世无争的帅哥 提交于 2019-11-29 16:01:17
I recently started using LWUIT. Great job and great program. I'm using Netbeans 6.9.1, S60 SDK and the webstart version of LCWUIT. The first problem I faced was that I couldn't preverify Transitions3D.java file , however that was not an issue. I just removed that part of the code and recompiled the library from scratch. So I created a simple form with a "Hello World" Label and tried the "Create Netbeans Project" option of the resource editor. I did a Clean Build at the test_MIDP (where test is the name of my project) and tried to run it on the emulator. However I'm receiving this error message

ClassFormatError: 56 while using hessian in j2me

倾然丶 夕夏残阳落幕 提交于 2019-11-29 15:20:09
I am trying to use the hessian j2me implementation @ http://hessian.caucho.com/ using java me sdk 3.0. http://hessian.caucho.com/doc/hessian-overview.xtp#Hessian%20Client%20for%20a%20cell-phone mentions the usage for j2me. The application builds without any errors/warning. But, the moment the line where MicroHessianOutput is instantiated is hit, a ClassFormatError ( java.lang.Error: ClassFormatError: 56 ) is thrown. Heres the trace : TRACE: <at java.lang.Error: ClassFormatError: 56>, startApp threw an Exception java.lang.Error: ClassFormatError: 56 - alert.AlertDemo.showOption(), bci=26 -

Database in J2ME

家住魔仙堡 提交于 2019-11-29 08:05:25
I am new in J2ME. In my Application, I want to add the Multiple Records in the Record Store and also want to access it. How can I add the multiple Records in the Record Store and how can I access it? Here is my library code for RMS, just study it, it is very easy to implement, all the methods like insert,updated, delete is there. import javax.microedition.rms.RecordEnumeration; import javax.microedition.rms.RecordStore; import javax.microedition.rms.RecordStoreFullException; import javax.microedition.rms.RecordStoreNotOpenException; import com.project.gui.components.CustomAlert; import com