java-me

Current latitude and longitude in a BlackBerry app

烈酒焚心 提交于 2019-12-06 11:31:57
问题 I want to get the user's latitude and longitude in my BlackBerry app, and then generate the maps according to it. How can I do that? my code is: import java.util.Timer; import java.util.TimerTask; import javax.microedition.location.Criteria; import javax.microedition.location.Location; import javax.microedition.location.LocationListener; import javax.microedition.location.LocationProvider; import javax.microedition.location.QualifiedCoordinates; import net.rim.device.api.system.Application;

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

How to handle chunked encoding request properly?

六眼飞鱼酱① 提交于 2019-12-06 10:26:24
问题 I have two websites: one with Lighttpd with PHP and second with Apache and neither of this handle chunked transfer encoding properly. I send this request from my mobile, J2ME and there is no possibility to change this transfer type to any other. So my only way to go is to handle chunked transfer enconcoded requests in other way. Any solution will be good as long as I can enable it on my CentOS server where I can install and change everything that will be necessary. So my question is: how to

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

Splash screen image size

安稳与你 提交于 2019-12-06 09:51:35
I am creating a splash screen for my BlackBerry app. Right now the image is not properly placed in all the simulators on which I am testing. What should be the size of my image for the splash screen, so that it fits in all the device sizes? The main part is, creating Startup Class which extends UiApplication . This is the StartUp.java public class StartUp extends UiApplication { public static void main(String[]args) { StartUp start=new StartUp(); start.enterEventDispatcher(); } public StartUp() { this.pushScreen(new SplashScreen()); invokeLater(new Runnable() { public void run() { try { Thread

How to read an SMS message from inbox using j2me (midp2.0)?

孤街浪徒 提交于 2019-12-06 09:37:16
问题 I want to access the inbox message text from j2me application. I have no idea about accessing inbox. 回答1: You can't achieve this with j2me. I already discussed in Nokia forum. See this link. 回答2: Yes, But you can not directly access the In-Box using J2ME Code, You need a .Jar file called APIBridge.jar This .Jar file allows you to interact with the lowerlever api. As the name implies it is a Bridge between J2ME API and Native OS API. Please visit this link for more information. 来源: https:/

question for terminate app in j2me but it doesnt mean quit from application

这一生的挚爱 提交于 2019-12-06 09:10:42
问题 i have case in j2me .. i want terminate when app in process execute code. this is my simple code. else if (c == cmdStop) { //command berhenti browser.stop(); } public void stop(){ // No errors int errorCode = 0; // An error occurred errorCode = -1; // Terminate System.exit(errorCode); } the problem is when i try to terminate app, the app still worked or continue execute and ignore function system.exit. still excecute this code private void paintParserScreen(Graphics g){ int w = width; int h =

Convert java 5 code using generics to code that can run on a J2ME device?

偶尔善良 提交于 2019-12-06 09:03:54
问题 Are there any solutions or tools that transform java 5 code that uses all the new java 5 features(generics, autoboxing, varargs, static imports) into code that can run on a J2ME device? I am particularly interested in handling generics - the other features are nice to have but not mandatory. I need source code as the result of this conversion as this will be compiled using a custom compiler. (I cannot use bytecode manipulation(ala retroweaver)) 回答1: Compiling with the regular javac and

how to parse this json response?

和自甴很熟 提交于 2019-12-06 08:15:07
i know how to parse response like {\"screenTitle\":\"National Geographic\"} token.optString("screenTitle"); up to this ok. but see this response { "status": "OK", "routes": [ { "summary": "Southern Exp", "legs": [ { "steps": [ { "travel_mode": "DRIVING", "start_location": { "lat": -34.9257700, "lng": 138.5997300 }, "end_location": { "lat": -34.9106200, "lng": 138.5991300 }, i want the lat and long value. how can i achive this. Nothing will be able to parse the string that you've provided, because it has syntax errors. However, this is JSON . Follow the instructions of your favourite tool that

j2me - Does a List have any property to keep track of 'key' that identify the item

霸气de小男生 提交于 2019-12-06 07:44:17
How do you usually deal with Lists and the fact that they don't have a property to clearly identity an specific item ? So far, the only solucion I could come up with is to put the key I use at the beginning, followed by a hyphen and the text that is shown on every item. This way when I retrieve the text from the selected item I can get the key for the item. This is how I do it, but surely there's gotta be a better solution and I'd really like that you could share your experience in this kind of scenarios. Thanks in advance. The picture ooks like you keep all the data managed in your