java-me

How do I read strings in J2ME?

拥有回忆 提交于 2019-12-18 09:03:06
问题 I'm using the MIDP 2.0 (JSR 118) and I just noticed that there is no reader for strings in J2ME. Does anyone know how you are supposed to read Strings from an InputStream or InputStreamReader in a platform independent way (i.e. between two java enabled cell phones of different models)? 回答1: Alternatively have a look at DataInputStream.readUTF(). It does required that the string being read off the InputStream be encoded appropriately (as in by a corresponding DataOutputStream.writeUTF(String))

Java (ME) on Windows Mobile

亡梦爱人 提交于 2019-12-18 07:24:44
问题 Does anyone have experience deploying Java ME apps to Windows Mobile? What are the high-level steps to getting started with this, and are there any major drawbacks? 回答1: Well at first you need to install a JVM on your device (if one isn't already installed). There are currently two players for this: NSI Creme. This is a robust product but it only supports CDC profile (no MIDlets) and you need to buy a license for at least 1000 devices or so. IBM J9. This has CLCD support and can run MIDlets.

ArrayList in J2ME?

天大地大妈咪最大 提交于 2019-12-18 06:57:46
问题 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. 回答1: It is better if you use Vector ( java.util.Vector ). It will help you. 回答2: J2ME has Vector , which is the same as ArrayList , but all its methods are synchronized (a little bit slower). 回答3: http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/java/util/Vector.html public void asd(){ MyObject mo = new MyObject(

Database in J2ME

扶醉桌前 提交于 2019-12-18 05:13:16
问题 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? 回答1: 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

Regular expressions in J2ME

荒凉一梦 提交于 2019-12-18 04:54:24
问题 If I wanted to implement a regex engine in JavaME (Which lacks the regex libraries), where would be the best place to start? I'm imagining there is existing regex code out there which it would be possible to use as a starting point for porting. Failing that, a good guide on how to compile and execute a regular expression would do. 回答1: Could you investigate third party RegEx libraries, such as http://www.brics.dk/~amoeller/automaton/ ? Could you analyse your requirements and simplify your

Blackberry: Emoticons in Chat Application

99封情书 提交于 2019-12-18 03:48:26
问题 I want to make a chat application where the emoticons are necessary. I was trying to write my own TextBox to handle some unicode caracters and replace them with smiles and emoticons, but that was a hard work to do and I encountered many problems. Then I tried to make a custom font that will have emoticons in it but I found that a font is made in black and white and cannot be colored. I tried then to use different EditFields so when I find a Bitmap I draw it and start a different EditField but

FileConnection permission messages in j2me midp 2.0?

别说谁变了你拦得住时间么 提交于 2019-12-17 21:59:51
问题 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

Need some help in parsing this XML in J2ME platform

☆樱花仙子☆ 提交于 2019-12-17 20:50:05
问题 Below mentioned is my XML, <?xml version="1.0" encoding="utf-8"?> <soap:Envelopexmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <Response xmlns="http://tempuri.org/"> <Result> <mp_response> <data signature="something"> <outcome errorcode="0" errordescription="" errorsolution=""/> something </data> </mp_response> </Result> </Response> </soap:Body> </soap:Envelope> I wish to

Is there a way to get the stack trace of an exception in form of a String in Blackberry?

瘦欲@ 提交于 2019-12-17 20:13:57
问题 I want to log the stack trace of exceptions into a file. Is there a way that I can get the stack trace in form of a String , or somehow make ex.printStackTrace() print the trace into a stream or a file? I know that there is a way to do this in Java standard edition, but I want this in Blackberry. 回答1: BlackBerry only provides stack traces when you catch a Throwable. So you should be able to use printStackTrace and friends if you change the catch type. EDIT Sorry, I misread your question --

Processing chunked encoded HTTP POST requests in python (or generic CGI under apache)

荒凉一梦 提交于 2019-12-17 20:01:09
问题 I have a j2me client that would post some chunked encoded data to a webserver. I'd like to process the data in python. The script is being run as a CGI one, but apparently apache will refuse a chunked encoded post request to a CGI script. As far as I could see mod_python, WSGI and FastCGI are no go too. I'd like to know if there is a way to have a python script process this kind of input. I'm open to any suggestion (e.g. a confoguration setting in apache2 that would assemble the chunks, a