Code Example


 


Before you start lets take a brief look at what is already available in your project. Under 'src' directory
you can find 2 important files.
'index.html' and 'config.xml'.

config.xml as its name implies contains configurations about your widget. Here is a sample.



 Tag  Meaning
 id    
A unique identity but you may changit, unless you don’t have the same id  for another widget installed
 size     The size of your widget modify width and height
 src Path to starting page
 name Text displayed once you deploy your widget
 icon To have a distict identity to your widget you may add an icon (supported types are svg, ico, png, jpg, and gif) and you may change its width and height.
 license Declaimer
 features (Optional) Other than the basic tags you may also have features specified (Lets talk about them later).

Usually there is atleast one index.html file in a general widget project, whose media type is one of text/html (.htm, .html),
application/xhtml+xml (.xhtml, .xht), and image/svg+xml (.svg).

Now you know the basics, so modify 'index.html', 'config.xml'
, and/or use JavaScript libraries to extend your project.
Once you are finished save your work deploy your project.

  • Choose Droidget >> Packaging (You should not get any errors or problems, but you should see '.wgt' under bin directory)
  • Droidget >> Install Packaging
Please take a look at all the examples for better understanding.