java-me

How can I display scroll text like marque in Blackberry using J2ME?

雨燕双飞 提交于 2019-11-27 07:32:02
问题 How can I display scroll like marquee text in Blackberry using J2ME? That moves from left to right or vertically? Any help will be very much appreciated. 回答1: its really easy to display. check the code below . import java.util.Timer; import java.util.TimerTask; import net.rim.device.api.ui.DrawStyle; import net.rim.device.api.ui.Field; import net.rim.device.api.ui.Font; import net.rim.device.api.ui.Graphics; import net.rim.device.api.ui.UiApplication; import net.rim.device.api.ui.component

Java Http Client to upload file over POST

ぃ、小莉子 提交于 2019-11-27 07:29:33
I'm developing a J2ME client that must upload a file to a Servlet using HTTP. The servlet part is covered using Apache Commons FileUpload protected void doPost(HttpServletRequest request, HttpServletResponse response) { ServletFileUpload upload = new ServletFileUpload(); upload.setSizeMax(1000000); File fileItems = upload.parseRequest(request); // Process the uploaded items Iterator iter = fileItems.iterator(); while (iter.hasNext()) { FileItem item = (FileItem) iter.next(); File file = new File("\files\\"+item.getName()); item.write(file); } } Commons Upload seems to be able to upload only

JSR 256 battery events

删除回忆录丶 提交于 2019-11-27 07:28:35
问题 How can I detect whenever the power cord is unplugged from electrical socket using JSR 256? 回答1: You would add javax.microedition.io.Connector.sensor to the API Permissions tab of the Application Descriptor of the project properties. 回答2: From a quick look at the specifications of the JSR: (you might want to look for code examples, starting with Appendix D of the spec itself, the latest JavaME SDK, Sony Ericsson developer website, then google) As always, I would be worried about fragmentation

Moving to Android from J2ME [closed]

时光总嘲笑我的痴心妄想 提交于 2019-11-27 07:15:51
Coming from J2ME programming are there any similarities that would make it easy to adapt to Android API . Or is Android API completely different from the J2ME way of programming mobile apps. Alexandre Hauser Actually the Android API is much more powerful than the J2ME. It is much easier to create an application for the Android. Using the J2ME you are limited to simple forms due to the absent of swing-like libraries (though now there exists a library called LWUIT, avoiding the need to recreate from scratch a swing-like library). In Android you will be able to create complex form very quickly,

J2ME VS Android VS iPhone VS Symbian VS Windows CE [closed]

不羁岁月 提交于 2019-11-27 06:46:19
I have very little idea about mobile platforms, though I am interested to program for them. Would you please compare J2ME VS Android VS iPhone VS Symbian VS Windows CE . I would like to know: which one is better which one should I choose and why if there is any VM technology to test the programs is there any IDE, debugging facilities? Personally, I would like to code for open source, but any suggestions are welcome. I have preliminary knowledge on Java. I would also like to know, if there is anything else that you can recommend. Jeremy Logan There's several of these questions floating around

how to dynamically get mobile IMEI number in J2me?

五迷三道 提交于 2019-11-27 06:32:53
问题 I has developed one j2me mobile application. Now client side want to see the mobile IMEI number. So I don't know how to get it, I have tried this line System.getProperty("com.nokia.IMEI"); but it will come null only. 回答1: Nokia System.getProperty("phone.imei"); System.getProperty("com.nokia.imei"); System.getProperty("com.nokia.mid.imei"); //especially for S40 devices Note: Requires signed MIDlet. S60 3rd edition device does not requires signing to fetch this info.On Series 40 phones this

What mobile platform should I start learning? [closed]

时间秒杀一切 提交于 2019-11-27 06:23:36
What mobile platform should I start learning? What matters is: ease popularity of the platform low cost of the SDK and actual handheld MicTech I think 3-4 platforms have a future. But it depends on what platform do you like and how you like freedom in distributing your applications :) Windows Phone 7 .NET and Silverlight through Windows Phone Marketplace Android Java through Android Market (fees) or like normal applications iPhone Objective-C or Java ( Developing iPhone Applications using Java ) through iPhone Market pay some fees ($99/year) The Incredible App Store Hype You need Mac (Mac OS)

Handling dependencies in blackberry development

房东的猫 提交于 2019-11-27 06:22:41
问题 How can I handle 3rd party dependencies in a .jad file? Is it possible to bundle a .jar ? Do you need to unpack it and include the .class files? 回答1: See approach of working with kXML2 open source library: for release you have to preverify it & build proj with ant: Ahmad Ferdous Bin Alam - How to Import kxml jar File to Your Project Slashdev - BlackBerry Development with Ant & Eclipse UPDATE: Tutorial: How To Use 3rd Party Libraries in your Applications for debug you have to add kXML sources

Logging in J2ME

谁都会走 提交于 2019-11-27 05:41:00
问题 What logging solutions exist for j2me? I'm specifically interested in easily excluding logging for "release" version, to have a smaller package & memory footprint. 回答1: If you are using preprocessing and obfuscation with Proguard, then you can have a simple logging class. public class Log { public static void debug(final String message) { //#if !release.build System.out.println(message); //#endif } } Or do logging where ever you need to. Now, if release.build property is set to true, this

int cannot be dereferenced

一笑奈何 提交于 2019-11-27 05:36:24
I am beginning in java (I'm learning in microedition) and I got this error: "int cannot be dereferenced" in the following class: class DCanvas extends Canvas{ public DCanvas(){ } public void drawString(String str, int x, int y, int r, int g, int b){ g.setColor(r, g, b); //The error is here g.drawString(str, x, y, 0); //and here } public void paint(Graphics g){ g.setColor(100, 100, 220); g.fillRect(0, 0, getWidth(), getHeight()); } } What am I doing wrong here? Well I came from PHP and ECMAScripts where I was able to pass my function arguments this way so I really don't understand this error.