java-me

Extract source code from .jar file

两盒软妹~` 提交于 2019-11-26 10:07:03
问题 Is there a way to extract the source code from an executable .jar file (Java ME)? 回答1: Use JD GUI. Open the application, drag and drop your JAR file into it. 回答2: You can extract a jar file with the command : jar xf filename.jar References : Oracle's JAR documentation 回答3: I believe this can be done very easily. You can always extract the source files (Java files) of a jar file into a zip. Steps to get sources of a jar file as a zip : Download JAD from http://techieme.in/resources-needed/ and

How do I convert between ISO-8859-1 and UTF-8 in Java?

时间秒杀一切 提交于 2019-11-26 08:51:15
问题 Does anyone know how to convert a string from ISO-8859-1 to UTF-8 and back in Java? I\'m getting a string from the web and saving it in the RMS (J2ME), but I want to preserve the special chars and get the string from the RMS but with the ISO-8859-1 encoding. How do I do this? 回答1: In general, you can't do this. UTF-8 is capable of encoding any Unicode code point. ISO-8859-1 can handle only a tiny fraction of them. So, transcoding from ISO-8859-1 to UTF-8 is no problem. Going backwards from

How to trim the whitespace from a string? [duplicate]

送分小仙女□ 提交于 2019-11-26 07:46:26
问题 This question already has answers here : Strip Leading and Trailing Spaces From Java String (6 answers) Closed last year . I am writing this function for a J2ME application, so I don\'t have some of the more advanced / modern Java classes available to me. I am getting java.lang.ArrayIndexOutOfBoundsException on this. So, apparently either it doesn\'t like the way I\'ve initialized the newChars array, or I\'m not doing something correctly when calling System.arraycopy . /* * remove any leading

Blackberry - Loading/Wait screen with animation

拟墨画扇 提交于 2019-11-26 07:24:31
问题 Is there a way to show \"Loading\" screen with animation in blackberry? Options: PME animation content multithreading + set of images + timer/counter standard rim api some other way Any of this? Thanks! 回答1: Fermin, Anthony +1. Thanks to all, you gave me the part of answer. My final solution: 1.Create or generate (free Ajax loading gif generator) animation and add it to project. 2.Create ResponseCallback interface (see Coderholic - Blackberry WebBitmapField) to receive thread execution result

Android how to get access to raw resources that i put in res folder?

泪湿孤枕 提交于 2019-11-26 03:38:30
问题 In J2ME, I\'ve do this like that: getClass().getResourceAsStream(\"/raw_resources.dat\"); But in android, I always get null on this, why? 回答1: InputStream raw = context.getAssets().open("filename.ext"); Reader is = new BufferedReader(new InputStreamReader(raw, "UTF8")); 回答2: For raw files, you should consider creating a raw folder inside res directory and then call getResources().openRawResource(resourceName) from your activity. 回答3: In some situations we have to get image from drawable or

Difference between volatile and synchronized in Java

旧街凉风 提交于 2019-11-26 03:13:29
问题 I am wondering at the difference between declaring a variable as volatile and always accessing the variable in a synchronized(this) block in Java? According to this article http://www.javamex.com/tutorials/synchronization_volatile.shtml there is a lot to be said and there are many differences but also some similarities. I am particularly interested in this piece of info: ... access to a volatile variable never has the potential to block: we\'re only ever doing a simple read or write, so

Difference between Java SE/EE/ME?

送分小仙女□ 提交于 2019-11-26 02:04:19
问题 This post is a Community Wiki . Edit existing answers to improve this post. It is not currently accepting new answers. Which one should I install when I want to start learning Java? I\'m going to start with some basics, so I will write simple programs that create files, directories, edit XML files and so on, nothing too complex for now. I guess Java SE (Standard Edition) is the one I should install on my Windows 7 desktop. I already have Komodo IDE which I will use to write the Java code. 回答1

J2ME/Android/BlackBerry - driving directions, route between two locations

徘徊边缘 提交于 2019-11-25 22:31:52
问题 On Android 1.0 there was a com.google.googlenav namespace for driving directions: Route - Improved Google Driving Directions But in newer SDK it was removed by some reason... Android: DrivingDirections removed since API 1.0 - how to do it in 1.5/1.6? On BlackBerry there is also lack of APIs for such stuff: how to find the route between two places in Blackberry? csie-tw gives a workaround (query gmaps for kml file and parse it): Android - Driving Direction (Route Path) Also Andrea made a

Convert a JSON string to object in Java ME?

谁说我不能喝 提交于 2019-11-25 22:27:47
问题 Is there a way in Java/J2ME to convert a string, such as: {name:\"MyNode\", width:200, height:100} to an internal Object representation of the same, in one line of code? Because the current method is too tedious: Object n = create(\"new\"); setString(p, \"name\", \"MyNode\"); setInteger(p, \"width\", 200); setInteger(p, \"height\", 100); Maybe a JSON library? 回答1: I used a few of them and my favorite is, http://code.google.com/p/json-simple/ The library is very small so it's perfect for J2ME.