As I have promised you in my earlier post, today I am going to show you how to add an icon to your application and finally how to deploy it in to your mobile phone.
This is the icon I have chose to add to my mobile application. It is a PNG image and the dimensions of that are 16 * 16 pixels. First you have to create a directory in your main directory to store your icons. Main directory in the sense, the directory you created your mobile application. If you can’t remember where you have created it, right click on your project, select Properties, then select General and there you can see Project Folder field.
It is not enough that you create a directory within the Project Folder, you have to manually add it to the project. To do that you have to;
- right click on the project again
- select Properties
- select Libraries & Resources under Build topic
- click on the Add Folder button
- select the directory that you have created to store your icons and
- click Open then
- finally click OK.
Now you can see that folder in your NetBeans IDE under your relevant project. It is coming under Resources folder so you may have to expand it to see the sub folders.
Now let’s see how can we deploy our project to a mobile phone. I am going to do that using Bluetooth because my laptop as well as my mobile both have Bluetooth facility so it is the easiest way for me to do it. But remember if you do it for commercialize purpose you have to host the project in a server space and you only give the link of the .jad file to your clients.
I think it is better if I tell you little bit about the .jad file and .jar file here. JAD is stands for Java Application Descriptor. It is a small file and normally devices support 5KB size of files. So if your JAD file is larger than that be concern what are the devices that support for that file. Rather than telling what is in side of that file, better I will show the content of that JAD file of my application.
MIDlet-1: FormMidlet, /happy.png, anuja.ContactForm
The .jar file is the real application which runs on your mobile. JAR stands for Java ARchive. As you can see above we provide the link to JAR file with in JAD file. The reason emerge when we doing commercial products. We ask client to first download JAD file and check whether his mobile device is capable of installing our software. If it not fulfill the requirements provided by the JAD file the device itself say it can’t install the application. So the client can save some amount of money not downloading the real software which is not compatible with his mobile device. That’s enough for extra information.😉
Before you Deploy the application you have to Clean & Build the application for the last time. You can do both by right click on the project. If there is no errors then your application is good to install in to your mobile device. So I transfer it through Bluetooth and I don’t think I have to tell you how to do that for you. Enjoy the rest in your mobile phone🙂