You Are Here:

Community: Wiki

This page was last modified on 9 July 2009, at 10:44.

Building and Testing Applications with the WidSet SDK

From Forum Nokia Wiki

This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. The article is believed to be still valid for the original topic scope.

Contents

Introduction


This article uses Windows XP or Windows Vista (TM)

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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fWidSetsE5fE44evelopmentE5fTutorialsX qdcZpublisherQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fidE2fc764fd1cE2d8b06E2d499aE2d9a6aE2d17c3903d5a65E2fforumE5fnokiaE5fcrawlerE5fagentX qdcZtitleQSxWidSetsE20E44evelopmentE20TutorialsE20E2dE20ForumE20NokiaE20WikiX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qrssZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qfnZdistributionQUxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2fX qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZupdatedQDx2008E2d10E2d03X qmarsZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ