java-me

Porting Java SE Game to Java ME

霸气de小男生 提交于 2019-11-29 12:52:18
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 to go back and undo most of my work in order to get the game to work on my Blackberry. martin clayton

Porting C library to Java for Blackberry application

社会主义新天地 提交于 2019-11-29 11:54:39
I need to port a C library to Java so it can run on the Blackberry platform (mobile, native application). The options I am considering are: bytecode conversion (cibyl, etc) Complete port Wrap C code around Java using JNA (would this even work for Blackberry?) Please let me know which option is best. thanks Aha. Some quick googling says "No, JNI does not work for blackberry" source: http://supportforums.blackberry.com/t5/Java-Development/Can-we-use-JNI-Java-Native-Interface-approach-in-Blackberry/m-p/365362 http://supportforums.blackberry.com/t5/Java-Development/JNI/m-p/41140 . So you're stuck

ArrayList in J2ME?

南楼画角 提交于 2019-11-29 11:44:07
I have an arraylist of database records. I want to put it in my J2ME List. But there is no split or arraylist in J2ME. How can I do it? A code example would be nice. SIVAKUMAR.J It is better if you use Vector ( java.util.Vector ). It will help you. Roman J2ME has Vector , which is the same as ArrayList , but all its methods are synchronized (a little bit slower). http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/java/util/Vector.html public void asd(){ MyObject mo = new MyObject(); Vector v = new Vector(); //Adds the specified component to the end of this vector, increasing its

TextField not updating dynamically

左心房为你撑大大i 提交于 2019-11-29 11:38:28
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 Value"); ab.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent arg0) { //

how to read/write text file in j2me

泪湿孤枕 提交于 2019-11-29 11:09:17
i want to know how to read and write text to a .txt file in j2me help me thanks... 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.getMessage(), null, AlertType.INFO); error.setTimeout(1212313123); Display.getDisplay(main).setCurrent(error);

What is the best approach to handling exceptions thrown in a separate thread?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 10:14:21
问题 I am working on a J2ME project that spawns worker threads for numerous tasks such as downloading HTTP content. The basic thread layout is similar to most java apps--there is a main UI thread and worker threads spawned to do stuff behind the scenes. My question is what is the best way to handle exceptions that occur in the worker threads? I usually adhere to the design rationale that most exceptions should be percolate as far as possible. When I write single threaded apps, it is common for me

Recommendation for Java VM running on embedded system

走远了吗. 提交于 2019-11-29 09:21:50
问题 We are trying to support Java enviroment on our embedded platform (700 MHz MIPS 74K, 128-256 MB memory). After reading this article and googling a bit, I came up with the shorted list: Java ME from Sun Kaffe Jbed Perc HP Chai VM PhoneME - seems the most promising one IBM WEME (Thanks to Thorbjørn Ravn Andersen) Aplix JBlend (Thanks to QuickRecipesOnSymbian) I was quite new to Java and its runtime enviroment. What do you recommend for a Java VM running on MIPS 74K? 回答1: You might want to look

How to consume ASP.NET Web API from a Java ME Application

拥有回忆 提交于 2019-11-29 08:47:34
I have created a java ME application (prototype) and now I need to consume my WEB API service from a MIDlet. First of all, is it possible to consume Web API services from MIDlets?? I have converted my WCF to Web API just so that I can make my J2ME app have access to my services in a more straightforward way. The problem is that I have no idea how to call my web API methods from a MIDlet. Have you ever done anything similar? Do you have any links that you can share?? EDIT: I have found how to consume a method from Web API, but still don't know how to turn what I get from the web API into

Database in J2ME

家住魔仙堡 提交于 2019-11-29 08:05:25
I am new in J2ME. In my Application, I want to add the Multiple Records in the Record Store and also want to access it. How can I add the multiple Records in the Record Store and how can I access it? Here is my library code for RMS, just study it, it is very easy to implement, all the methods like insert,updated, delete is there. import javax.microedition.rms.RecordEnumeration; import javax.microedition.rms.RecordStore; import javax.microedition.rms.RecordStoreFullException; import javax.microedition.rms.RecordStoreNotOpenException; import com.project.gui.components.CustomAlert; import com

Problem transmiting a RSA public key, javaME , bouncy castle

时光怂恿深爱的人放手 提交于 2019-11-29 08:04:59
I'm working on the porting of an instance messaging application from Java to JavaME ,that also implements cryptography. The problem is that I want to send my public key to the server. The desktop client has this code for this job: byte[] encoded_public_key=publick_key.getEncoded(); And the server has this code to retrieve the key: EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encoded_public_key); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); PublicKey puKey = keyFactory.generatePublic(publicKeySpec); Now I've looked the API for the getEncoded and it says that it returns the