java-me

Message passing to asynchronus working thread in Java J2ME

↘锁芯ラ 提交于 2019-12-10 11:54:19
问题 I'm working on a J2ME Bluetooth application, and one of the classes searches for other Bluetooth devices. It does this in another thread, so the GUI doesn't freeze up. The problem I have is how to pass messages to the thread. I can ask it to search, or cancel searching, and it can tell the GUI it has found some other devices. Currently I use notify and wait, but that seems like a hack. What I really want is some way of calling notify with a parameter, for example what I want it to do. Is

Java ME libraries

早过忘川 提交于 2019-12-10 11:19:53
问题 Java ME is quite sparse on features. Are there any libraries you use to add missing features? I don't want to focus on UI libraries - these are better discussed here. I am aware of that there exists JSRs with optional features. 回答1: There is some useful stuff at j4me.org. 回答2: For various crypto functions, The Legion of the Bouncy Castle Lightweight API for J2ME. 回答3: Java ME was intentionally designed to be based on JDK 1.3, so yes it is quite old and sparse. But a lot of handset

Splash screen image size

*爱你&永不变心* 提交于 2019-12-10 11:05:37
问题 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? 回答1: 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

String replace in Java ME double space

主宰稳场 提交于 2019-12-10 10:59:53
问题 How can I replace "a b" by "a b" in Java ME? The replace() method doesn't accept Strings, but only characters. And since a double space contains two characters, I think I have a small problem. 回答1: What do you think of this one? I tried one myself. private String replace(String needle, String replacement, String haystack) { String result = ""; int index = haystack.indexOf(needle); if(index==0) { result = replacement+haystack.substring(needle.length()); return replace(needle, replacement,

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

社会主义新天地 提交于 2019-12-10 10:56:34
问题 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

Get battery status from J2ME

假装没事ソ 提交于 2019-12-10 10:53:06
问题 How can I get battery status through J2ME ? 回答1: Well, the only standard way of doing this is through JSR-256. The mobile Sensor API. You can read the specifications from http://www.jcp.org/en/jsr/detail?id=256 Unfortunately it is very recent and not actually implemented in most retail phones yet. When it ships, the Sony Ericsson Satio (or Idou) will have it. Edit: Nokia N97 has JSR-256 and it can be installed on Nokia N85 and Nokia 5800. Edit: Here's Attilah's other JSR-256 question with

Hide Password Content in Source Code

荒凉一梦 提交于 2019-12-10 09:43:40
问题 Does anyone know how to hide the password contents in the source code of a j2me program? i.e. so people cannot see "DBT" as password who read the source code. public void validateUser(String user, String Password) { if (user.equals("N0203251") && Password.equals("DBT")) { switchDisplayable(null, getContinue()); } } 回答1: As other have said. Store the hash, though you still need to use a strong password or an automated guesser will find the one you're using. But, be warned: If your attacker has

How to use Adobe Reader Mobile SDK 9 to develop pdf/epub reader?

删除回忆录丶 提交于 2019-12-10 07:24:56
问题 How can I use Adobe Reader Mobile SDK 9 to develop a pdf/epub reader for blackberry device? Please help me if you have any idea about Adobe Reader mobile SDK. Thanks. 回答1: No, RMSDK can't be used on Java platforms unless you can use JNI. 回答2: I've been building apps for Android and iOS with RMSDK. What exactly is the problem? Android uses NDK for accessing some native code, necessary to run the DRM and view workflows. iOS has everything sorted out within XCode, including the C/C++

Read file contents in j2me

安稳与你 提交于 2019-12-09 20:07:58
问题 I Have a file like shown below, OrderNo id name count Format 1 AA1 sdflsdfsdfd 12 01 2 AB2 asdaewqrftr 13 02 3 AA3 aerefytrsu 12 01 I want to read this file and want to sort with orderNo. Please suggest me some way to read and sort.(in J2ME). Thanks... 回答1: Create an object representing this Read the file line by line ('\n' new line ) Sort them in memory and write them back. Note: Be careful about memory 来源: https://stackoverflow.com/questions/6069879/read-file-contents-in-j2me

Can't access/read SIM phonebook in Nokia

為{幸葍}努か 提交于 2019-12-09 18:47:55
问题 am trying to access both the Phone's phonebook and SIM phonenook on Nokia 5130c-2 XpressMusic. The app runs without errors but it only returns the numbers from the phone's Phonebook. When I list the available phonebooks using this code String[] all_contact_lists=PIM.getInstance().listPIMLists(PIM.CONTACT_LIST); it gives me both the Phonebook and SIM card lists. i.e 1. Phone 2. SIM I have tried explicitly reading from the SIM card using this code but it still returns nothing(even though I have