Widget Examples‎ > ‎

Dojo Calendar



Create a new project

Choose File >>New>>Project under eclipse menu.
Then from the New Project Dialog, Select Droidget Wizard>>Project
Fill necessary fields including project name..etc.. and Click Finish
Project with the given name will appear in the Eclipse project explorer.

Dojo is a Javascript library which is an implementation Google AJAX Libraries API(http://code.google.com/intl/ja/apis/ajaxlibs/).



config.xml
<?xml version="1.0" encoding="UTF-8"?>
<widget id="CalendarDoJo_1279599093544" version="1.0" width="300" height="300">
    <content src="index.html" type="text/html"/>
    <name>CalendarDoJo</name>
    <description>The sample of DoJo</description>
    <author url="http://www.gclue.com">GClue</author>
    <icon src="icon.png"/>
    <license></license>
    <access uri="http://googleapis.com/" subdomains="true"/>
</widget>

Edit index.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <title>Calendar DoJo</title>
    <link rel="stylesheet"
        type="text/css"
        href="http://ajax.googleapis.com/ajax/libs/dojo/1.4.3/dijit/themes/tundra/tundra.css"/>

    <script type="text/javascript"
        src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.3/dojo/dojo.xd.js"
        djConfig="parseOnLoad: true">
    </script>
    <script type="text/javascript">
        dojo.require("dijit.dijit"); // loads the optimized dijit layer
        dojo.require("dijit._Calendar");
    </script>
</head>

<body class="tundra">
    <div dojoType="dijit._Calendar"></div>
</body>
</html>

Deploy the Widget

Now save and deploy the project
  • From the eclipse menu select Droidget --> packaging
  • Then Droidget-->install packaging
Or 
  • upload the Widget to web server and update the download.html file as follows. Then access the download.html from the smart phone and install the widget from URI.
Download.html
<html>
<head>
    <title>Download</title>
</head>
<body>
    <a href="droidget://www.example.com/DoJoSample.wgt">DoJoSample</a><br>
</body>
</html>

Preview



Comments