In only 12 days WPWidgetLibrary reach more that 800 page views and over 50 downloads. This is good start of the library since building HTML5 apps in Windows Phone is coming. We have also got several feedbacks and questions about the library, and we can say the WPWidgetLibrary is indeed solution for developing hybrid mobile applications for Windows Phone 7.
One of the question about WPWIdgetLibrary is how to customise some features. For example default library no support avi file format. For that reason we have opened Discussion section of the library and put some answers. Here is one of them Damir has posted:
WpWidgetLibrary installs HTML app by calling:
InstalHTMLContent(string htmlFolder, string[] htmlDirs) ;
where htmlFolder is the folder in solution which contains all required web files. In other words this is the root of web-application which will be executed from isolated storage. Because you are free to use any kind of extension like “myfile.tiff” the framework can either copy any file in your project or specific files. We decided to copy specific files only.
Here is how we do it:
protected virtual bool IsWebExtension(string ext) { bool res = false; switch (ext.ToLower()) { case "htm": case "html": case "js": case "jpg": case "jpeg": case "png": case "css": res = true; break; } return res; }
If your HTML mobile app requires other file formats eg. “abc.avi”, just derive the WPWIdgetLibrary class and override this method like the following sample.
public class MyWPWidgetLibrary: WPWidgetLibrary{ protected override bool IsWebExtension(string ext){ bool res = false; switch (ext.ToLower()) { case "avi": return true; //break; } return base.IsWebExtension(ext); } }
Now WPWidgetLibrary supports custom avi files.
On similar way you can implement support of any file format you want.
In only 12 days WPWidgetLibrary reach more that 800 page views and over 50 downloads. This is good start of the library since building HTML5 apps in Windows Phone is coming. We have also got several feedbacks and questions about the library, and we can say the WPWidgetLibrary is indeed solution for developing hybrid mobile applications for Windows Phone 7.
One of the question about WPWIdgetLibrary is how to customise some features. For example default library no support avi file format. For that reason we have opened Discussion section of the library and put some answers. Here is one of them Damir has posted:
WpWidgetLibrary installs HTML app by calling:
InstalHTMLContent(string htmlFolder, string[] htmlDirs) ;
where htmlFolder is the folder in solution which contains all required web files. In other words this is the root of web-application which will be executed from isolated storage. Because you are free to use any kind of extension like “myfile.tiff” the framework can either copy any file in your project or specific files. We decided to copy specific files only.
Here is how we do it:
protected virtual bool IsWebExtension(string ext) { bool res = false; switch (ext.ToLower()) { case "htm": case "html": case "js": case "jpg": case "jpeg": case "png": case "css": res = true; break; } return res; }
If your HTML mobile app requires other file formats eg. “abc.avi”, just derive the WPWIdgetLibrary class and override this method like the following sample.
public class MyWPWidgetLibrary: WPWidgetLibrary{ protected override bool IsWebExtension(string ext){ bool res = false; switch (ext.ToLower()) { case "avi": return true; //break; } return base.IsWebExtension(ext); } }
Now WPWidgetLibrary supports custom avi files.
On similar way you can implement support of any file format you want.