java-me

Switch to a Visual Design from another Visual Design

社会主义新天地 提交于 2019-12-11 03:13:22
问题 I'm working in java me. I created two visual designs, First.java and Second.java both of which contains form displayables. I added an Ok command to a form in First.Java and the user is expected to switch to SecondForm in Second.java but I get this error non-static method getSecondForm() cannot be referenced from a static context . How can I fix this? Both files are in the same package. Here's the source code public void commandAction (Command command, Displayable displayable) { if

Calling atan function on Blackberry 4.2 JDE

爱⌒轻易说出口 提交于 2019-12-11 03:11:33
问题 I need to calculate the arc tan value from my Blackberry Java app. Unfortunately, the blackberry 4.2 api doesn't have the Math.atan() function. Version 4.6 of the Blackberry JDE has it, but not 4.2. Does anyone know of a workaround to calculate atan? 回答1: From Arctan in J2ME by Stephen Zimmerman: // calculation functions public class Calculation { // Because J2ME has no floating point numbers, // some sort of fixed point math is required. // My implementation is simply to shift 10 places. //

handle text html in j2me

江枫思渺然 提交于 2019-12-11 02:56:37
问题 I tried to make application RSS news, and it can give detail news to user. When I go to detail, the body text is show the html tag. This is picture of my application: I don't want to show html tags. This is my code to show detail page: private void detailScreen(News news){ Form form = new Form(news.getTitle()); StringItem detail = new StringItem("", news.getBody().toString()); mBackCommand = new Command("Back", Command.BACK, 0); form.append(detail); form.addCommand(mBackCommand); form

Eclipse MTJ doesn't see Java ME SDK 3.0 devices

久未见 提交于 2019-12-11 02:49:45
问题 I have installed Eclipse: Eclipse Java EE IDE for Web Developers. Version: Helios Service Release 2 Build id: 20110218-0911 and MTJ plug-in Version: 1.1.2.201101310801 When I click Preferences -> Java ME -> Device Management -> Manual Install and specify C:\Java_ME_platform_SDK_3.0.5 for searching, MTJ finds nothing. Why? P.S. Windows XP 32-bit SP3 回答1: I removed SDK3.0 and installed 2.5.2 It works 回答2: You need to add EclipseME plugin for Eclipse. But I suggested to use Eclipse pulsar for

How do you clear the RecordStore of your midlet in Netbeans?

眉间皱痕 提交于 2019-12-11 02:49:20
问题 I find that when I try to add some new records, the already exist in the recordstore of the midlet, but I don't know where do I find the option to clear the midlet's recordstore in its emulator. Any help appreciated, Ted 回答1: Follow the below steps for clear the RMS in your netbeans project, Select the Tools and go to Java Platforms. Select Sun Java(TM) Wireless Toolkit 2.5.2 for CLDC under J2ME. Select the Tools & Extensions tab and click the Open Utilities . One Utilities Popup will appear

NullPointerException for lwuit.html.CSSEngine.applyStyleToUIElement(Unknown Source)

耗尽温柔 提交于 2019-12-11 02:39:53
问题 I'm doing below procedure for LinkedIn login but unfortunately while loading the LinkedIn for login window of "Grant Yokeapp access to your LinkedIn Account" It's not showing anything and fires error. I'm using version of LWuit-1.5 in Eclipse pulsar with S60 SDk 5th installed. public class Login { Form form = new Form(); String authorizeUrl = ""; public Form Login() { Display.init(this); HttpRequestHandler handler = new HttpRequestHandler(); HTMLComponent htmlC = new HTMLComponent(handler);

How to Communicating between a J2ME Midlet and PC?

强颜欢笑 提交于 2019-12-11 02:18:18
问题 How do I make a J2ME Midlet to communicate with a java program or some application on the pc through the cable connected? 回答1: Incredible_Honk is almost right. The key is to use the (standard) system property "microedition.commports". This provides a comma delimited list of the com ports which are available to your application. To open a connection use CommConnection as follows: CommConnection con = (CommConnection) Connector.open("com:<commport name>"); Usually this will provide access to a

connect J2ME application to https with self-signed certificate

自作多情 提交于 2019-12-11 02:07:24
问题 I know this question was asked before. but i really don't know how to do this. I created a j2me app and a webservice in a tomcat server, it works perfect on HTTP, Now i need to connect to HTTPS/TLS. To do that i followed this steps: using KeyTool i generate a .keystore file in the server–side. i run HTTPS correctly in tomcat (in web browser). i took the .keystore and i import it to my WTK keys stores. by using Mekeytool. When i try to connect to my https://server-ip/webservice, using this

Need help with Java design of Http Requester

試著忘記壹切 提交于 2019-12-11 02:05:43
问题 I am running into a design problem. I have the following (pertinent) classes: class LoginScreen { public login() { httpRequest = factory.createHttpRequest(url, method, this); httpRequest.start(); } public authorize() { httpRequest = factory.createHttpRequest(url, method, this); httpRequest.start(); } public requestSucceeded(){...} public requestFailed(){...} } class HttpRequest extends Thread { LoginScreen screen; ... public HttpRequest(url, method, screen) { this.url = url; this.method =

Compiling j2me using Ant

ぃ、小莉子 提交于 2019-12-11 02:05:37
问题 I have created a J2ME project after referring to this article J2MEUsingAntwithJ2ME. Now I am having problems in adding resources (such as images) and libraries (such as jar and zip files). I have copied the resources in the res folder as shown in this article but when I extract the .jar file, it does not have any resources. 回答1: From the sample: <jar basedir="${build}/preverifiedobf" jarfile="${build}/bin/${program_name}.jar" manifest="bin/MANIFEST.MF"> <fileset dir="${top}/${res}"> <include