java-me

minimizing a mobile application on exit button press

故事扮演 提交于 2019-12-05 16:21:09
I am developing a mobile application using J2ME and LWUIT. Whenever the default exit Button (red in color) is pressed on a phone with symbian OS , I want my application to be minimized and not exited. How do i achieve this? According to Nokia documentation at http://library.developer.nokia.com/index.jsp?topic=/Java_Developers_Library/GUID-C5D3E0F5-72B9-4EE7-8BA7-20DE4A538FB8.html you can add the following jad key: Nokia-MIDlet-No-Exit. "Prevents the MIDlet from closing via pressing the End key. Instead of closing the MIDlet it is put to the background. The MIDlet can be still closed from the

Why is my NullPointerException not being caught in my catch block?

风格不统一 提交于 2019-12-05 16:15:25
I have a thread in which I catch all errors in a big, all-encompassing catch block. I do this so that I can report any error, not just expected ones, in my application. My Runnable looks like this: public final void run() { try { System.out.println("Do things"); /* [1] */ doUnsafeThings(); } catch (Throwable t) { System.out.println("Catch"); /* [2] */ recover(); } finally { System.out.println("Finally"); /* [3] */ } } I would expect the NPE to be caught by the Throwable catch block. Instead, the output at [2] is not printed, and neither is [3]. The output at [1] is printed. What I do get on

Optimizing for a smaller .cod (.jar) file

落花浮王杯 提交于 2019-12-05 13:28:38
The RIM compiler performs extra optimization and compression on the resulting ".jar" while building the final .cod file, but there are things that can be done by the developer to significantly reduce the final .cod file size. One such thing would be to run PNGCrush , OptiPNG , or a similar tool to reduce the size of the included .png files. In an application with a large number of image files (such as an app featuring a custom UI), this can yield a significant reduction in the final .cod file size. Do you have any tips for optimizing the final .cod file for size? Something to be done in the

net_rim_json_org not found

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 12:26:13
I have created one application in j2me, I have used json parsing in that application. I can build it SUCCESSFULLY. Parsing import: C:\Program Files\Research In Motion\BlackBerry JDE 6.0.0/lib/net_rim_api.jar(net_rim_json_org.cod) BUILD SUCCESSFUL (total time: 1 minute 3 seconds) But when imported application on blackberry 9000 v5.0, and trying to open it it showing net_rim_json_org not found My question is, it's showing that net_rim_api.jar (net_rim_json_org.cod) imported but when I am trying on device its showing error - why is this happening? Tariq M Nasim I also faced this problem and have

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

How to use Adobe Reader Mobile SDK 9 to develop pdf/epub reader?

折月煮酒 提交于 2019-12-05 11:51:37
How can I use Adobe Reader Mobile SDK 9 to develop a pdf/epub reader for blackberry device? Please help me if you have any idea about Adobe Reader mobile SDK. Thanks. No, RMSDK can't be used on Java platforms unless you can use JNI. I've been building apps for Android and iOS with RMSDK. What exactly is the problem? Android uses NDK for accessing some native code, necessary to run the DRM and view workflows. iOS has everything sorted out within XCode, including the C/C++ dependencies. 来源: https://stackoverflow.com/questions/2824990/how-to-use-adobe-reader-mobile-sdk-9-to-develop-pdf-epub

BlackBerry - KeyListener with global scope

梦想的初衷 提交于 2019-12-05 11:28:11
I am new to BlackBerry App development. I want to be able to listen for keypress events whenever the BlackBerry (8900 in my case) is on and on all screens is this possible? If so, it would be great for someone to direct me in the right direction. I am already having a look at Interface KeyListener. import net.rim.device.api.system.*; Thanks all Ali El-sayed Ali Implement a keylistenerClass like: import model.Profile; import net.rim.device.api.system.KeyListener; import net.rim.device.api.ui.Keypad; public final class ShortcutHandler implements KeyListener { public boolean keyChar(char key, int

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)

Adding Java ME platform in NetBeans

冷暖自知 提交于 2019-12-05 08:56:47
I installed NetBeans 7.2.1 with JDK 7 and the plug-in - Java ME SDK 3.2 (it has Wireles Toolkit 2.5.2 inside). I try to create new project by clicking File/New Project/Java ME/Mobile Application . Then I click next . In next window the message: Every CLDC project needs to have CLDC compatible SDK/platform/emulator assigned to it. Pressing Install SDK/Platform/Emulator button opens Platform Installation wizard, which allows you to "add platform". I tried clicking Install SDK/Platform/Emulator button and I tried then indicating the folder, where Java ME 3.2 is installed. It can recognize the

How do you organize your code in a j2me project?

随声附和 提交于 2019-12-05 02:58:10
问题 Sorry if what I'm about to ask you is a silly question, but since I'm taking my first steps into j2me I have to do it. I know that you can have multiple screens in a single MIDlet, but that doesn't seem to be a good idea when you're going to have a considerable number of screens(more than 10) as it would end up in a complete mess. So here's the question(not sure if possible), how do you usually organize your code in a j2me project? Or do you put everything inside a single MIDlet or do you