Wednesday, 17 December 2008

JAR & JAD files

JAD file
This file doesn't contain the contents of your program(source code etc). It actually links to the JAR file. JAD file is used when downloading applications using Over-the-air(OTA) or when you are signing your application.

JAR file
This file contains all of the contents such as source codes or images. You can normally unzip the file and see all of the contents inside.

Installing applications to phone
You can normally just copy the jar file and paste it inside your hp. Either by bluetooth or cable. Or if there's a memory card, just paste into the memory card. However, if you wish to use the jad file too, you must ensure the jad file and the jar file is pasted together. Without the jar file, the application can't run with a ClassNotFoundException.

Friday, 12 December 2008

Using protected APIs in Motorola

I faced a great deal of problem of having to install my application in the Motorola phone.

First, without any certificate, I am not able to run the application as there is no permission to read user's data.

Second, after applying for a certificate, while running my application it says Certificate has expired. It was because I didn't set the correct date and time.

Third, my application says authentication failure. It took me a great deal of research of what went wrong. The mistake was, I turned one big round before reaching to the point. It was because of the VeriSign certificate which is not valid for Motorola. If I were to develope an application and wish to test it, I gotta apply for the bound certificate. I refered to the FAQ from the Motorola's Developers Website.

Here is the link to the steps taken to achieve it:
I am writing a MIDlet that uses protected API (e.g. JSR75 FileConnection). These protected API are not accessible to an unsigned/untrusted MIDlet so whenever I try to use a protected API class without the MIDlet being signed/trusted a SecurityException is generated. How do I obtain a developer certificate to allow me to developer a MIDlet which access protected API?