Error in MIDlet
i am trying to create a midlet that gets the BTSPP of the connected device, here's the code
import javax.microedition.io.*;
import javax.bluetooth.BluetoothStateException;
import javax.bluetooth.DataElement;
import javax.bluetooth.DeviceClass;
import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.DiscoveryListener;
import javax.bluetooth.LocalDevice;
import javax.bluetooth.RemoteDevice;
import javax.bluetooth.ServiceRecord;
import javax.bluetooth.UUID;
public final class BTMIDlet extends MIDlet
public void startApp()
// set the port number
BCC.setPortNumber("COM12");
// set the baud rate
BCC.setBaudRate(9600);
// set the connectable mode
BCC.setConnectable(true);
// set the discovery mode to Limited Inquiry Access Code
BCC.setDiscoverable(DiscoveryAgent.LIAC);
// retrieve the device that is at the other end of
// the Bluetooth Serial Port Profile connection,
// L2CAP connection, or OBEX over RFCOMM connection
RemoteDevice remote = RemoteDevice.getRemoteDevice(javax.microedition.io.Connection c);
// retrieve the Bluetooth address of the remote device
String remoteAddress = remote.getBluetoothAddress();
// retrieve the name of the remote Bluetooth device
String remoteName = local.getFriendlyName(true)
but i m getting the msg that io variable doesn't exist. now wat shud i do??
I modified the code anew the track where to code is going.
int a = MainDisplay.size()-1;
// this line will print the size of the form - 1
System.out.println(a);
display.setCurrent(procCategory);
for (int i=a; i>=0; i--){
// this line will print the current item being deleted.
System.out.println(i);
MainDisplay.delete(i);
}Here's the output of the console window.
15
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
I uploaded the said file again to my phone but I also got the same error. It says application error and so so the application needs to be closed. I've tried every method but it seems like it can't be debugged. could this be really a KVM problem? I don't see any error in the code I am making.
By the way, MainDisplay is of type form (User Interface). the delete(i) is a method for forms deleting the item indexed by i. All the items appended in a form is indexed from 0 to size()-1, where size() is also a method indicating the number of elements being appended to it.
Similar Messages
-
Error: no MIDlet Suites found when install
I have runned Java Application Manager(JAM) with entering the following command:
emulator -Xjam
then click the install soft button;enter thr URL:http://localhost:8080/demos.jad . raise an error:No MIDlet Suites found.I have placed demos.jar and demos.jad on the server.
why?
thanks.You have to indicate the location of a web page that contains an absolute link to the jad file:
The greatest Application Ever
not the name of the jad file.
Once the emulator gets to the page, you will be prompted to install "The Greatest Application Ever". -
Weird Bouncy castle problem... works on cmd prompt, error in midlet
Hi, i'm developing a RC4 code.... it works when i made the main method display the plaintext, ciphertext and decrypted text.
But, putting it to a MIDlet, i get the error message:
java.lang.NoClassDefFoundError: org/bouncycastle/crypto/CipherParameters
at TestRC4.<init>(+36)
at java.lang.Class.runCustomCode(+0)
at com.sun.midp.midlet.MIDletState.createMIDlet(+34)
at com.sun.midp.midlet.Scheduler.schedule(+52)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80) Why? how do i fix it?I call OpenProcess(), even with minimal parameters like PROCESS_QUERY_INFORMATION
Actually it's not minimal:
Generic read access to a higher integrity process (PROCESS_VM_READ access to the virtual memory of a process, and
PROCESS_QUERY_INFORMATION) is restricted to block the ability of lower-privilege processes from gaining read access to memory that may contain password data or other key material that is used for authentication.
https://msdn.microsoft.com/en-us/library/bb625962.aspx -
Error runing MIDlet's with Wireless Toolkit
Hi
I'm having problems executing MIDlet's. I'm using WTK2.1 and j2sdk1.4.2_04. When I try to run the examples in the wireless toolkit I get the following error:
Error running executable C:\WTK21\bin\zayit
java.net.BindException: Cannot assign requested address: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
at java.net.ServerSocket.bind(ServerSocket.java:318)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at java.net.ServerSocket.<init>(ServerSocket.java:97)
at com.sun.kvem.Lime.runClient(Unknown Source)
at com.sun.kvem.KVMBridge.runKVM(Unknown Source)
at com.sun.kvem.KVMBridge.runKVM(Unknown Source)
at com.sun.kvem.midp.MIDP$5.run(Unknown Source)
Has anybody encountered this problem or know how to solve it? Any answers will be greately apreciated
thanx
christianI had the same problem. I simply allowed my firewall software to allow the C:\WTK21\bin\zayit application full access. Previously even when I disabled the firewall it still wouldnt work, until i did the above.
Hope this helps -
Error installing MIDlet via bluetooth
Hi i have ben working on an app using the J2ME Wireless Toolkit and have regularly been sending my updated app to my phone via bluetooth from my PC. This has worked without any problems for months.
Then i started using eclipse to edit ad emulate my code but creating the final package using the J2ME Wireless Toolkit.
Now i cannot send the app to my phone as the Bluetooth File Transfer Wizard gives the error:
"Not enough storage is available to complete this operation."
I have 6Mb of free memory on my phone and jar is only 23kb.
I can create package with eclipse and send it to phone and it works fine even tho the jar eclipse creates is 62Kb!!
Any ideas why this has happened and if there is a solution??may be u should reinstalll applicatoion to transfer files in your pc. i mean bluetooth application for your pc.
it happned to me once and i did reinstal and now it works.. -
What if "MIDlet-Permissions" is set, but not applicable to the device?
In my JAD file I'm setting permissions like "MIDlet-Permissions: javax.microedition.location.Location".
Should there by an issue installing this application on a phone that does not have a GPS device or JSR179? I've noticed that using the "MIDlet-Permissions-Opt" parameter instead is giving me problems using GPS on devices that HAVE it (during runtime), however not setting it as "Opt" is giving me a "Authentication Failure" message on install!!
Thanks in advanceDear Auxone,
No issue 4 installin ths application on a phone tht does nt have a GPS support.
Bt at least u must have Bluetooth enabled device 4 receiving d GPS data 4m
external GPS receiver. When GPS receiver is connected to mobile device then only
u can get latitude and longitude in DMS format.
Permissions r used by devices to protect access to APIs / functions tht require
authorization b4 being invoked. If u set location permission 4 ur application
u must have d GPS supported device else it ll gives u "Authentication Failure"
error.
"MIDlet-Permissions-Opt" r optional permissions. No matter device is supported
or nt 4 those permissions. It will just skip d process if API support is nt available
on device n it will never give u d o/p 4 tht APIs / functions.
-d.p. -
Midlet cannot be found at this url-1
Hi All,
I'm doing some work on my server by hosting some mobile java games. But when I try to download them to my phone I always get error as "Midlet cannot be found at this URL-1" could anyone please give me some advice on how to fix it?
Thanks a lot and look forward to hearing from you
MicheleMaybe someone over at one of the ME forums [1] can help you out.
When you start a new thread there, please make sure to come back here and link to that from this one so that people don't continue answering here.
[1] http://forum.java.sun.com/category.jspa?categoryID=23
People on the forum help others voluntarily, it's not their job.
Help them help you.
Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
---------------------------------------------------------------- -
I had tried to use the file connection api to somethhing like file browser on the NOKIA N73 but it dosnt work and give me that error
there was an error during midlet startup:
class java.lang.NoClassDefFoundError : javax/microedtion/io/file/FileConnection
on the runtime as it give now syntacs errorHello,
Using the "code" format tags will make your post much more readable. That said, there are some other problems in the aforementioned code. For example -1 signifies the end of a stream and 0 could simply mean no bytes were read.
You should also check exists() and canWrite(). It is possible to be able to read a file and not be able write to it or create a file in the same directory. -
hello,
i use the emulator to download the HelloWorld.jar file from a website, but when i do that. the emulator can access that website and list the jar file and jad file. and the emulator asked me to choose one to install, but when i choosed Helloworld.jar then it display the error:
HelloMIDlet.jar connot be found at this URL. Contact the application provider for more information
I dont know why, can anyone tell me that. pretty thankshi,
thanks for your reply, i still got the same problem. i changed the URL in jad file. then create jar file. still doesnt work.
if i directly go http://homepage.cs.latrobe.edu.au/g2mao it will list the jad files and jar files. but cannt install.
but if i go http://homepage.cs.latrobe.edu.au/g2mao/Menu.jar
it will make error: No MIDlet suites found. Check the URL to make sure it is correct.
what i am guessing is the sever side. because when i use apache on my own computer then it can be downloaded. but i did change the mime.types. i added one more line(application/java-archive jar) into the mime.types file.
so it works. i guess i should change the sever mime.types file. but im not sure.
do you have any suggestion? thanks. and thanks again for your reply. -
How To install Java Application[J2SE] into Windows Mobile
Hi All,
I have developed an application for Mobile devices[ Windows Mobile] exclusively using Java[AWT].When I try to install , the application in mobile, i got the following error.
*"MIDlet cannot be installed because critical information is missing from the MIDlet file (.jar). - 13 Please contact the MIDlet provider for more information."*
I didnt use any midlet classes in my application. So my question is, what the above error denotes? and How to install
java[AWT] application into mobile?. What are all the requirements to install the application?.
Thanks in advance.Hi David, thank you very much, your information was very useful, finally i got the work done.
The problem was with the JVM which is im used in my Windows Mobile. And im installed CrE-ME in my mobile
to execute java application.
The following link has the details of how to install the JVM and execute the aplication (.jar ).
http://javatolearn.blogspot.com/search/label/Java%20in%20Windows%20CE%20with%20CrE-ME
Thanks and Regards
Baskaran -
Hi,
I tryed to run the i18nDemo.jar on my cell phone, but came up with the error message:
MIDlet initialization failed:
java.lang.NoClassDefFounError:
javax/microedition/globle/ResourceException
I think it is because of the resource manager, but I don't know how to fix it. Can anybody help?Hi,
I tryed to run the i18nDemo.jar on my cell phone, but came up with the error message:
MIDlet initialization failed:
java.lang.NoClassDefFounError:
javax/microedition/globle/ResourceException
I think it is because of the resource manager, but I don't know how to fix it. Can anybody help? -
Trouble Running Unit Tests on Device
I am having trouble running multiple unit test on my device. I am using JMUnit as part of NetBeans IDE 5.5.1. I can get the tests running in the emulator but when I try them on the phone they don't work. Under my project's properties->Application Descriptor->MIDlets->MIDlets in the Suite, the 'jmunit.framework.cldc11.TestSuite' comes up in red with the error 'Some MIDlet classes are invalid'. I am using CDLC 1.1 and MIDP 2.0. Any ideas?
wegunterjrASI,
I have a few follow up questions for you to gain a better understanding of your application:
1). What are you using to do the unit test (NI’s unit test framework or VI tester from JKI)?
2). What are you conducting the unit test on (RT Driver or something on the host machine)?
3). Are the unit test VIs under the target in the LabVIEW project?
4). Are you able to run a simple unit test?
Screenshots are always appreciated.
Regards,
-
HT1320 What if the display is nothing but white?
I have a new Nano. The display is nothng but bright white. I the product defective?
Dear Auxone,
No issue 4 installin ths application on a phone tht does nt have a GPS support.
Bt at least u must have Bluetooth enabled device 4 receiving d GPS data 4m
external GPS receiver. When GPS receiver is connected to mobile device then only
u can get latitude and longitude in DMS format.
Permissions r used by devices to protect access to APIs / functions tht require
authorization b4 being invoked. If u set location permission 4 ur application
u must have d GPS supported device else it ll gives u "Authentication Failure"
error.
"MIDlet-Permissions-Opt" r optional permissions. No matter device is supported
or nt 4 those permissions. It will just skip d process if API support is nt available
on device n it will never give u d o/p 4 tht APIs / functions.
-d.p. -
Is MIDP for plam fully support the Palm OS 4.0 ??
I am currently doing the research on develop the application using MIDP for Palm.
I decide to buy the m500 which running on Palm OS4.0. May I know whether the Palm OS 4.0 support and fully tested on MIDP application ?
In my design, the PDA will link to the web server by using the Ethernet cradle to exchange the information. This is the way that i think it is efficient to send the HTTP request. Is it possible using the serial cable to send the http request thru the desktop? pls suggest other method.
Thank in advance ...
SLIs the MIDP run slow on the Palm OS 3.5 emulator???
izzit faster when running on the device??? Yep, midelts on real device run faser.
How much faster? hard to say, it depends on application
and your PC.
I have noticed that my midlets run about 7-10 times
faster on PDA than in emulator running on PIII-1GHz-256MBRam
and i always get and pop-up error about
memory while running on the emulator for any midp
sample program.Yep. Same here. POSE shows errors, when midlet uses some
of gui classes (Gauge).However, on real device never had
those errors.
I have tried different ROM mages, but no luck.
So far, I just press <continue>... -
NewBie Question: Javac.exe Not recognized?
Hi I just want to try out my v first hello world program in MOTOROLA IDEN SDK For J2ME Tech (v 1.2)
I added a hello-world java file in the javafiles folder. Then when i try to build, an error occurred:
"start building...
compile D:\IAProject\TRIALCODEEXAMPLE\Example.java...
javac.exe is not recognized as an internal or external command,
operable program or batch file.
Building over"
Wat's the problem? Did i missed out any settings? THanks!!!!!THX, but I have new problem with this:
Unhandled Exception in constructor java.lang.ClassNotFoundException: HelloWorld
Error creating MIDlet HelloWorld
sorce from UserGuide Motorola iDEN SDK..
package com.mot.j2me.midlets.helloworld;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HelloWorld extends MIDlet {
private Form mainScreen;
private Display myDisplay;
HelloWorld() {
myDisplay = Display.getDisplay(this);
mainScreen = new Form("Hello World");
StringItem strItem = new StringItem("Hello", "This is a J2ME MIDlet."); mainScreen.append(strItem);
public void startApp() throws MIDletStateChangeException
{ myDisplay.setCurrent(mainScreen);
public void pauseApp() {
public void destroyApp(boolean unconditional) {
}Why this code doesn't work??
Maybe you are looking for
-
How to Get List Item in Custom Context Menu?
Hi, I got this code from the net. <CustomAction Id="SPTest.CustomMenuItem.ButtonClicked" RegistrationType="ContentType" RegistrationId="0x0101" Location="EditControlBlock" ImageUrl="/_layouts/IMAGES/DOCLINK.GIF" Sequence="600" Title="Click Me!" Descr
-
How does one rearrange photos in an album without dragging?
How does one rearrange photos in an album without dragging?
-
Creating tabs in Appraisals Overview Page(ESS/MSS) -Status Overview
Hi, We have two types of Appraisal documents in system. One is normal Appraisal document and another is Talent Competency Assessment document. We are thinking to keep these two appraisal documents apart and away from each other. By creating the two S
-
Dead Battery will not reboot when plugged in
Anyone else had this problem? Phone dies when battery reaches about 5% (not 1%). Plug in the charger but it takes 10 minutes before you can switch phone back on again? Maybe this is covered elsewhere but with all the dodgey battery posts about it is
-
Vista Drivers for Finger Print Reader on a Portege R200????
Please help I have a R200 model, which originally came with Windows XP, now have Windows Vista Business Edition Installed & having problems getting the Finger Print Reader to work. I have tried plenty of programs which Windows says have installed pro