midp

Is there a method to change a MIDLet icon once it's downloaded?

假如想象 提交于 2019-12-11 03:18:46
问题 Given that there are many sizes and color depths for different phones (even for the same manufacturer), i would like to have one application for all of them and then, download a proper icon for the phone de app is downloaded into. Is there a way to change the MIDLet icon once the application is downloaded? 回答1: As far as I know there is no way of doing this. You can however force the user to upgrade an app and change the icon then. This can be done in a more user friendly manner without loss

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

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

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);

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

Reading Content from File in J2ME

瘦欲@ 提交于 2019-12-10 19:49:13
问题 I am trying to read the content of a file but it seems not to work. I surfed the net and found different implementations as shown(read(), read2(), readLine()) but each time a run the codes they all give a NullPointer exception. Please what can I do to rectify this problem. private String folder; static String filename; //IMPLEMENTATION 1 private void readFile(String f) { try { InputStreamReader reader = new InputStreamReader(getClass().getResourceAsStream(f)); String line = null; while ((line

Can A Midlet invoke another Midlet?

痴心易碎 提交于 2019-12-10 12:59:25
问题 I been looking around and at sources like this one they say that a Midlet can invoke another if they are in the same suite, or if they are in the same namespace and in the same jar file. I do not understand what a Midlet-Suite is? Also after searching through the web I did not find any documentation or code examples for One Midlet invoking another Midlet. 回答1: The other replies are pretty much taking care of your questions about MIDlet Suites but I would suggest reading the MIDP specification

how to kill a thread which is waiting for blocking function call in Java?

偶尔善良 提交于 2019-12-08 17:08:04
问题 I have a thread: Thread t = new Thread(){ public void run(){ ServerSocketConnection scn = (ServerSocketConnection) Connector.open("socket://:1234"); // Wait for a connection. SocketConnection sc = (SocketConnection) scn.acceptAndOpen(); //do other operation } }; t.start(); Lets say no client is connecting to the Server, so this thread will be blocked.Now I want to kill the above thread t? How can I kill it? 回答1: Thread.interrupt() will not interrupt a thread blocked on a socket. You can try

J2ME: platformRequest Issue

送分小仙女□ 提交于 2019-12-08 07:12:33
问题 I want to call a number in below format using platformRequest: platformRequest("tel:*123*33584744#"); But it gives me error Invalid number on the phone. But if i call this number manually by typing on phone then it works fine. Even below works fine: platformRequest("tel:33584744"); So i suspect problem lies when i put * or # chars in the number. As i said when i type these chars in the number manually and press the call button on the mobile it works fine but not with platformrequest. What is

J2ME: Convert transparent PNG image to grayscale

ε祈祈猫儿з 提交于 2019-12-08 06:17:20
问题 is there any possiblity in J2ME to convert an image (loaded from a png file with alpha) to a new transparent grayscale image? Until now I only got the rgb values, but not the alpha. Thanks. Edit: yes, it should be 32 bit grayscale. 回答1: I found the solution and here is the code: public Image getGrayScaleImage() { int[] rgbData = new int[getWidth() * getHeight()]; image.getRGB(rgbData, 0, getWidth(), 0, 0, getWidth(), getHeight()); for (int x = 0; x < getWidth() * getHeight(); x++) { rgbData[x