January 25, 2011

JavaLoader - Load/Remove applications from BlackBerry Device without using BlackBerry Desktop Manager

How to load/erase cod files from BlackBerry Device without using BlackBerry Desktop Manager ?

To Do this BlackBerry JDE/Eclipse Plugins provide the utility JavaLoader.
First you have to configure the path variable to include this utilities path, which is usually

C:\Program Files\Research In Motion\BlackBerry JDE 4.5.0\bin
or if you are using eclipse
C:\eclipse\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.28\bin

For installing to BlackBerry Device use the following command

javaloader -u load [your_application_name.cod]

For uninstalling/erasing your application from BlackBerry device

javaloader -u erase -f [your_application_name.cod]

Usage of JavaLoader utility is as follows

JavaLoader [-u] [-p[port]|[pin]] [-b[baud]] [-d0|-d1] [-w[password]] [-q]
[command]

-u Connect to USB handheld (default is serial)
-p[port] Specifies the serial port (serial handhelds only)
-p[pin] Specifies the handheld PIN (USB handhelds only; hex pin prefix '0x'
)
-b[baud] Specifies the baud rate (serial handhelds only)
-d0 Disables VM debug mode
-d1 Enables VM debug mode
-w[password] Connects using the specified password
-q Quiet mode

[command] is one of

dir [-d] [-s] [-1]
Lists modules on the handheld
-d Display dependency information
-s Display siblings
-1 Single column output

deviceinfo
Provides information on the handheld

load [.cod file] ...
Loads modules onto the handheld

load [.jad file]
Load modules described by JAD onto the handheld

load @[manifest] ...
Loads all modules named in [manifest] onto the handheld

save { [module] ... | -g [group] }
Retrieves modules from the handheld
-g Retrieves all modules in a specified group

info [-d] [-s] [-v] [.cod file] ...
Provides information on the specified modules
-d Display dependency information
-s Display sibling information
-v Display verbose module information

wipe [-a|-f]
Wipes the handheld
-a Wipe applications only
-f Wipe filesystem only

erase [-f] { [module] ... | -g [group] }
Erases modules on the handheld
-f Force erase of in-use modules
-g Erases all modules in a specified group

debugmode
Enables VM debug mode

eventlog
Retrives the handheld event log

cleareventlog
Clears the handheld event log

settime
Sets the time on the handheld to the current time

radio on|off
Turns the handheld's radio on or off

enum
Enumerates all USB handhelds

siblinginfo [.cod file] ...
Provides sibling information on the specified modules

screenshot [active|primary|auxiliary] [.bmp file]
Retreives the current contents of the specified screen
and saves it as a BMP file. If the screen is not
specified, the default is "active".

logstacktraces
Dumps the stack traces for all threads to the event log

resettofactory
Reset IT policy to factory settings

nvstore
Dumps NV store data to stdout

java_state [file]
Dumps Java state to a file

recoverflash [size in bytes]
Attempts to recover the specified amount of flash

otasl load [type] file
load an OTASL patch file
type is os, dspos, osext, installer, cod or patchlist

otasl purge [type]
purge OTASL patch files
type is os, dspos, osext, installer, cod or patchlist

otasl state [state]
set the OTASL state and reset
state is APPLY_PATCH, BACKUP_DATA, etc

UpdateJad - Integrating 3rd party applications

How to include a third party application into your application (dependency) ?

The first thing you have to do is to download the cod and jad file provided by the 3rd party application. Then after you are done with coding and packaging the application. You have to copy cod & jad files of your application and 3rd party application to the same folder.

Configure the path variable (environment variables) to include the tool updatejad.exe, this will be usually under c:\program files\Research In Motion\BlackBerry JDE \bin. if you are using BlackBerry JDE or if you are using eclipse C:\eclipse\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.28\bin.

Open command prompt, navigate to the folder where you have copied the application cod files and jad files, then execute the following command

updatejad -q -n [your_application_name.jad] [space] [3rd_party_application_name.jad]

The usage of updatejad tool is as follows.


Usage: updatejad.exe -q -n [input.jad] [[additional.jad] ...]
-q Quiet mode
-n No backup file
File to be updated
Other attributes to be added to input.jad

More than one additional.jad may be specified.

January 15, 2011

MDS - Change Port Number

How to change the listening port of MDS/How to change the MDS port ?

Navigate to

C:\Program Files\Research In Motion\BlackBerry JDE 4.5.0\MDS\config (if you are using BlackBerry JDE 4.5)

C:\eclipse\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.28\components\MDS\config (if you are using Eclipse)

Look for property file 'rimpublic.property', Open file

Look for the property WebServer.listen.port, change the value to the one which you want.