java-me

Porting Java SE Game to Java ME

北城以北 提交于 2019-11-28 06:18:03
问题 I'm learning to program in Java and would like to develop a mobile Chess game for the Blackberry platform. It was recommended to me that, as a beginner, I should build the game for regular desktop use and avoid the more complex mobile development for now. I was told that I can port the game to Java ME once development in SE is complete. My question is: is this really possible? What kinds of limitations exist between SE and ME that I should keep in mind while developing in SE? I'd hate to have

Eclipse IDE- Add jar? Add External jar? Add Library?

a 夏天 提交于 2019-11-28 05:49:41
I want to integrate TwitterAPIME to my Blackberry project. I have 3 Jar files provided by TwitterAPIME . I am not sure how to link these 3 Jar files to my project. My basic doubts are What is an External Jar ? What is a Library ? What's the difference between Adding jar, Adding External jar or Adding Library ? Lucifer What is an External JAR? External as the name suggest is a Jar file that is not built by the currently developing code. It is a utility Jar file that is added externally for extra features. It could be an API Jar file provided from the external site, just as in your case the 3

BlackBerry - draw image on the screen

◇◆丶佛笑我妖孽 提交于 2019-11-28 04:47:43
How to draw png images with specific size and position on the screen? Maksym Gontar Resize image public EncodedImage sizeImage(EncodedImage image, int width, int height) { EncodedImage result = null; int currentWidthFixed32 = Fixed32.toFP(image.getWidth()); int currentHeightFixed32 = Fixed32.toFP(image.getHeight()); int requiredWidthFixed32 = Fixed32.toFP(width); int requiredHeightFixed32 = Fixed32.toFP(height); int scaleXFixed32 = Fixed32.div(currentWidthFixed32, requiredWidthFixed32); int scaleYFixed32 = Fixed32.div(currentHeightFixed32, requiredHeightFixed32); result = image.scaleImage32

TextField not updating dynamically

随声附和 提交于 2019-11-28 04:43:46
问题 this is a really simple code in which text on a button is copied to a TextField. The code works fine but the TextField is not updating instantly on clicking the button. It updates only after i click on the TextField or when i drag the form not on pressing the button instantly. why is this happening,this behavior is unexpected. i am testing this code on a nokia 501 emulator which supports LWUIT. a = new Form("CALCULATOR") final TextArea data = new TextArea(); final Button ab = new Button("Some

how to read/write text file in j2me

孤街醉人 提交于 2019-11-28 04:43:26
问题 i want to know how to read and write text to a .txt file in j2me help me thanks... 回答1: public String readFile(String path) { InputStream is = null; FileConnection fc = null; String str = ""; try { fc = (FileConnection)Connector.open(path, Connector.READ_WRITE); if(fc.exists()) { int size = (int)fc.fileSize(); is= fc.openInputStream(); byte bytes[] = new byte[size]; is.read(bytes, 0, size); str = new String(bytes, 0, size); } } catch (IOException ioe) { Alert error = new Alert("Error", ioe

Best way to really grok Java-ME for a C# guy [closed]

我与影子孤独终老i 提交于 2019-11-28 04:09:13
I've recently started developing applications for the Blackberry. Consequently, I've had to jump to Java-ME and learn that and its associated tools. The syntax is easy, but I keep having issues with various gotchas and the environment. For instance, something that surprised me and wasted a lot of time is absence of real properties on a class object (something I assumed all OOP languages had). There are many gotchas. I've been to various places where they compare Java syntax vs C#, but there don't seem to be any sites that tell of things to look out for when moving to Java. The environment is a

Interacting with UI threads in Java/J2ME

醉酒当歌 提交于 2019-11-28 01:33:00
问题 I'm writing a J2ME application. One of the pieces is something that polls the contents of a directory periodically, and, if there are any new things, paints them on the screen. I've done this by having the UI form launch a polling thread with a pointer back to itself, and when the polling thread finds something it calls back to the form and calls a syncrhonized method to update it's display. This seems to work fine. The question I have is this. In C#/.NET I know it is not nice to have non-UI

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

Running J2me apps on Android phones

好久不见. 提交于 2019-11-27 23:54:08
问题 Is it possible to run J2ME apps on Android phones? If so, what is the installation procedure? Otherwise, is it possible to convert .jad files to .apk? In this case, what is the procedure. (I have already tested the procedure offered by netmite but it doesn't seem to work.) 回答1: Using this site http://www.netmite.com/android/srv/2.0/getapk.php you can convert your J2ME application in to Android Application. You need to just supply your .Jad & .Jar file in it and it will generate Android's

Playing Audio with J2ME

只愿长相守 提交于 2019-11-27 23:15:55
What is the best way to play audio utilzing the J2ME Media libary? For example, should I make use of the MMAPI or should I just use the Midlet's platformRequest(String s) method? The following code should work for 90-95% of handsets out there that support JSR-135. Ordering of all the various method calls is key for this to be portable. This is for sounds local to your JAR. Any streamed audio would be another problem altogether :) // loads the InputStream for the sound InputStream inputStream = this.getClass().getResourceAsStream( musicFile ); // create the standard Player musicPlayer = Manager