Skip to main content

Midlets are java applications written for phones under the MDIP specification

Steps
1> Download and install the RIM Java Development Environment.from http://www.BlackBerry.net/developers/
This software requires the sun Java SDK, so

2> Download and install the Sun Java SDK.http://java.sun.com/j2se/1.4.2/download.html
MAKE SURE YOU GET THE SDK! *NOT* THE JRE (Java Runtime Environment). Once both are installed, download the midlets you wish to put on your BlackBerry. Midlets are BOTH a .jar and .JAD file.

3> For ease of use, move the JAD and JAR files for each midlet you want to convert to the BIN directory in the RIM Java Development Environment directory on your hard drive, for example: C:\program files\Research in Motion\BlackBerry JDE 3.7\bin\
4> Go to C:\windows right-click and do New -> Text File. Call this text file “Mid2Cod.bat” and say “yes” on the question if you are sure to change the extension.

5> Copy and paste the batch file text that I have attached below.

6> Make sure that the path after “SET JDEPATH=…..” (In the file to be converted to BAT file and kept under C:\windows) is correct for your installation of the JDE. If it’s not correct, please modify it to point to correct path.

7> Save and exit from the file
How to use this batch file:
1. Download your MidLet (.JAD and .JAR files) into some directory. Do Start->Run and type “cmd” (without the “”) followed by .
2. In the DOS window, change directory (using “cd”) to go to the directory where you stored your MidLet
3. Connect your BlackBerry to the USB port, and type “Mid2Cod filename” followed by . Note, that the “” should not be typed, and that the filename must NOT have a .JAR or .JAD extension. So, for the “techgyaan” Midlet (techgyaan.jad / techgyaan.jar), type “Mid2Cod techgyaan “.
4. Follow what’s happening on the screen. After a while, it asks you to press a key to continue (if all went well). If you do so, the .COD file will be uploaded to your BlackBerry. If you are not ready to upload at that time, press CNTL-C.

Below is the file to be converted to BAT file and kept under C:\windows.
@echo off
set JDEPATH=C:\Program Files\Research In Motion\BlackBerry JDE 4.1
cls
echo Midlet to COD translator
echo this utitily translates MIDP Midlets to COD Blackberry files
echo.
if “%1″== “” goto noargs
if not exist “%1.jad” goto nojad
if not exist “%1.jar” goto nojar
if not exist “%JDEPATH%\apps” md “%JDEPATH%\apps”
goto continue
:noargs
echo Usage: %0 inputfile
echo Note: don’t add an extension to the input file name, so no .jad or .jar endings!
goto last
:nojad
echo %1.jad doesn’t exist. Both %1.jad and %1.jar are needed for conversion to be successful.
echo Note: don’t add an extension to the input file name, so no .jad or .jar endings!
goto last
:nojar
echo %1.jar doesn’t exist. Both %1.jad and %1.jar are needed for conversion to be successful
echo Note: don’t add an extension to the input file name, so no .jad or .jar endings!
goto last
:continue
copy %1.jar “%JDEPATH%\apps”
copy %1.jad “%JDEPATH%\apps”
cd “%JDEPATH%\apps”
pause
..\bin\rapc import=”%JDEPATH%\lib\net_rim_api.jar” codename=%1 -midlet jad=%1.jad %1.jar
if not errorlevel 1 goto load
echo An error has occurred. Check your files and try again.
goto last
:load
echo.
echo If you see ‘No Errors’ noted above, most probably the cross-compiling was successful.
echo Now we are going to upload the app to the device. Please make sure your
echo Blackberry is connected to the USB port.
pause
“%JDEPATH%\bin\javaloader” -usb load %1.cod
echo.
:last
echo Thank you for using the Jar2Cod utility.

Caveats:
a) If you use the application loader at a future date, the loader WILL remove your midlets as they are not known by it. You will probably have to re-upload them again in this case.

b) Make sure you have enough free space to upload the applications..

c> Please do not blame ME if some thing goes wrong. J . I have tried this and very sure this will work.
d> If the device crashes, we can easily reload the OS to it. So please try. ( I tried this as well J )
e> Please be VERY careful while executing following commands.

Device fails to come up if the below commands are executed haphazardly.
wipe [-a-f]
Wipes the handheld
-a Wipe applications only
-f Wipe filesystem only
erase [-f] …
Erases modules on the handheld
-f Force erase of in-use module


Comments

Popular posts from this blog

Download of the Day!

Amarok 2.0.2 has released Amarok is an open source alternative music player for iTunes. Amarok supports Linux, Unix, MacOSX and windows Operating system. It is smiliar to iTunes just drag & drop the songs to play list. Amarok also lets you listen to internet radio ( mp3 streaming ) including music from last.fm . Features Automatic cover Lyrics download Dynamic playlists Visualizations and Podcasting. These are only some of the great new features of Amarok 2. Give it a try! Download here An least but not last - Amarok will also synchronize your music to your iPod. For the more technical users a scripting interface allows you to extend the functionality of Amarok. Print Page Feedbacks: We appreciate feedbacks and suggestions about our website info@techgyaan.org

How to fix Solaris "/lib/svc/method/net-physical "network settings is misconfigured”

Yesterday I came across an issue with the server being unable to access it switched to the  maintenance mode with some a strange message; “ How to fix Solaris "/lib/svc/method/net-physical "network settings is misconfigured”. Dec  9 10:05:59 techgyaansvr svc.startd[7]: [ID 652011 daemon.warning] svc:/network/physical:default: Method "/lib/svc/method/net-physical" failed with exit status 96. Dec  9 10:05:59 techgyaansvr svc.startd[7]: [ID 748625 daemon.error] network/physical:default misconfigured: transitioned to maintenance (see 'svcs -xv' for details) Actual message is that the IP address already exists, but is not configured. We need to clear the network & flush the settings to make it accessible Resolution: Check the service which is disabled #svcs –xv [this command will show you the services which is disabled by system] Take the network interface offline #ifconfig eri0 down [this command will bring the interface down] #ifconfig eri0 unplumb [this co...

Increase your RAM? free of cost…Really Worth It!!!!

A Very useful tip . Please try this and use RAM efficiently. Now this is called a tip of the year! While working with the Task Manager I observed the following. You can also try it out. 1.Start any application, say Word. Open some large documents. 2.Now start the Task Manager processor tab and sort the list in descending order on Memory Usage. You will notice that Winword.exe will be somewhere at the top, using multiple MBs of memory. Note down the number. 3.Now switch to Word and simply minimise it. (Do not use the Minimize All option of the task bar). 4. Now go back to the Task Manager and see where Winword.exe is listed. Most probably you will not find it at the top. You will typically have to Scroll to the bottom of the list to find Word. Now check out the amount of RAM it is using. Compare it with the original. Surprised? The memory utilisation has reduced by a huge amount. 5.So where is the tip of the year? Simple? Minimise each application that you are currently not working on ...