midp

how to handle keypressed event in canvas for alphanumeric using j2me midp2.0?

余生颓废 提交于 2019-12-06 10:55:41
I am using canvas for drawing Strings in mobile screen based on the user input using key pressed event. Here my user wants to enter alphanumeric character like abc. For example user try to enter 'd' then it will display 3 instead of 'd'. So, do I get both String and numeric and able to draw in the mobile screen? Na if you're doing it in Canvas, you'll need to implement your own typing. I guess you'll have a 2D array of characters for each number. [['a', 'b', 'c'], ['d', 'e', 'f']... You'll also need to implement a timeout after which you move on to the next character. Not to mention detecting

Application Error Occurs in Nokia 6300

北慕城南 提交于 2019-12-06 10:19:03
问题 I am using this code to connect Servlet. Mobile application when try to access internet. The following message appears in mobile. "Allow network access?? yes or no ". If I click "no" for that message in Nokia 6300 "Application Error" Warning will appear and it will close the application automatically. I tried other nokia mobiles like N70 and N72. Mobile will not show "Application Error". Is it Mobile problem or coding problem? Is there any efficient way to connect Servlet using http? public

How do I get kXML to work?

别说谁变了你拦得住时间么 提交于 2019-12-06 07:21:06
I'm trying to implement an existing XML parser: kXML . I ran into the following error: java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserException at com.sun.midp.midlet.MIDletState.createMIDlet(+29) at com.sun.midp.midlet.Scheduler.schedule(+52) at com.sun.midp.main.Main.runLocalClass(+28) at com.sun.midp.main.Main.main(+80) Execution completed. At this site you can find the error that I ran in to. The solution however doesn't work. I used the following script: C:\WTK2.5.2_01\bin\preverify -classpath .;C:\java_libraries\wirelesstoolkit\midpapi20.jar org.kxml2.io.KXmlParser C:\WTK2.5

J2ME Soft Key Wrapper

懵懂的女人 提交于 2019-12-06 04:27:59
问题 Reading some articles, told me that soft keys varies between devices. Some says -6 or -21 for left soft key and -7 or -22 for right soft key. Given this situation, is there any good wrapper or function or best practice to handle it properly? If not possible for ALL devices, what is the best way to support most devices? with minor or no hack at all? 回答1: To give you a feel for the scope of the problem have a look at this table of keycodes. Omermuhammed's approach is a good one if you are able

Using boolean var for stopping threads

淺唱寂寞╮ 提交于 2019-12-05 21:52:41
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); } catch(InterruptedException e) { System.out.println(e); } } } } public ThreadExample() { thr1 = new

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

为君一笑 提交于 2019-12-05 17:39:19
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, also claims MIDP 2.0 and CLDC 1.1 support. It doesn't have JSR75, which explains why "FileConnection

Is HTTP PUT supported in J2ME?

心已入冬 提交于 2019-12-05 16:23:17
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 be supported by phones implementing the MIDP 2.0 spec? Or any experience in finding phones that support

MIDP Java implementation of SQLite DB

耗尽温柔 提交于 2019-12-05 11:52:39
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? 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 version of SQLite in C# for windows mobile but you have got to wonder what impact a move to an interpreted

Reading UTF8 strings from a server through http using MIDP

◇◆丶佛笑我妖孽 提交于 2019-12-05 10:29:33
I want to read UTF-8 strings from a server that I have control of, using java MIDP. My server is sending UTF-8 data. The following code gets close: c = (StreamConnection) Connector.open( myServer, Connector.READ_WRITE); InputStream is = c.openInputStream(); StringBuffer sb = new StringBuffer(); int ch; while((ch = is.read()) != -1) sb.append((char)ch + "->" + ch + "\n"); I print the char and its code to debugging purposes. I think it is reading ASCII chars here, so, when I have some char that has its code above 127 then I get two chars, like the two examples bellow: letter á. UTF code E1 (hex)

Button Image Problem

元气小坏坏 提交于 2019-12-04 21:08:20
hallo. I want to ask something to you here. I know this may be easy for you, but this may be difficult for me. I learn new J2ME. I want to know the basics of the programing languages this. I have a case like this: class DrawImageCanvas extends Canvas { static Image image; static Image image2; static Image image3; static Image image4; static Image image5; static Image image6; static String string; int count; public void paint(Graphics g) { int width = getWidth(); int height = getHeight(); // Fill the background using black g.setColor(0xefffff); g.fillRect(0, 0, width, height); // Load an image