java-me

Checking Battery Status in Blackberry development

感情迁移 提交于 2019-12-23 17:18:59
问题 I am developing an application for 8900 + 9000 Blackberry. In my application I need to check if the battery is connected to a charger, specifically an in-car charger. I used the following to check if the battery is charging: if (DeviceInfo.getBatteryStatus() & DeviceInfo.BSTAT_CHARGING) != 0){} This works fine but if the battery is fully charged then this is false. So I tried checking BSTAT_IS_USING_EXTERNAL_POWER and BSTAT_AC_CONTACTS to see if either of them come as true but they are both

how to turn Bluetooth on/off with J2ME?

徘徊边缘 提交于 2019-12-23 15:08:24
问题 I want to write a program in J2ME to turn the Bluetooth on/off automaticly in a certain time without the user permission. I'v been looking for a while but I couldn't find an answer. 回答1: Some phones will automatically switch bluetooth ON when a MIDlet starts using the Java ME Bluetooth API. Other phones will not. AFAIK, there is no Java ME API to switch bluetooth ON/OFF. I have yet to find a mobile phone that automatically switches bluetooth OFF after some time of inactivity. Any way you find

Generate AES key with seed value

一笑奈何 提交于 2019-12-23 15:04:10
问题 How do I Generate AES key with seed value so that whenever I generate key with same seed value,I shud be able to get the same AES key? I want to generate this key for my Blackberry Pearl 8100 device. I am not able to generate AES key with AESKey(keyData) . Also whenever I print it either in the form of String or byte[] , I am not able to generate it.(print it) Actual key is never printed. What can be done to get the key? Update I tried generating AESKey by passing byte[] of my data,as follws:

Unexpected JDWP Error 21

大憨熊 提交于 2019-12-23 12:58:15
问题 HttpConnection conn = (HttpConnection) Connector.open(strDefURL + strBloggersURL); I have this line throwing "InternalException: Unexpected JDWP Error: 21", I am using it to get some XML back from a servlet I have created. The odd thing is that the string later gets filled with the XML from the servlet. I am not able to parse this though and obviously need to debug from the top down, this being the first error in my code. Unable to find a resolved ticket to date, I have added one myself: http

run j2me app on android?

时光怂恿深爱的人放手 提交于 2019-12-23 12:49:22
问题 is it possible to run java SE or Java ME app on android ??? 回答1: If you search for "J2ME runner android" on Google, you'll find some hits for projects which claim to allow you to run J2ME projects on Android. e.g. http://www.netmite.com/android/ I'm not sure what you mean by Java SE in this case. Technically Dalvik is a lot closer to J2SE than to J2ME. A large set of the APIs are there, and code will likely cross-compile without issue. You can even include a lot of J2SE JARs in your project

(J2ME) How to get list of files/resources inside my jar app

时光毁灭记忆、已成空白 提交于 2019-12-23 12:43:31
问题 So, I am creating a mobile application using j2me and lwuit. In that application the user will open a file. My question is how do I get list of files inside my jar application.. Ex : Inside a res folder there are : File1.fl, File2.fl, File3.fl, We can open a single file using getResourceAsStream() function. But how do I get the list of file names inside the folder. I came across with FileConnection but it seems that it is used to access files in the local phone. In java we can do this using

Receive text message using J2ME

感情迁移 提交于 2019-12-23 12:43:03
问题 I am trying to make a J2ME application to SEND and RECEIVE text messages. I'm done with the sending part of it but I am not able to receive any message.. Below is what I tried in order to receive text message; try { MessageConnection conn = (MessageConnection) Connector.open("sms://:50001"); conn.setMessageListener(new MessageListener() { public void notifyIncomingMessage(MessageConnection conn) { try { Message msg; msg = conn.receive(); if (msg instanceof TextMessage) { TextMessage tmsg =

Are all Java SE classes available in Java ME?

旧城冷巷雨未停 提交于 2019-12-23 12:36:38
问题 I'm a Java newbie. Wanted to know if all Java SE classes are available in Java ME . If not why is it so? 回答1: No, only a subset is available, see http://java.sun.com/javame/technology/index.jsp for an introduction. A brief overview is given in this Wikipedia article: Noteworthy limitations Compared to the Java SE environment, several APIs are absent entirely, and some APIs are altered such that code requires explicit changes to support CLDC. In particular, certain changes aren't just the

LWUIT scroll jumping issue

跟風遠走 提交于 2019-12-23 11:48:51
问题 I need to show the only component on the form - HTMLComponent . Reaching the bottom of the form/component while vertical scrolling scroll bar jumps back to the top of the form. I need to prevent this. I've tried to turn on/off scrolling on the form and HTMLComponent but anyway if there's a scroll bar - it will return to the top from the bottom. Also I've tried border and box layouts and additional container for HTMLComponent - no use. Any ideas how to prevent such scrolling issue? 回答1: Try

How to send MMS in J2ME? [closed]

本秂侑毒 提交于 2019-12-23 09:32:54
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . How to send MMS in J2ME? 回答1: See JSR 205. Here's a sample code at Java Tips. Obviously the handset and service provider have to support MMS... Last link, a more descriptive piece on J2ME MMS. 回答2: Martin Clayton