Sometimes we use some codes/classes redundantly in many application without any changes in the code.
In such type of cases its better to create a jar file with those classes and use only the jar file on other projects.
For exmaple, if we have some classes with custom UI , then we can create a jar file with the classes rather adding all the classes in other projects repeatdely also in those case we have to change the packge name based on the directory.
First , How to Create the Jar file
-------------------------------
1. Create a new workspace (for example lib.jdw)
2. Create a new project(for example lib.jdp) under lib.jdw
3. Add the classes you want to create jar.
4. Note that no main is reqired.
5. From project properties make the project as library.
Right Click on the Project -> Properties.. -> Application Tab -> Select Project type as Library
6. Build the project
7. Now you should have a jar file named lib.jar in the project file directory.
8. Preverify the jar file
a. Go to your JDE installation folder (C:\Program Files\Research In Motion\BlackBerry JDE
4.6.0\bin)
b. Copy lib.jar file to bin folder.
c. Now open your command prompt and change your current directory to your JDE installation
directory.
d. Now execute the following command:
preverify -classpath "C:\Program Files\Research In Motion\BlackBerry JDE 4.6.0\lib
\net_rim_api.jar" "lib.jar"
e. In your bin directory(C:\Program Files\Research In Motion\BlackBerry JDE 4.6.0\bin) a folder
named output will create.
f. Preverified jar file resides here.
9. Now rename lib.jar as lib.zip and delete cod , csl , cso file from there
10. Rename it back to lib.jar (make sure cod,csl,cso has been deleted)
11. Now you have got the jar file that you can reuse.
Second, How to add this jar to other project
--------------------------------------------
1. For example, yow want to add this jar from another project (different workspace) app.jdp.
2. Import the jar file from the project app.jdp
Right Click on the Project -> Properties.. -> Build Tab -> Add lib.jar as Imported Jar files:
3. Now you will be able to import the classed of lib into the new project app.
Bikas
Tuesday, February 16, 2010
Saturday, January 9, 2010
How to Deploy any Application on Real Blackberry Devices
First of all the following files are required to install an application into real device.
a. appName.cod (appName1.cod, appName2.cod, ...)
b. appName.jad
c. appName.alx
d. .htaccess (required for OTA)
An application can be intalled in the real device in two ways.
a. OTA (Over The Air)
b. Connecting your device with the PC
b1. Using Javaloader
b2. Using Desktop Manager
OTA Installation Process
----------------------------
Check this link.
Connecting your device with the PC
-------------------------------------------------- -------
1. First Connect your device through USB.
2. Sign the cod file if required
3. Then you can install your application in the following ways:
a. Using javaloader:
i. Goto the JDE bin directory(ex: C:\Program Files\Research In Motion\BlackBerry JDE 4.6.0\bin\).
ii. copy your cod and jad file there.
iii. execute the following command from there (you can create a batch file (*.bat) and just click will do )
javaloader -usb load applicationName.jad
or
javaloader -usb load applicationName.cod
b. Using Desktop Manager:
i. Install destop manager
ii. place *.alx and *.cod file in the same directory
iii.select your *.alx file from desktop manager.
iv.Then it should start installing the application in the device.
Also check out these videos from Developer Video Library.
a. appName.cod (appName1.cod, appName2.cod, ...)
b. appName.jad
c. appName.alx
d. .htaccess (required for OTA)
An application can be intalled in the real device in two ways.
a. OTA (Over The Air)
b. Connecting your device with the PC
b1. Using Javaloader
b2. Using Desktop Manager
OTA Installation Process
----------------------------
Check this link.
Connecting your device with the PC
--------------------------------------------------
1. First Connect your device through USB.
2. Sign the cod file if required
3. Then you can install your application in the following ways:
a. Using javaloader:
i. Goto the JDE bin directory(ex: C:\Program Files\Research In Motion\BlackBerry JDE 4.6.0\bin\).
ii. copy your cod and jad file there.
iii. execute the following command from there (you can create a batch file (*.bat) and just click will do )
javaloader -usb load applicationName.jad
or
javaloader -usb load applicationName.cod
b. Using Desktop Manager:
i. Install destop manager
ii. place *.alx and *.cod file in the same directory
iii.select your *.alx file from desktop manager.
iv.Then it should start installing the application in the device.
Also check out these videos from Developer Video Library.
Sunday, August 30, 2009
Code Signing
Quote from Knowbedge Article about code Signing:
Some Other Reference link from KB Article.
And just in case if you lost the keys RIM resend you the keys to your mail address by disabling your previous keys. For that you have to send a mail to devsupport@rim.com requesting the keys and regarding your issue about key lost. The normally respond within 2-3 business days.
Legally you cannot use the keys more than one PC.
But Practically you can use the keys in any PC. For this:
"Research In Motion (RIM) must track the use of sensitive application programming interfaces (APIs) in the BlackBerry JDE for security and export control reasons. In the API reference documentation, sensitive classes or methods are indicated by a lock icon or are noted as signed. If you use these controlled classes or methods in your applications, your application must be signed with a key or a signature provided by RIM before you can load the application .cod files onto the BlackBerry smartphone."
For Buying Code signing keys Go Here. You have to spend 20 USD to buy the key.
Some Other Reference link from KB Article.
What Is - Code signing and obtaining signature keys Register Signing Keys How To - sign a .cod file
Also Have a look at this Article. Here signing steps explained clearly.
Once you have the key you can sign as many application as you want.
And just in case if you lost the keys RIM resend you the keys to your mail address by disabling your previous keys. For that you have to send a mail to devsupport@rim.com requesting the keys and regarding your issue about key lost. The normally respond within 2-3 business days.
Legally you cannot use the keys more than one PC.
But Practically you can use the keys in any PC. For this:
a. Preserve the following files: i. sigtool.db ii. sigtool.csk iii. sigtool.set b. Copy these files in the JDE bin directory. (ex: C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\bin)
Clickable BitmapField
For making BitmapField clickable
------------------------------------------------
|
Align Field in Center
For aligning ButtonField in a HorizontalFieldManager
---------------------------------------------------------------------------
|
For aligning LabelFIeld Center
---------------------------------------------------------------------------
|
Drawing a Circle
There is no direct api in the graphics class to draw circle.
So for creating circle have to use eclipse or arc.
Circle Property
---------------------
1. Center point of the circle (x, y)
2. Radius r
Now circle can be drawn in the following ways
------------------------------------------------------------------
Graphics.drawEclipse(x, y, x + r, y, x, y + r, 0, 360);
Graphics.fillArc(x, y, r, r, 0, 360);
Graphics.drawArc(x, y, r, r, 0, 360);
Clickable LabelField act like Link (Href Field )
The example of a LabelField which act like html link.
|
Subscribe to:
Posts (Atom)