Closing the app in samsung smart tv - samsung-smart-tv

I am a beginner to the samsung smart tv app development. I want to close my app on click of exit button. I used the code like this
case tvKey.KEY_EXIT:
var widgetAPI = new Common.API.Widget();
widgetAPI.sendExitEvent();
break;
It is not closing my app. Can anyone help me to fix this issue

Please Check whether u have following links in the header of your page
<!-- Common widget API -->
<script language="javascript" type="text/javascript" src="$MANAGER_WIDGET/Common/API/Widget.js"></script>
<script language="javascript" type="text/javascript" src="$MANAGER_WIDGET/Common/API/TVKeyValue.js"></script>
<script language="javascript" type="text/javascript" src="$MANAGER_WIDGET/Common/API/Plugin.js"></script>
One more thing, if you want to simply exit on the press of exit button then you dont have to code any thing as by default pressing exit button will exit the app on the tv, but you can override this functionality by blocking the default exit functionality

Related

Phone gap Toggle view is behaving weird after update android webview client

I have list of collapsible view i am using view.toggle(500) code to collapse and expend with animation of 500 millisecond. It was working fine until i update my android web view client. Now its looking bad when i expend and collapse. I am using phonegap cordoava to create android application.
Edit
I have used the following js files
<script type="text/javascript" src="js/jquery-2.1.3.js"></script>
<script type="text/javascript" src="js/jquery.jcarousellite.js">
following is the code
$("#Expand"+id).toggle(500);

Large qwerty keypad in smart tv sdk

I've noticed, that there is large qwerty keypad in some apps(Facebook, Browser), that differs from popup. How do I use it in SDK.
P.S. I have multi-scene app, with ime module included in app.json
I found out from Samsung support, that you can use IMEShell_Common object.
First you include these:
<script type='text/javascript' src='$MANAGER_WIDGET/Common/IME_XT9/ime.js'></script>
<script type='text/javascript' src='$MANAGER_WIDGET/Common/IME_XT9/inputCommon/ime_input.js'></script>
in body tag
After you can use shell like this:
var imeBox = new IMEShell_Common();
document.getElementById('search').focus();
imeBox.onShow();
In Samsung this can be achieved by IME. A very well described step by step procedure is mentioned in the below link. It also has a sample app that demonstrate the full functionality:
http://www.samsungdforum.com/Guide/tut00049/index.html
Here is the small demostration:
Load the plugin js:
<script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/API/Plugin.js"></script>
Now load the IME js:
<script type="text/javascript" src="$MANAGER_WIDGET/Common/IME_XT9/ime.js"></script>
Create instance of the plugin:
var pluginAPI = new Common.API.Plugin();
Now register you IME key and initialize it for a text field.
pluginAPI.registIMEKey();
imeMail = new IMEShell("messageText", Main.imeInitId, this);
imeMail.setKeySetFunc('qwerty');
Now just focus on the input field:
jQuery("#messageText").focus();
For more details, please check the above mentioned URL.
Happy Coding!

mobile back button not working in phonegap project?

When i click on a link this will redirect me to another page in my app.
But after that when i am clicking on the mobile's back button it is not redirect me to previous page.
Ca anyone have answer of this question.
Actually device's back button click is also an event in PhoneGap. You can define the beckbutton event as a function.
<html>
<head>
<title>Sample</title>
<script type="text/javascript" charset="utf-8" src="phonegap-1.0.0.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
document.addEventListener("backbutton", backButtonClick, false);
}
function backButtonClick() {
//Do something here on backbutton click or go back to last page.
window.history.back()
}
</script>
</head>
<body>
</body>
</html>
Its a sample, now tweak your page as you wanted.
Always write the backbutton event on deviceready!

PhoneGap not working on iOS 5 device

Hi i tried creating sample index.html with simple notification code from Docs Phonegap Notification .
I zipped the index file and uploaded it to build.phonegap.com with 2.9 version. The App is successfully installed on my iPad(iOS 5) but nothing happen when i click on Show Alert. I also tried adding phonegap 2.9.0 on my Sencha Touch 2 Application ,i build it as native and installed it on my device but the app hangs on app Loading Indicator.
Index.html code:
<!DOCTYPE html>
<html>
<head>
<title>Notification Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// device APIs are available
//
function onDeviceReady() {
// Empty
}
// alert dialog dismissed
function alertDismissed() {
// do something
}
// Show a custom alertDismissed
//
function showAlert() {
navigator.notification.alert(
'You are the winner!', // message
alertDismissed, // callback
'Game Over', // title
'Done' // buttonName
);
}
</script>
</head>
<body>
<p>Show Alert</p>
</body>
</html>
Any help is greatly appreciated.
Update:
Got things working when i add config.xml on the zip file. And added phonegap.js script inside the body tag before uploading it to build.phonegap.
Thanks
Got things working when i add config.xml on the zip file. And added phonegap.js script inside the body tag.
Thanks

sharethis is stopping page to load in IE 8

I have a sharethis link on my site having the below mentioned code ...
<script type="text/javascript">
addthis_url = location.href;
addthis_title = document.title;
</script>
<script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12"></script>
But this is not working as the page stops loading after the addthis_widget.php like . I even changed the code to newer version i.e.
<!-- AddThis Button BEGIN --> <a class="addthis_button"></a> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=ogmios"></script> <!-- AddThis Button END -->
But this code is too stopping the page load in IE8.
Any help will be appreciated.
Thanks
Jawed
Jawed,
Looks like you are using AddThis not ShareThis..
Why don't you try using ShareThis instead http://sharethis.com/publishers/get-sharing-tools
-Manu