×
Namespaces

Variants
Actions

Archived:Building and Testing Applications with the WidSet SDK

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Article
Created: jimgilmour1 (23 Aug 2008)
Last edited: hamishwillee (15 Jun 2012)

Contents

Introduction


This article uses Windows XP or Using Nokia SDKs and Tools on Windows Vista

Successful build

The development process with the SDK is based on command shell using Java. There are several commands which need describing. To make this simple the [Hello world] example is used. The files are created from the article in directory
The code has been installed on drive D:\devkit

  • 'Check'ing the code

D:\devkit>devkit 'check' D:\devkit\examples\hello_world Resulting output is

14.07.2008 01:33:53.966 NORMAL Widget info
14.07.2008 01:33:53.966 NORMAL 1 parameters
14.07.2008 01:33:53.966 NORMAL 2 resources
14.07.2008 01:33:53.966 NORMAL Layout, 2 views
14.07.2008 01:33:53.966 NORMAL Loading took: 78ms
14.07.2008 01:33:54.29 NORMAL Required client version: 0.0.0
14.07.2008 01:33:53.966 NORMAL widget.xml:20 (resource) resource file hello_world.he exists
14.07.2008 01:33:54.29 NORMAL widget.xml:20 (resource) Code compilation complete.
14.07.2008 01:33:54.76 NORMAL widget.xml:21 (resource) Stylesheet compiled

Check OK


The following command is used to check individual files

  • 'Compile' FILE [LANG] Checks given script


Example

D:\devkit>devkit compile D:\devkit\examples\hello_world\hello_world.he
Required client version: 0.0.0
Compile OK



  • 'Runw' Command will compile and build *.he and replace widget scripts on dashboard



Example

D:\devkit>devkit runw D:\devkit\examples\hello_world


When running you will see the widget being built and uploaded

INFO java.version=1.6.0_06
INFO java.vendor=Sun Microsystems Inc.
INFO Device=/devices/cool.properties
INFO RMS provider=vajax.microedition.rms.file.FileRMS, maxSize=1000000
INFO RMS root=C:\Users\Jim\.widsets\default\WidSets
WARN Missing config: idle.rows
INFO Classloader=sun.misc.Launcher$AppClassLoader@11b86e7
INFO MIDlet=mango.client.Client
==> Compiling hello_world.he...
==> Compile OK
==> Uploading C:\Users\Jim\AppData\Local\Temp\widsets_39068.zip, (1kB)...
NORMAL Widget info
NORMAL 1 parameters
NORMAL 2 resources
NORMAL Layout, 2 views
NORMAL Loading took: 1ms
NORMAL Required client version: 0.0.0
NORMAL widget.xml:20 (resource) resource file hello_world.he exists
NORMAL widget.xml:20 (resource) Code compilation complete.
NORMAL widget.xml:21 (resource) Stylesheet compiled
==> Created widget 287523885
==> Created instance 287523890
==> UPLOAD OK

 Further down the log is found reference to hello_world
18:54:10.179: 287523890,287523885,,hello_world,1216144439159,65sp
18:54:30.748: Local code for hello_world.hx

Finally with the transfer complete the SDK goes offline
19:02:29.974: Going OFFLINE
19:02:29.991: Reader stopped
19:02:30.015: OFFLINE
19:02:30.020: ** handleMessage connection 0
19:02:30.020: Writer stopped


User command line errors


  • 'The directory you have given to be checked does not exist'


   D:\devkit>devkit check 'D:\devkit\examples\example_hello_world'
   
   Exception in thread "main" java.lang.'NullPointerException'
           at vajax.tools.Main.checkCommand(Main.java:93)
           at vajax.tools.Main.run(Main.java:521)
           at vajax.tools.Main.main(Main.java:589)


  • 'compile' error the user has given a directory and should have given 'filename.he'
D:\devkit>devkit compile D:\devkit\examples\hello_world
File D:\devkit\examples\hello_world is not a file


The 'run' command has been replaced by the 'compile'
without adding the filename with *.he extension

Syntax Error detection

The operator 'new' was has a spelling error the error was detected the line number was printed with the source text of the error.
The compiler has expected a semicolon line terminator

. The compilation 'stops after the first error' any futher errors will 'NOT' be detected.

D:\devkit>devkit compile D:\devkit\examples\hello_world\hello_world.he

(38:19) Syntax error, was expecting ;.
38.       return newt Label(style, "Hello World");

The error has now been corrected and the second error is now seen The typing error in a function gives a better error description message

(46:5) Could not find match for 'setMinimizedXView(View)'.
46.     setMinimized'X'View(createView("viewMini", getStyle("bg")));

The casting programming error of 'int = long' is not detected, but will cause runtime problems which will need wasteful debugging effort.

Error Messages

  • 'Invalid version'

The version of widget spec version is higher then the SDK can work with.
The widget.xml contains the wrong version in this version '2.1'

<?xml version="1.0" encoding="utf-8"?>

<widget spec_version="2.1">
 
 <info>


The corrected version is edited using a text editor to working version '2.0'

<?xml version="1.0" encoding="utf-8"?>

<widget spec_version="2.0">
 
 <info>



  • 'Pressing to "Go Offline" button when already OFFLINE status in emulator'


 17:51:24.284: CONNECTING
17:51:24.284: ** handleMessage connection 1
17:51:24.316: Open: Begin
17:51:24.316: Opening: socket://mobile3.widsets.com:8081
17:51:24.331: Open: java.net.UnknownHostException: mobile3.widsets.com
17:51:24.331: HTTP starting: http://mobile3.widsets.com/comm/
17:51:24.534: HTTP error1: java.net.UnknownHostException: mobile3.widsets.com
17:51:24.534: HTTP stopped
17:51:24.534: OFFLINE
17:51:24.534: ** handleMessage connection 0
17:52:19.758: Going OFFLINE
java.lang.NullPointerException
 
vajax.microedition.lcdui.DeviceDisplay.mousePressed(DeviceDisplay.java:236)


Disclaimer

While reading, please do keep in mind that both this Wiki page and the WidSets developer kit are still undergoing development, and that things are likely to change in the near future, as every WidSets release brings something new

This page was last modified on 15 June 2012, at 10:00.
57 page views in the last 30 days.
×