I 开发者_开发问答just created a new widget by following a tutorial. I created a zip containing all files and renamed it to HelloWorld.wgt instead of HelloWorld.zip. I sent it to my samsung star/corby via data cable, but when I try to open the wgt file on my phone it says it can't open it, because it doesn't know the filetype. Is there a way to install widgets on a Samsung Star without using a webserver?
Thanks,
Rohit desai
Just create an HTML file like this:
<html>
<head>
<title>Hello</title>
</head>
<body>
<a href="YOUR_WIDGET_NAME_HERE.wgt">Install widget</a>
</body>
</html>
Put the HTML file in the same folder with your widget and open the file. Click on Install widget and you are done.
P.S.: If you don't want to modify the HTML file for every widget you want to install use this code:
<html>
<head>
<title>Hello</title>
<script>
function download()
{
var widgetName = document.getElementById("widgetName");
location.href = widgetName.value + ".wgt";
}
</script>
</head>
<body>
<input type="text" name="widgetName" id="widgetName" />
<input type="button" value="Install widget" onclick = "download()" />
</body>
</html>
精彩评论