|
batch for creating alx file -
12-09-2005, 11:39 AM
I wrote a batch file that will allow you to create the cod and alx files from a java midlet. Remember to save your .jad and .jar files to the same directory.
Here is the text of the batch file, just copy and paste the text into notepad and save as yourfilename.bat then run the batch file and bingo you have your .cod, .jad, .jar, and .alx files all in the same folder. This will allow you to load the program to your blackberry using the blackberry desktop manager instead of using loader.exe then when you run the application loader it will recognize the program and you shouldn't have to re-install it.
@echo off
cls
:: get jde location
set jde=
set /p jde=what is the complete path to your Blackberry JDE directory?
echo.
:: get jad and jar locations
set sve=
set /p sve=enter the complete path where your jad and jar files are located:
echo.
:: get the name of the jad and jar files
set jar=
set /p jar=what is the name of your jar file?
echo.
:: copy jad and jar files to the jde directory
xcopy "%sve%\%jar%.jad" "%jde%\bin\"
xcopy "%sve%\%jar%.jar" "%jde%\bin\"
::create the cod files
cd /d "%jde%/bin"
pause
rapc import="%jde%\lib\net_rim_api.jar" codename=%jar% -midlet jad=%jar%.jad %jar%.jar
pause
:: move the cod file to the jad and jar directory
move "%jde%\bin\%jar%.*" "%sve%\"
pause
:: change to the new directory
cd /d %sve%
:: create the new alx file
echo ^<loader version="1.0"^> >%jar%.alx
echo ^<application id="%jar%"^> >>%jar%.alx
echo ^<name^>%jar%^</name^> >>%jar%.alx
echo ^<description^>%jar%^</description^> >>%jar%.alx
echo ^<version^> ^</version^> >>%jar%.alx
echo ^<vendor^> ^</vendor^> >>%jar%.alx
echo ^<copyright^> ^</copyright^> >>%jar%.alx
echo ^<fileset Java="1.0"^> >>%jar%.alx
echo ^<files^>%jar%.cod^</files^> >>%jar%.alx
echo ^</fileset^> >>%jar%.alx
echo ^</application^> >>%jar%.alx
echo ^</loader^> >>%jar%.alx
pause
:end
NOTE: with this batch file you DO NOT need to copy your .jad and .jar files to the same directory as your Blackberry JDE files.
I hopt this helps anyone who is not comfortable with using dos commands or who would just like to use desktop manager to install midlets.
|