This project is read-only.

Why do you need WpWidgetLibrary?                                                     

wgpic1

Do you want to implement apps for cross-browser support? Is so and if you are Windows Phone developer this is the right project for you.
This project gives you ability to startup with HTML5 at Windows Phone right now.

Windows Phone 7.1 has internet browser based on the Internet Explorer 9, and the version in WP7.1 is the almost the same build used for IE9 desktop edition.
This means the WP7+ is able to render HTML5 content. In comparison to Chrome it is supported less HTML5 elements, but some of important features like geo-location,
canvas etc. works well. Usually Widows Phone is executing the HTML5 application which is hosted on some web server, and it is not a big deal to open IE on phone
and to navigate to the URL of the HTML5 web application. For more information about HTML5 support at Windows Phone and other devices please take a look on
Damir's post "HTML5 for Windows Phone 7.1+ - Episode I"

As long you are browsing your HTML5 application in WebBrowserControl there is no need for you to use this library. However, one app should be in general installed on device.
Currently there is no way for WebBrowserControl to navigate to HTML file which is located somewhere in file system at the phone as this is supported by Android and iOS.
If you want to install your HTML5 application on device like Windows Mobile 6.5 did it with widgets this is the library which will help you to do this by calling of a single line of code.

This library helps you to deploy a HTML app to Windows Phone 7. The library contains set of helper methods which extract web content from application resource to isolated storage.
On that way it is possible to develop WP7 HTML5 app which can pass marketplace requirements as purchasing, updating, installing, works offline etc.

Widget class library solves this problem by deploying cross platform HTML5 Widget application on Windows Phone 7 so that web content can be installed on disk.
With WPWidget you can easily make Windows Phone 7 hybrid application containing of the native part written in Silverlight and web part written in HTML, JavaScript and CSS.

If you want to know how we have been inspired to setup this project please take a look on Damir's Episode II "Browsing HTML content".

How to use the WPWidgetLibrary?

In only few steps you can make fully functional hybrid Windows Phone 7 application. On the picture below it is shown how to use the library.

1. Reference Daenet.WidgetLibrary.dll in to you WP7 project.

2. Copy your HTML (App) to some project folder and mark all files in build action as EmbededResource.

3. From the Toolbox drag the WebBrowser Control and in PageLoaded event navigate to desired webpage. (See red rectangle in xaml file.)

4. In the MainPage constructor append following code. This code will on start of application copy all HTML related content to isolated storage.
   The string array (second argument of InstallHTMLContent) should contain all subfolders of your project which have to be copied to Isolated Storage
   too. If you have very simple App with all files in one folder, then this argument is not required.

pic5

5. Set initial page to webBrowser control from the MainPage Loaded event in code-behind.
   Following code is a common WebBrowserControl code, which starts browsing of the page.
   Please note that navigating page (StartPage.htm) is not the page hosted online. It is the page
   in Isolated Storage.

pic6 

Compile and run the application, and you are looking the full featured HTML Widget application.

pic3

More information will be published on demand in our blogs:

1. Damir Dobric Blog

2. Bahrudin Hrnjica Blog

Last edited Oct 18, 2011 at 11:53 AM by bhrnjica, version 22