midp

HTTP authentication in J2ME

自作多情 提交于 2019-11-29 06:59:15
I'm trying to create a J2ME app, which talks to webserver using HttpConnection connector. When I am talking to the WebServer, I have to authenticate using Basic HTTP auth, which normally goes like http://username:password@website.com/rest/api/method But in J2ME, when I construct a url of this form, it doesn't work. I also tried adding request property, hc = (HttpConnection) Connector.open(url); hc.setRequestProperty("User", "alagu"); hc.setRequestProperty("pass", "mypassword"); but didn't work. Has anyone done j2me based HTTP auth before? Thanks in advance. It could be J2ME has no support for

How to deal with the most common classes missing on J2ME

只谈情不闲聊 提交于 2019-11-29 02:39:33
问题 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

Java - I need a very fast image scaling algorithm

浪子不回头ぞ 提交于 2019-11-28 21:40:27
I am working on a Midlet application. I am finding myself in the need to scale images very often. This has become a problem because some phones are pretty slow and scaling takes too long. Currently I'm using Image.createRGBImage(int, int, int, boolean) to scale the image. I was wondering if any of you knew of a very efficient and fast way to scale an image. Note: this is a Midlet application so only JavaME is available, meaning I don't have access to some other libraries available in the full java version. Note2: most of my scaling is done from small to large images, although I also do scale

FileConnection permission messages in j2me midp 2.0?

孤人 提交于 2019-11-28 14:07:04
I am using midp 2.0. Here, I am using FileConnection for read and write files on mobile memory. I am able to read and write files on mobiles successfully. But while I am trying to write file data on mobile, it asking message like below. Application wants to read from the local file system is it OK to read your files? if I press yes, then it again shows Application wants to write to the local file system is it OK to update your files? These message are continuously showing approximately 10 times. Is there any way to prevent this repeating this more than one time? I have included my fileWrite

How to read and write data into same file simultaneously

元气小坏坏 提交于 2019-11-28 11:41:10
I have read many a posts where-in they speak about reading and writing into the file NOT simultaneously using JavaME. I have a special use case scenarios where-in my log file (maybe full file or just portion of the file) is uploaded to the server on regular basis. This must continue without hampering the current logging of the application in this same file. The code sample is a under: boolean writing = true; boolean reading = true; void main() { new Thread("THREAD-FILE-READ") { public void run() { InputStream instream = getFileInStream(); if (null != instream) { while (reading) { try { try {

Displaying Alert with Yes, No Command

你离开我真会死。 提交于 2019-11-28 09:54:20
问题 At the J2me application I used an alert with yes, no command. If user clicks the yes command Form Screen will be displayed and if clicks the no command TextBox screen will be displayed. But the code does not work. For two command only textbox screen will be displayed. This is my code: public Login(){ yes=new Command("Yes",Command.OK,1); no=new Command("No",Command.CANCEL,1); alert=new Alert("","Save The Changes?",null,AlertType.CONFIRMATION); alert.setTimeout(Alert.FOREVER); alert.addCommand

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

╄→гoц情女王★ 提交于 2019-11-28 09:37:21
问题 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

Image rotation algorithm

喜欢而已 提交于 2019-11-28 06:26:02
I'm looking for an algorithm that rotates an image by some degrees (input). public Image rotateImage(Image image, int degrees) (Image instances could be replaced with int[] containing each pixel RGB values, My problem is that i need to implement it for a JavaME MIDP 2.0 project so i must use code runnable on JVM prior to version 1.5 Can anyone help me out with this ? EDIT: I forgot to mention that i don't have SVG APIs available and that i need a method to rotate by arbitrary degree other than 90 - 180- 270 Also, no java.awt.* packages are available on MIDP 2.0 earino One of the best pages

Getting Device IMEI

送分小仙女□ 提交于 2019-11-27 23:57:35
How to get the IMEI of a Java ME device in a common way that is applicable to all devices Usually, using java.lang.System.getProperty() can return the device IMEI. Unfortunately, the String parameter you need to use to get the IMEI will change from one handset manufacturer to the next. Strings to try: imei phone.imei com.lge.imei com.nokia.imei com.nokia.mid.imei com.siemens.imei com.sonyericsson.imei com.motorola.imei ... you get the idea. you may need to uppercase the last part of the string. the format of the result can change too. it can be a full imei with a "IMEI" prefix and 3 "-" in the

Java - I need a very fast image scaling algorithm

删除回忆录丶 提交于 2019-11-27 14:16:40
问题 I am working on a Midlet application. I am finding myself in the need to scale images very often. This has become a problem because some phones are pretty slow and scaling takes too long. Currently I'm using Image.createRGBImage(int, int, int, boolean) to scale the image. I was wondering if any of you knew of a very efficient and fast way to scale an image. Note: this is a Midlet application so only JavaME is available, meaning I don't have access to some other libraries available in the full