28 May 2008

First step with Jarpa

Here are the steps to successfully compile Jarpa.
It's very basic and I assume you already know it but, for people like me who fought so many hours with the security domain issue, I could be interesting...
I currently use JarpaDebug and not newly Jarpa_105 since Felipe removed web support on this last release...and S40 3rd FP2 only support web ;)

First download Netbeans mobility or full edition.
Unzip the file where you want to install it

Like I don't like wher software make a lot of folders in My Document folder, I personnaly created an 'user' folder where I unzipped Netbeans and modified netbeans/etc/netbeans.conf to define my userdir :

To run, Netbeans needs JDK not the JRE, so you have to download and install it.

You can now run Netbeans.

If problem occurs like a message box talking about JDK Home (like I had the first time I tried, because another JRE version was installed), you'll have to modify netbeans/etc/netbeans.conf to define JDK home :

Now, you have to download a S40 or S60 Java SDK.
Note : you'll have to sign the Forum Nokia to download it, and after 15 days, you'll have to request a free serial number to continue.
I personnaly used S40 3rd edition FP 2 because it's Nokia 5200's one (a common S40 here in France).

Relaunch Netbeans to add this SDK to your Netbeans.
Select Tools> Java Platforms
Click the Add Plaform... button
We want to use a Java ME MIDP Plaform emulator
Netbeans automatically detects the SDK
Finish platform installation
You're now ready to develop for S40 3rd Edition FP2

I created a folder 'projects' when I'll add my future projet

Download JarpaDebug and unzip to your own projects folder

On Netbeans, File > Open project... and choose Jarpa folder
Don't be afraid by the Error dialog box, Jarpa was made for the Sun Java Wireless Toolkit, not a Nokia SDK so it complains it doesn't found the Wireless Toolkit platform. Let's change that !
Right click on Jarpa project you just opened, Properties.
On platform, select the Emulator Platform you want, like Series 40 SDK 3rd Edition Feature Pack 2
Ok, it's now done, you could launch Jarpa using F6 or the big green arrow or Run>Run main project

"Application is not from a trusted supplier. Continue anyway ?"
Welcome in the great world of Security Domain ;)
Since your JAR file isn't signed, you're allowed to do a lot of thing : if you continue ("yes"), you'll see some "Application access set to not allowed".
Like I said, it's security issue : Nokia doesn't want you to launch malicious software without to be sure what's you're doing.
To resolve this, follow my post according Security Domain.
For this S40 3rd Edition FP 2 emulator
- exit Jarpa
- go to "Menu"
- go to "Apps"
- highlight "JarpaDebug"
- use left soft key "Options"
- On the menu, select "Application access"
- then "Data access"
- then "Add and edit data"
- select "Ask every time"

You problably saw some options like "Ask first time only" and "Always allowed" are greyed : they are disabled because Jarpa isn't signed.
Note : since I don't tried to sign a JAR yet, I don't know if you can automatically define to "Always allowed" after that. Let me know if you try!

To avoid this, you could also (on emulator only), set the Trusted domain to "maximum" on emulator preferences.

Still on the emulator, relaunch "JarpaDebug", you're now able, with "Options" left soft key, to open it from the Web : you'll have to exit Jarpa to launch Web
From memory and from phone memory doesn't work on emulator and I didn't tried them on a real device yet.

These settings are saved so you won't have to redefine then every launch.

1 comment:

thomas said...

hi dude,

i am using jarpa as well and when i try to install the jar on a nokia 6300i s40 5th fp1 the swf file does not launch on top of it

i'm using the java_105 example and the nokia s40 5th edition fp1 sdk.

you configure where you want to copy your swf file from the res directory in the jar file, in the example that's a copy to file:///E:Others/jarpa_105.swf but the platformrequest fails apparently.

any thought where i should copy the swf file to? i tried file:///E:Cities/jarpa_105.swf but that does not seem to work either