java-me

Is this possible to use lwuit.Dialog with javax.microedition.lcdui.Canvas in wireless toolkit 2.5.2?

两盒软妹~` 提交于 2019-12-02 03:03:41
I am using javax.microedition.lcdui.Canvas for drawing my string on the screen. But I also need one dialog window for some purpose. So I am using lwuit package ( com.sun.lwuit.Dialog ) for showing dialog window when key pressing. So in my program I just included that package and create the object of the Dialog box. While running my application, it is terminated unexpectedly. I just included the following lines... import javax.microedition.lcdui.Canvas; import com.sun.lwuit.Dialog; public class Mycanvas extends Canvas implements CommandListener { Dialog dialog = new Dialog(); //some other

send sms j2me appear promt message

主宰稳场 提交于 2019-12-02 02:59:39
问题 When I am sending sms via j2me application, before message sent it appears question for can I use internet to sent message. Is it possible to exit this question to not appear? 回答1: This is happening because you Accessing HTTP & SMS API. For using such API you need to signed your Java ME Application. For Signed a the Java ME Application, you need to purchase Signing Certificate from VeriSign or Thawte Site by paying the Fees. Plesae visit this link For VeriSign's certificate, they costs 20K

fetch the first date of the week

杀马特。学长 韩版系。学妹 提交于 2019-12-02 02:49:45
I want to fetch the first date of the week in java using Calendar and Date with the inputs as :: 1. Week number of the month 2. Month 3. year Calendar cal = Calendar.getInstance(); int weekOfMonth = Calendar.WEEK_OF_MONTH; System.out.println("weekOfMonth : " + weekOfMonth); After this i do not know to proceed. There is a method getFirstDayOfWeek() in Calendar class that will return the day in 0 for Sunday, 1 for Monday and so on.The following code snippet is based on this and will give you the first date of the week. private static Date getFirstDateOfWeek(){ Calendar cal = Calendar.getInstance

Doing a phone call in LWUIT

孤者浪人 提交于 2019-12-02 02:45:07
I have a textfield with phone number. All I want to do is when the textfield is focused and call button is pressed, application must be paused and call should be made to the phone number of the textfield using platformRequest API. I want to do it in lwuit. Can anyone suggest a idea how to do this? Sample code would be appreciated. Also you can do without extend MIDlet using this: String telNo = "tel no"; Display.getInstance().execute("tel:" + telNo); Your main class should extends with MIDlet . So there is no issues. You can call like this, String telNo = "tel no"; platformRequest(telNo );

How to get the power of a number in J2ME [duplicate]

假装没事ソ 提交于 2019-12-02 02:09:01
Possible Duplicate: J2ME power(double, double) math function implementation I'm developing a simple j2me application. There I need to get the power of a number as like as in the pow(double num1, double num2) in java. But as I got to know, j2me doesn't support to this pow() method. Any helpful option is appreciated. public double pow(double num1, double num2) { double result = 1; for (int i = 0; i < num2; i++) result *= num1; return result; } When developing applications for mobile devices using Java, you may require mathematical methods not available on your particular Java VM. You can use

LWUIT TextArea question

前提是你 提交于 2019-12-01 23:55:57
Is there any way to write in a textArea without going to a LCDUI window? I want to edit my textArea in my LWUIT app but everytime I try to do this, the app send me to a LCDUI window. To disable the LWUIT edit control trigger you can use the following code. textArea.setNativeTextboxTrigger(false); You need to implement the following code in the LWUIT TextArea source code static final String CLIENT_PROPERTY_FIRE_ACTION_TIMES = "FIRE-ACTION-TIMES"; static final String CLIENT_PROPERTY_DEAFULT_TEXT = "DEFAULT-TEXT"; public void setNativeTextboxTrigger(boolean enable) {

SQLite and J2ME

你。 提交于 2019-12-01 23:51:32
is it possible to use SQLite for a j2me application ? has anyone ever tried to do so ? SQLite is not written in Java so, what you're asking for is either making it available as a non-standard Java API, via some JNI-like interface or translating most of the SQLite source code into pure java code that would presumably use a JSR75 file connection for storage. The first solution is tantamount to adding a new JSR to the J2ME implementation on the phone, which is usually very hard if not impossible if you're not the phone manufacturer or one of its close partners. While I haven't looked at that

send sms j2me appear promt message

南楼画角 提交于 2019-12-01 22:58:10
When I am sending sms via j2me application, before message sent it appears question for can I use internet to sent message. Is it possible to exit this question to not appear? This is happening because you Accessing HTTP & SMS API. For using such API you need to signed your Java ME Application. For Signed a the Java ME Application, you need to purchase Signing Certificate from VeriSign or Thawte Site by paying the Fees. Plesae visit this link For VeriSign's certificate, they costs 20K per certificate. I think you can skip the prompt but your application must be signed. However, even if your

Get filename from an inputstream (Java)

半世苍凉 提交于 2019-12-01 18:01:10
if I have this code, how could I keep the filename of the original file or reassign it to the new one?: InputStream input= assetInfo.openStream(); File t = new File(""); OutputStream out = new FileOutputStream(t); int read=0; byte[] bytes = new byte[1024]; while((read = input.read(bytes))!= -1){ out.write(bytes, 0, read); } An input stream can be created to read from a file or from any other source of data. Therefore it makes no sense to have a filename attached to an input stream. Look in assetInfo to see if that class exposes that data (you can even look inside the class using reflection).

BouncyCastle RSA encryption for BlackBerry

ぐ巨炮叔叔 提交于 2019-12-01 17:46:56
How do I implement BouncyCastle RSA encryption for a BlackBerry application? As @itsteju points out, you can get the same functionality using the BlackBerry methods, but that does require an agreement and a royalty payment to Certicom. Bouncy Castle maintains a J2ME compatible release on their releases page . It's not their full API, but does support RSA encryption. As they provide source, the easiest way to integrate their RSA code into your project is to add their .java source files to your project and build. As I remember (I don't have the source readily available) they provide some classes