java-me

add icon to j2me application

故事扮演 提交于 2019-12-07 15:07:15
问题 How can I add icon for my j2me application midlet? I am using eclipse. 回答1: In MIDlet description file ( MANIFEST.MF ) change/add such lines: MIDlet-1: YourMidletName,icon.png,MainClass MIDlet-Icon: icon.png 回答2: If You are using the netbeans for developing j2me.Then follow this step:- Custmoization--->Application Description--->click Midlet Tab--->Select the midlet and click on edit button---->then select the Midlet icon which u want to use.Select ok--->execute it in phone 回答3: MIDlet-Name:

how to use the HTTP range header in J2ME?

坚强是说给别人听的谎言 提交于 2019-12-07 14:32:09
问题 is it possible to use range header in HTTP with HTTP GET request? if yes than how? I just want to download bytes from server with specified bytes. i.e if I want to download bytes from 0 to 255. 回答1: See this sample code, HttpConnection connection = null; InputStream inputstream = null; try { connection = (HttpConnection) Connector.open(url); // Enter your URL here. //HTTP Request connection.setRequestMethod(HttpConnection.GET); connection.setRequestProperty("Content-Type","//text plain");

J2ME - using javax.microedition.amms.control.camera.CameraControl; is it possible to disable shutter sound?

好久不见. 提交于 2019-12-07 13:06:32
问题 In my Blackberry app I've implemented the camera and would like to replace the default shutter sound with my own. I figured I could do this by silencing the default camera sound by using the method enableShutterFeedback(false) then playing my own sound, or playing my sound immediately before the camera is activated. private void initializeCamera() { try { // Create a player for the Blackberry's camera Player player = Manager.createPlayer( "capture://video" ); // Set the player to the REALIZED

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

J2ME like Sprite on Android

一世执手 提交于 2019-12-07 10:33:15
问题 For my useless project of the month I'm working on a 'emulator' to run J2ME programs on Android. But now I'm stuck with the J2ME Sprite implementation. Specifically the transformations used in it. In my Sprite I have a bitmap with three character images. I would like to paint the second frame mirrored or rotated 90 degrees. What would be the best way for it? I have following code that paints the given frame without any transformations. frameX, frameY are frame position coordinates on give

What's the best way to go about developing a modern J2ME app? [closed]

大憨熊 提交于 2019-12-07 09:53:36
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I've been so confused deciding on how to proceed about designing the UI of a J2ME app. Basically I have finished working on the

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

非 Y 不嫁゛ 提交于 2019-12-07 08:17:23
问题 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,

Optimizing for a smaller .cod (.jar) file

强颜欢笑 提交于 2019-12-07 07:47:51
问题 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

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(),