Guys,
Any idea why i can not see me messages in on Outlook Web access. I am able to log into the network with pocket IE using my RSA SecurID, pin and user name. I'm then able to log into Outlook Web Access page with my userID and password. next I only see our corp logo that allows me to disconnect (back to were I need to inter RSA, Pin and username) and that is it. On the PC I see 3 panes, the directories, messages headers and the body of currently selected message.
I installed the Java from the O2 .181 Rom but that didn't help. below is the souce for the center pane off of my PC displaying the message headers. Please let me know if you see anything that could point to what is missing in the PocketIE.
Thanks,
**************************
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8"><script src="/dana-cached/js/ie.js"></script><script src="/dana-cached/js/sessiontimeout.js"></script><script>var dsnodocwrites = 0 ; var DanaCookie="sessionid=2f354b31-5fb3-4e03-954b-de5691b28c7e,0x409"; var DSHost="ems.cadence.com"; var DSObfuscateHostname=0;</script><script>var DSToolBarOn = 1;</script>
<HTML xmlns:MSIE DIR=LTR>
<XML:namespace prefix="WM">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<LINK rel="stylesheet" type="text/css" href="/exchweb/6.5.6944.0/controls/owastyle.css,DanaInfo=exowa01sj+">
<LINK rel="stylesheet" type="text/css" href="https://ems.cadence.com/exchweb/themes/0/owacolors.css,DanaInfo=exowa01sj+">
<LINK id="cssFont" rel="stylesheet" type="text/css" href="/exchweb/6.5.6944.0/controls/style30.css,DanaInfo=exowa01sj+">
<SCRIPT language="javascript">
var g_sDrafts = "Drafts";
var g_sCalendar = "Calendar";
var g_sContacts = "Contacts";
var g_sTasks = "Tasks";
var g_sBase = "http://exowa01sj/exchange/paulmc" + "/";
var g_szFolder = "Inbox";
var g_szVirtualRoot = "http://exowa01sj/exchweb";
var g_szAcceptLang = "en-us";
var g_sDelItems = "Deleted%20Items";
var g_sJunkItems = "Junk%20E-mail";
var g_fIsPublic = false;
var g_sUserDisp = "Paul xxx";
var g_tzOffsetJan = Number("420");
var g_tzOffsetJul = Number("360");
var g_szSessionId = "2f354b31-5fb3-4e03-954b-de5691bxxxx";
var g_fIsDelegate = "0";
var g_fIsUnix = "0";
var g_fAddToContacts = true;
var g_iDefaultAddrSearch = 0;
var g_fRulesEnabled = true;
var g_fJnkFltrEnbld = false;
var g_nPPMarkRead = 1;
var g_iPPMarkReadDelay = 5;
var g_iSendRR = 0;
var g_iPreview = 1;var g_iViewWidth = 510;var g_iViewHeight = 250;
var g_fIsMimeEnabled=1;
var g_fIsIE6Tpl = true;
var g_sMimeVersion = "6,5,6942,0000";
var g_thid = 0;
</script>
<script>DanaFlushWrite()
</SCRIPT>
<SCRIPT src="https://ems.cadence.com/exchange/paul/,DanaInfo=exowa01sj,CT=js+?cmd=script&template=loc_note&cache=1&ver=6.5.6944.0"></SCRIPT>
<SCRIPT src="https://ems.cadence.com/exchange/paul/,DanaInfo=exowa01sj,CT=js+?cmd=script&template=loc_view_contextmenu&cache=1&ver=6.5.6944.0"></SCRIPT>
<SCRIPT src="https://ems.cadence.com/exchange/paul/,DanaInfo=exowa01sj,CT=js+?cmd=script&template=loc_keystrokes&cache=1&ver=6.5.6944.0"></SCRIPT>
<SCRIPT id="scr_utlOWA" src="/exchweb/6.5.6944.0/controls/util_owa.js,DanaInfo=exowa01sj,CT=js+"></SCRIPT>
<SCRIPT src="/exchweb/6.5.6944.0/controls/util_view.js,DanaInfo=exowa01sj,CT=js+"></SCRIPT>
<SCRIPT src="/exchweb/6.5.6944.0/controls/vw_message.js,DanaInfo=exowa01sj,CT=js+"></SCRIPT>
<SCRIPT id="util_Buttons" src="/exchweb/6.5.6944.0/controls/util_buttons.js,DanaInfo=exowa01sj,CT=js+"></SCRIPT>
<SCRIPT FOR="cbButton" EVENT="onmousedown()" LANGUAGE="JavaScript" >
return onCbMouseDown(this);
</script>
<script>DanaFlushWrite()
</SCRIPT>
<SCRIPT FOR="cbButton" EVENT="onclick()" LANGUAGE="JavaScript" >
return onCbClickEvent(this);
</script>
<script>DanaFlushWrite()
</SCRIPT>
<SCRIPT FOR="cbButton" EVENT="oncontextmenu()" LANGUAGE="JavaScript" >
return(event.ctrlKey);
</SCRIPT>
<STYLE>
@media all
{
MSIE\:clientCaps {behavior:url(#default#clientcaps)}
}
</STYLE>
<MSIE:clientCaps ID="oClientCaps" />
<STYLE>.tbDivider{border-right:1px solid;}</STYLE>
</HEAD>
<BODY id="mainbody" class="mainBody">
<XML id="xmlDefaultView">
<view xmlns="http://schemas.microsoft.com/schemas/view" ><imagepath>/exchweb/img/</imagepath><transform>tf_Messages.xsl</transform><viewstyle cellpadding="0" cellspacing="0">table-layout:fixed;width:100%;</viewstyle><viewname>Messages</viewname><byteabbreviation>B</byteabbreviation><kilobyteabbreviation>KB</kilobyteabbreviation><megabyteabbreviation>MB</megabyteabbreviation><tasks>false</tasks><none>None</none><width>percent</width><column><heading>Importance</heading><type>i4</type><prop>http://schemas.microsoft.com/exchange/x-priority-long</prop><sortable>1</sortable><bitmap>1</bitmap><multivalued>0</multivalued><visible>1</visible><headerstyle nowrap="true">width:13px;cursor:hand;text-align: center;</headerstyle><style nowrap="true">text-align:center;padding-left:3px;padding-left:3px;</style></column><column><heading>Item Type</heading><type>string</type><prop>http://schemas.microsoft.com/exchange/outlookmessageclass</prop><sortable>1</sortable><bitmap>1</bitmap><multivalued>0</multivalued><visible>1</visible><headerstyle nowrap="true">width:20px;cursor:hand;text-align: center;</headerstyle><style nowrap="true">text-align:center;padding-left:3px;padding-left:3px;</style></column><column><heading>FlagStatus</heading><type>i4</type><prop>http://schemas.microsoft.com/mapi/proptag/x10900003</prop><sortable>1</sortable><bitmap>1</bitmap><multivalued>0</multivalued><visible>1</visible><headerstyle nowrap="true">width:20px;cursor:hand;text-align: center;</headerstyle><style nowrap="true">text-align:center;padding-left:3px;padding-left:3px;</style></column><column><heading>Attachment</heading><type>boolean</type><prop>urn:schemas:httpmail:hasattachment</prop><sortable>1</sortable><bitmap>1</bitmap><multivalued>0</multivalued><visible>1</visible><headerstyle nowrap="true">width:15px;cursor:hand;text-align: center;</headerstyle><style nowrap="true">text-align:center;padding-left:3px;padding-left:3px;</style></column><column><heading>From</heading><type>string</type><prop>http://schemas.microsoft.com/mapi/sent_representing_name</prop><sortable>1</sortable><bitmap>0</bitmap><multivalued>0</multivalued><visible>1</visible><headerstyle nowrap="true">width:23%;cursor:hand;text-align: ;padding-right:3px;padding-left:3px;</headerstyle><style nowrap="true">cursor:default;text-align: ;padding-left:3px;</style></column><column><heading>Subject</heading><type>string</type><prop>http://schemas.microsoft.com/mapi/subject</prop><sortable>1</sortable><bitmap>0</bitmap><multivalued>0</multivalued><visible>1</visible><headerstyle nowrap="true">width:40%;cursor:hand;text-align: ;padding-right:3px;padding-left:3px;</headerstyle><style nowrap="true">cursor:default;text-align: ;padding-left:3px;</style></column><column><heading>Received</heading><type>date</type><prop>urn:schemas:httpmail:datereceived</prop><sortable>1</sortable><bitmap>0</bitmap><multivalued>0</multivalued><visible>1</visible><headerstyle nowrap="true">width:26%;cursor:hand;text-align: ;padding-right:3px;padding-left:3px;</headerstyle><style nowrap="true">cursor:default;text-align: ;padding-left:3px;</style><dateformat>ddd M/d/yyyy</dateformat><timeformat>h:mm tt</timeformat></column><column><heading>Size</heading><type>i4</type><prop>http://schemas.microsoft.com/mapi/proptag/x0e080003</prop><sortable>1</sortable><bitmap>0</bitmap><multivalued>0</multivalued><visible>1</visible><headerstyle nowrap="true">width:11%;cursor:hand;text-align: right;padding-right:3px;padding-left:3px;padding-right:3px</headerstyle><style nowrap="true">cursor:default;text-align: right;padding-left:3px;padding-right:3px</style></column><filter>"http://schemas.microsoft.com/mapi/proptag/0x67aa000b" = false AND "DAV:isfolder" = false</filter><orderby><order><prop>http://schemas.microsoft.com/mapi/sent_representing_name</prop><sort>ASC</sort><type>string</type></order></orderby><headerstyle>background-color:buttonface</headerstyle></view>
</XML>
<TABLE class="vwTbl" cellpadding="0" cellspacing="0">
<TR>
<TD>
<TABLE id="tblTitleBar" class="fldrTitleBar vwFldrRw" cellpadding="0" cellspacing="0"> <TR> <TD nowrap style="width:1%;height:100%;">/exchweb/img/icon-folder.gif,DanaInfo=exowa01sj+<SPAN class="vwFldrTtl">Inbox</SPAN></TD> <TD nowrap class="vwName" style="width:50%;">(<SPAN class="vwName" style="padding-right:5px;" id="viewName" curView="Messages">Messages</SPAN>
)</TD> <TD><DIV id="idFontSize" style="visiblity:hidden"></DIV></TD> <TD style="height:100%" align="right"> <TABLE id="tblPageControls" style="height:100%;visibility:hidden;" cellpadding="0" cellspacing="0"> <COLGROUP SPAN="3" nowrap style="color:#FFFFFF;vertical-align:middle;text-align:center"></COLGROUP> <TR> <TD nowrap>Items</TD> <TD><INPUT title="Go To Item" style="text-align:center;vertical-align:middle;WIDTH:3em;margin-left:2px;margin-right:2px;margin-top:1px;margin-bottom:3px" id=idPageControl_ItemStartRange onkeydown="changePage()"></TD> <TD nowrap id="tdItemsRange" rangeText="to %1 of %2"></TD> </TR> </TABLE> </TD> <TD id="idPageControl_Images" align="center" nowrap style="vertical-align:middle;width:120px;height:100%;visibility:hidden;">
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
</TD> </TR> </TABLE>
<TABLE id="statusbar" width="100%" style="border:1 solid infotext;;display:none" cellpadding="1" cellspacing="0" class="rnStatusBar"><TR width="100%" style="height:1.1em;display:none"><TD width="1%" nowrap VALIGN="TOP" ALIGN="CENTER">/exchweb/img/status-info.gif,DanaInfo=exowa01sj+</TD><TD id="customStatusCell" width="99%"></TD></TR><TR width="100%" style="display:none;height:1.1em"><TD width="1%%" nowrap VALIGN="TOP" ALIGN="CENTER">/exchweb/img/status-info.gif,DanaInfo=exowa01sj+</TD><TD id="idSMimeVersion" width="99%">The S/MIME control installed on this computer is out-of-date. Install the newest version of the control from the Options page.</TD></TR></TABLE>
<TABLE class="cbToolbar" id="idToolbar" cellpadding='0' cellspacing='0'>
<TR>
<TD class="tbDivider" nowrap>
<A class="tbButton" name="cbButton" id="newMessage" overelements="newmenu" href="#"
Title="New">
New
</A>
<A class="tbButton" name="cbButton" id="newmenu" sticky=true overelements="newMessage" href="#" submenu='openMessageMenu'>
</A>
</TD>
<TD nowrap>
</TD>
<TD class="tbDivider" nowrap>
</TD>
<TD nowrap>
</TD>
<TD nowrap>
</TD>
<TD class="tbDivider" nowrap>
</TD>
<TD class="tbDivider" nowrap>
</TD>
<TD nowrap>
</TD>
<TD nowrap>
</TD>
<TD class="tbDivider" style="display:none" nowrap>
</TD>
<TD class="tbDivider" style="display:none">
</TD>
<TD class="tbDivider" nowrap>
</TD>
<TD class="tbHelp">
<A id="help" class="tbButton" onclick="return onCbClickEvent(this)" href="#" title="Help"><NOBR>
Help</NOBR>
<SPAN id="idHelpLinkText" style='display:none;'>
http://exowa01sj/exchweb/help/USA/ie5/default.htm?noteview.htm
</SPAN>
</A>
</TD>
<TD width="100%"></TD>
<TD nowrap>
Log Off</TD>
</TR>
</TABLE>
<TABLE id='openMessageMenu' cellpadding=0 cellspacing=0 style='display:none;' tabIndex='0' class='cbSubmenu'>
<TR>
<TD nowrap>
<SPAN>Message</SPAN></TD>
</TR>
<TR><TD nowrap>
<SPAN>Appointment</SPAN></TD></TR>
<TR><TD nowrap>
<SPAN>Contact</SPAN></TD></TR>
<TR><TD nowrap>
<SPAN>Distribution List</SPAN></TD></TR>
<TR><TD nowrap>
<SPAN>Task</SPAN></TD></TR>
<TR><TD nowrap>
<SPAN>Post in This Folder</SPAN></TD></TR>
<TR>
<TD nowrap>
<SPAN>Folder</SPAN></TD>
</TR>
</TABLE>
<TABLE id='selectViewMenu' cellpadding=0 cellspacing=0 style='display:none;' tabIndex='0' class='cbSubmenu'><TR><TD nowrap>Messages</TD></TR><TR><TD nowrap>Unread Messages</TD></TR><TR><TD nowrap>Two-Line View</TD></TR><TR><TD nowrap>By Sender</TD></TR><TR><TD nowrap>By Subject</TD></TR><TR><TD nowrap>By Conversation Topic</TD></TR><TR><TD nowrap>Unread By Conversation Topic</TD></TR><TR><TD nowrap>Sent To</TD></TR></TABLE>
<TABLE id='togglePreviewPane' cellpadding=0 cellspacing=0 style='display:none;' tabIndex='0' class='cbSubmenu'> <TR><TD nowrap>
<SPAN>Right</SPAN></TD></TR> <TR><TD nowrap>
<SPAN>Bottom</SPAN></TD></TR> <TR><TD nowrap>
<SPAN>Off</SPAN></TD></TR> </TABLE>
</TD>
</TR>
<TR>
<TD style="height:100%">
<TABLE id="tblView" class="vwTbl" cellpadding="0" cellspacing="0" onselectstart="return false;">
<TR id=trPreVwRight height="100%">
<TD id=tdViewer valign="top" colspan=3 width="100%">
<DIV id="idMsgViewer"
class = "msgViewer"
acceptLang = "en-us"
rowsPerPage = "25"
url = "http://exowa01sj/exchange/paul/Inbox/"
onReady = "onViewReady()"
onRefresh = "onViewRefresh()"
onBeforeRefresh = "onBeforeViewRefresh()"
onkeydown = "onViewKeyDown()"
onkeypress = "onViewKeyPress()"
oncontextmenu = "return(false);"
refreshThreshold = "20%"
viewDescriptor = "xmlDefaultView"
onChangeSort = "persistSortOrder()"
onError = "onViewError()"
onNavigate = "onViewNavigation()"
onSelectionChange = "updatePreviewPane()"
allowQuickFlag = "1"
followUpText = "Follow up"
loadingText = "Loading"
nextSelDir = 1
>
<DIV id=idLoading><CENTER>Loading...</CENTER></DIV>
</DIV>
<DIV id="idVwMenu" class="divCtxtMenu" onaction="cmAction();"></DIV>
<DIV id="selRowDiv" class="dummy selRow"/>
<DIV id="shdwRowDiv" class="dummy shdwRow"/>
<DIV id="ctxmnuBarDiv" class="dummy ctxmnuBar"/>
<DIV id="ctxmnuMnuDiv" class="dummy ctxmnuMnu"/>
</TD>
<TD id=tdResizeRight width=4 style="display:none">
</TD>
<TD id=tdPreVw style="display:none" class="vwPrvwTD" vAlign="top">
<DIV id="idNoItemsDIV" style="display:none"><CENTER>No items are currently selected.</CENTER></DIV>
<IFRAME name="previewPane" frameborder=0 class="msgPreview" src="/exchweb/6.5.6944.0/controls/blank.htm,DanaInfo=exowa01sj+" style="height:100%;" ></IFRAME>
</TD>
</TR>
<TR id=trResizeBottom height=4 style="display:none;">
<TD colspan=3>
</TD>
<TR>
<TR id=trPreVwBottom class="vwPrvwTD"></TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
</noscript><script>dstb()</script><script>if(chk() == 1) { tAboutToExpireID=parent.setTimeout("dsSessionAboutToExpire(1099636939,1099636939,2700,28800,600,-69)", 2100000);tExpiredID=parent.setTimeout("dsSessionExpired(1099636939,1099636939,2700,28800,600,-69)", 2700000);}</script>
************************
Paul,
1st, OWA is a MS Exchange component, so I don't think installing Java would help
OWA is just plain HTML and some JavaScript.
There is a problem in the configuration somewhere.
If you lookup the JavaScript code, you'll find at least two variable that didn't translated the internal OWA Server name for the public name:
var g_sBase = "http://exowa01sj/exchange/paulmc" + "/";
should read
var g_sBase = "https://ems.cadence.com/exchange/paulmc" + "/";
and
var g_szVirtualRoot = "http://exowa01sj/exchweb";
should read
var g_szVirtualRoot = "https://ems.cadence.com/exchweb";
Since you're using SSL maybe the SSL session is not terminated at the OWA Server but before (reverse proxy) and OWA has not been configured for SSL Offloading.
tde,
Thanks for taking a look. The source above is from my Windows 2K machine when I log on to the site, not the pocketPC. So this code works fine on the PC but not the PocketPC.
OWA used to work about 9 months ago before the did an update. The look of OWA is different now and does not display on my PocketPC after the update.
I attached the PC code to see if anyone could identify java or something else that worked on a win2K machine but was known to not work on a pocketIE.
The attaced screen shot is what I see on the win2k machine which doesn't work on the pocketIE.
Thanks,
Paul
again
sorry, didn't see the image all the way to the right and thought the attachment was forgotten.
Outlook Web Access on Exchange 2003
We use Exchange 2003 and Outlook Web Access does work correctly on my PDA2K. You might want to check if Outlook Mobile Access works. It's a much faster option which is better-suited to viewing on a PocketPC and is normally accessible at https://servername/oma
Good luck!
Malcolm
Paul
They probably upgraded from Exchange 2000 OWA to Exchange 2003 OWA.
In this case, try to use
https://ems.cadence.com/oma (Outlook Mobile Access) from your Pocket PC.
Solution to the problem
Dear Paul,
You weren't accessing Exchange server 2003 directly from your Pocket PC PDA, you logged into a SSL-VPN IVE device first in order to access the Cadence Intranet to get your email, then you had to log into the Exchange Server 2003 and the problem was related with the SSL- VPN device only which did not have the correct code to handle the new Exchange Server display and more. The SSL-VPN is running the latest version of OS now which works better with Exchange Server 2003 and fixes other bugs in general. I hope I did not confuse you, but in this case nothing was done at the Exchange Server level, we just improve the functionality with Exchange Server 2003 using the IVE( Instant Virtual Extranet) SSL-VPN device for our Cadence Users.
Best Regards,
Raquel
Exchange Web access, version 5.5 SP4
We have the above version of Exchange server back-end; apparently an upgrade to 2003 isn't planned yet. I see something similar to the attached screenshot (taken from a PC) but I can't click on the Emails. Is it because IE can't handle popups, or Javascript, or is there a way I can see the messages?
(Universal/MDA Pro)
Thanks
Nick
Related
hi guys, would anyone be willing to make a simple program that would calculate f-stop difference between two exposures. basically same what happens at this website.
http://imaginatorium.org/stuff/stops.htm
i think the formula is in the source of the website.
thanks in advance, i am willing to pay for this.
thanks
edit: nevermind, i actually found a service that converts websites to apps
actually i tried the website but its sucks. it just shows me the website with their ad.
can someone please convert this code to a simple app so i can use offline.
thank you so much
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang=en>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>How many stops?</title>
<meta name="GENERATOR" content="Brian's Brain, ver. 49">
<meta name="description" content="Javascript utility calculates the difference in stops between two exposure settings">
<meta name="keywords" content="photography, exposure, stops, stop, calculator">
<script type="text/javascript"><!--
function badno(x) { // returns true unless a positive number
return (isNaN(x/x) || x < 0);
}
function update(form) {
var shrat, aprat, exprat; // ratios (shutter speed, aperture, exposure)
var shunset = 0; // mock Bools
var apunset = 0;
// check if shutter speeds set
if (form.sh1.value.length + form.sh2.value.length == 0)
{ shrat=1;
shunset=1;
} else {
// fiddle to read shutter speed as fraction
var fract1 = form.sh1.value.split("/", 2);
var fract2 = form.sh2.value.split("/", 2);
var num1 = fract1[0]; // numerator of first shutter speed
var den1 = (fract1.length == 1) ? 1 : fract1[1];
var num2 = fract2[0]; // numerator of second shutter speed
var den2 = (fract2.length == 1) ? 1 : fract2[1];
if(fract1.length==1 && fract2.length==1 && num1*num2>1)
alert("You are calculating with large exposure times: " + num1 + " and " + num2 +
" seconds.\nDid you mean to enter 1/" + num1 + " and 1/" + num2 + "?");
shrat = (num1/den1) / (num2/den2);
if (badno(num1) || badno(num2) || badno(den1) || badno(den2))
{ alert("Missing or invalid shutter speed setting.\nMust be a positive value in seconds - usually a fraction such as 1/250.");
return 0;
}
} // end shrat calculation
// check if aperture set
if (form.ap1.value.length + form.ap2.value.length == 0)
{ aprat=1;
apunset=1;
} else {
if (badno(form.ap1.value) || badno(form.ap2.value))
{ alert("Missing or invalid aperture setting.\nMust be an f-number - enter '8' for f/8.");
return 0;
}
aprat = form.ap2.value / form.ap1.value; // *exposure* ratio (reciprocals!)
} // end aprat calculation
exprat = shrat * aprat * aprat;
if (apunset && shunset)
{ form.reset();
return 0;
}
// ---- Calculate stops
var left, right;
if (exprat > 0.999 && exprat < 1.001) exprat=1; //fudge rounding
if (exprat > 1) // top more
{ left = Math.round(exprat * 1000) / 1000;
right = 1;
form.exp1.value = "More";
form.exp2.value = "Less";
} else if (exprat < 1) // bottom more
{ left = 1;
exprat = 1/exprat; // invert for rounding
right = Math.round(exprat * 1000) / 1000;
form.exp1.value = "Less";
form.exp2.value = "More";
} else { // same!
left=1; right=1;
form.exp1.value = "Same!";
form.exp2.value = "Same!";
}
form.ratio.value = left + ":" + right;
if (left == right)
{ form.stops.value = "";
return 0; // if same, no more to do!
}
var stops = Math.log(exprat)/Math.log(2);
if (form.precision[0].checked) // whole stops
{ stops = Math.round(stops);
form.stops.value = (stops == 0) ?
"<1/2 stop" :
stops + ((stops==1) ? " stop" : " stops");
} else if (form.precision[1].checked) // round to thirds
{ thirds = Math.round(stops * 3);
if (thirds == 0)
form.stops.value = "a smidgen";
else
{ stops = Math.floor(thirds/3);
var fraction = "";
if (thirds-stops*3) fraction = (stops>0 ? "-":"") + (thirds-stops*3) + "/3";
form.stops.value = (stops?stops:"") + fraction + ((stops<2) ? " stop" : " stops");
}
} else // round to 4 decimals
{ stops = Math.round(stops * 10000)/10000;
form.stops.value = stops.toString() + ((stops==1) ? " stop" : " stops");
}
} // end function
//--></script>
<style type="text/CSS"><!--
h2 {font-family: helvetica, arial, sans-serif; text-align: center; color: #2020a0}
h3 {font-family: helvetica, arial, sans-serif; text-align: center; color: #2020a0}
h4 {font-family: times, serif; font-style: italic; color: #2020a0}
DIV.main {margin-left: 3%; margin-right: 3%}
DIV.footer {margin-left: 3%; margin-right: 3%}
DIV.fright {float: right; text-align: right; width: 50%}
DIV.narrate { color: #606060;}
DIV.illust {text-align: center; font-size:smaller; font-family: helvetica, arial, sans-serif;}
td.marked { background-color: #d0a0d0; }
--></style>
</head>
<body background="../graphics/grey2.jpg" bgcolor="#e0e0e0">
<!-- extreme tracker -->
<script type="text/javascript"><!--
an=navigator.appName;sr='http://x3.extreme-dm.com/';srw="na";srb="na";d=document;r=41;function pr {
d.write("<img src=\""+sr+"n\/?tag=chandler&p=http%3A%2F%2Fimaginatorium.org%2Fstuff%2Fstops.htm&j=y&srw="+srw+"&srb="+srb+"&l="+escape(d.referrer)+"&rs="+r+"\" height=1 width=1 alt=\"\">");}//-->
</script><script type="text/javascript" language="javascript1.2"><!--
s=screen;srw=s.width;an!="Netscape"?srb=s.colorDepth:srb=s.pixelDepth//-->
</script><script type="text/javascript"><!--
pr()//-->
</script><noscript><img src="http://x3.extreme-dm.com/z/?tag=chandler&p=http%3A%2F%2Fimaginatorium.org%2Fstuff%2Fstops.htm&j=n" height=1 width=1 alt=""></noscript>
<!-- end extreme tracker -->
<div class=main>
<h3>How many stops?</h3>
<form method=get action="http://imaginatorium.org/c">
<table border=1 cellspacing=0 cellpadding=10 align=center><tr><td><!-- border -->
<noscript><p align=center style="color: #ff0000">Warning: the calculator won't work, because Javascript is not enabled.</p>
</noscript>
<table border=0 cellspacing=0 cellpadding=5 align=center><tr>
<td></td>
<td>Shutter speed</td>
<td>Aperture</td>
<td></td>
<td>Exposure</td>
</tr><tr>
<td><i>First setting:</i></td>
<td class=marked><input type=text name=sh1 size=8 tabindex=1></td>
<td class=marked>f / <input type=text name=ap1 size=4 tabindex=2></td>
<td rowspan=2><input type="button" onClick="update(this.form)" value="Calculate" tabindex=5>
<!--img src="chev.png" width=20 height=45 alt="->"-->
</td>
<td><input type=text name=exp1 size=6 readonly tabindex=0></td>
<td rowspan=2>By <input type=text name=stops size=14 readonly tabindex=0></td>
</tr><tr>
<td><i>Second setting:</i></td>
<td class=marked><input type=text name=sh2 size=8 tabindex=3></td>
<td class=marked>f / <input type=text name=ap2 size=4 tabindex=4></td>
<td><input type=text name=exp2 size=6 readonly tabindex=0></td>
</tr><tr>
<td><i>Example:</i></td>
<td>1/125</td>
<td>(f/) 5.6</td>
</tr><tr>
<td><input type=reset></td>
<td colspan=4>Exposure ratio upper:lower <input type=text name=ratio size=20 readonly></td>
<td><input type=radio name=precision value="whole">Whole stops<br>
<input type=radio checked name=precision value="thirds">One-third stops<br>
<input type=radio name=precision value="precise">Precise stops
</td>
</tr></table></td></tr></table><!-- border --></form>
<!-- <h4>What is this "geometric progress
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
In previous two articles I covered development environment setup and anatomy of SmartWatch. This article will contain deep dive into coding with simple Hello Word example.
http://forum.xda-developers.com/smartwatch/sony/tut-introduction-smart-watch-t2807896
http://forum.xda-developers.com/smartwatch/sony/tut-smartwatch-app-development-part-2-t2807954
This demo will cover Notification API only. We will develop a single Android project named "Hello SmartWatch" which acts as a Host application and Extension application both. It means I will use single codebase for both things. Hello SmartWatch project has an Activity to send and clear notification to SmartWatch.
I assume that you have already imported SmartExtensionAPI and SmartExtensionUtils libraries in workspace.
Let's jump to the code.
List of Classes and purpose
MainActivity.java: It is use to generate and clear notification.
HelloExtensionReceiver.java: It receives input event generated by SmartWatch and forward control to the Extension Service.
HelloExtensionService.java: core logic of Host application needs to be written in ExtensionService. It is also responsible to register a host application to SmartWatch.
HelloRegistrationInformation.java: It provides essential information to register host application and API requirement.
This demo application contains only above four classes but actual application may have more classes. In above classes MainActivity acts as a Smart Extension application and rest of classes acts as a Host application.
Step 1: Create new Android project in eclipse named "HelloSmartWatch".
Step 2: Let's create UI first. Open activity_main.xml and put two EditText box for Title and Message respectively and two buttons for Send and Clear notification respectively.
Code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Send Notification"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="@+id/etTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Title" >
</EditText>
<EditText
android:id="@+id/etMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Message" >
</EditText>
<Button
android:id="@+id/btnSend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="buttonClicked"
android:text="Send Notification" />
<Button
android:id="@+id/btnClearn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="buttonClicked"
android:text="Clear Notification" />
</LinearLayout>
Step 3: Let's make button alive by writing action in MainActivity.java. I am using onClick property of buttons, so I don't require to find object of button and setOnClickListener. I can write code in "buttonClicked" method which is defined. When a user click on "Send Notification" button I am simply firing ExtensionService with INTENT_ACTION_ADD action and other required data and same for "Clear Notification" but with INTENT_ACTION_CLEAR action.
Code:
package com.kpbird.hellosmartwatch;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void buttonClicked(View v){
if(v.getId() == R.id.btnSend){
Intent serviceIntent = new Intent(this, HelloExtensionService.class);
serviceIntent.setAction(HelloExtensionService.INTENT_ACTION_ADD);
EditText etName = (EditText) findViewById(R.id.etTitle);
EditText etMsg = (EditText) findViewById(R.id.etMessage);
serviceIntent.putExtra("name", etName.getText().toString());
serviceIntent.putExtra("message", etMsg.getText().toString());
startService(serviceIntent);
}
else if(v.getId() == R.id.btnClearn){
Intent serviceIntent = new Intent(this, HelloExtensionService.class);
serviceIntent.setAction(HelloExtensionService.INTENT_ACTION_CLEAR);
startService(serviceIntent);
}
}
}
Step 4: Create HelloExtensionReceiver.java, It extends BroadcastReceiver. It works as bridge between SmartWatch and Host application, It will receive event generated in SmartWatch and forward it to HelloExtensionService.java
Code:
package com.kpbird.hellosmartwatch;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class HelloExtensionReceiver extends BroadcastReceiver{
private String TAG = this.getClass().getSimpleName();
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "HelloExtensionReceiver onReceiver: " + intent.getAction());
intent.setClass(context, HelloExtensionService.class);
context.startService(intent);
}
}
Step 5: Create HelloRegistrationInformation.java and extends with RegistrationInformation class. As the name suggests, It will use to register host application in Smart Connect. It has six methods that we need to override, among these four methods are used to declare required APIs and two methods used for extension registration and source registration. You can have multiple sources in a host application.
Code:
package com.kpbird.hellosmartwatch;
import java.util.ArrayList;
import java.util.List;
import android.content.ContentValues;
import android.content.Context;
import com.sonyericsson.extras.liveware.aef.notification.Notification;
import com.sonyericsson.extras.liveware.aef.registration.Registration;
import com.sonyericsson.extras.liveware.extension.util.ExtensionUtils;
import com.sonyericsson.extras.liveware.extension.util.registration.RegistrationInformation;
public class HelloRegistrationInformation extends RegistrationInformation{
private Context mContext;
public HelloRegistrationInformation(Context ctx){
if (ctx == null) {
throw new IllegalArgumentException("context == null");
}
mContext = ctx;
}
@Override
public int getRequiredNotificationApiVersion() {
return 1;
}
@Override
public int getRequiredWidgetApiVersion() {
return 0;
}
@Override
public int getRequiredControlApiVersion() {
return 0;
}
@Override
public int getRequiredSensorApiVersion() {
return 0;
}
@Override
public ContentValues getExtensionRegistrationConfiguration() {
String extensionIcon = ExtensionUtils.getUriString(mContext,R.drawable.ic_launcher);
String iconHostapp = ExtensionUtils.getUriString(mContext,R.drawable.ic_launcher);
String extensionIcon48 = ExtensionUtils.getUriString(mContext,R.drawable.ic_launcher_48);
String configurationText = "Hello SmartWatch";
String extensionName = "Hello SmartWatch";
ContentValues values = new ContentValues();
values.put(Registration.ExtensionColumns.CONFIGURATION_ACTIVITY,MainActivity.class.getName());
values.put(Registration.ExtensionColumns.CONFIGURATION_TEXT, configurationText);
values.put(Registration.ExtensionColumns.EXTENSION_ICON_URI, extensionIcon);
values.put(Registration.ExtensionColumns.EXTENSION_48PX_ICON_URI, extensionIcon48);
values.put(Registration.ExtensionColumns.EXTENSION_KEY,HelloExtensionService.EXTENSION_KEY);
values.put(Registration.ExtensionColumns.HOST_APP_ICON_URI, iconHostapp);
values.put(Registration.ExtensionColumns.NAME, extensionName);
values.put(Registration.ExtensionColumns.NOTIFICATION_API_VERSION,getRequiredNotificationApiVersion());
values.put(Registration.ExtensionColumns.PACKAGE_NAME, mContext.getPackageName());
return values;
}
@Override
public ContentValues[] getSourceRegistrationConfigurations() {
ContentValues sourceValues = null;
String iconSource1 = ExtensionUtils.getUriString(mContext,R.drawable.ic_launcher_30);
String iconSource2 = ExtensionUtils.getUriString(mContext,R.drawable.ic_launcher_18);
String iconBw = ExtensionUtils.getUriString(mContext,R.drawable.ic_launcher_18_bw);
String textToSpeech = "Notification from Hello SmartWatch Application";
sourceValues = new ContentValues();
sourceValues.put(Notification.SourceColumns.ENABLED, true);
sourceValues.put(Notification.SourceColumns.ICON_URI_1, iconSource1);
sourceValues.put(Notification.SourceColumns.ICON_URI_2, iconSource2);
sourceValues.put(Notification.SourceColumns.ICON_URI_BLACK_WHITE, iconBw);
sourceValues.put(Notification.SourceColumns.UPDATE_TIME, System.currentTimeMillis());
sourceValues.put(Notification.SourceColumns.NAME, mContext.getString(R.string.app_name));
sourceValues.put(Notification.SourceColumns.EXTENSION_SPECIFIC_ID, HelloExtensionService.EXTENSION_SPECIFIC_ID);
sourceValues.put(Notification.SourceColumns.PACKAGE_NAME, mContext.getPackageName());
sourceValues.put(Notification.SourceColumns.TEXT_TO_SPEECH, textToSpeech);
sourceValues.put(Notification.SourceColumns.ACTION_1,"Hello");
sourceValues.put(Notification.SourceColumns.ACTION_ICON_1,ExtensionUtils.getUriString(mContext, R.drawable.ic_launcher));
List<ContentValues> bulkValues = new ArrayList<ContentValues>();
bulkValues.add(sourceValues);
return bulkValues.toArray(new ContentValues[bulkValues.size()]);
}
}
Step 6: Create HelloExtensionService.java and extends with ExtensionService. It will contain main logic of SmartWatch host application. We need to implement two abstract methods named "getRegistrationInformation()", which sends object of HelloRegistrationInformation class and "keepRunningWhenConnected()",return true if you want to keep ExtensionService running as long as SmartWatch is connected with Smart Phone. For notification example we need to create two methods named "addData" and "clearData". It will generate and clear notification in SmartWatch respectively. We also need to implement onStartCommand to interact with Service.
Code:
package com.kpbird.hellosmartwatch;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
import android.database.SQLException;
import android.util.Log;
import android.widget.Toast;
import com.sonyericsson.extras.liveware.aef.notification.Notification;
import com.sonyericsson.extras.liveware.aef.registration.Registration;
import com.sonyericsson.extras.liveware.extension.util.ExtensionService;
import com.sonyericsson.extras.liveware.extension.util.ExtensionUtils;
import com.sonyericsson.extras.liveware.extension.util.notification.NotificationUtil;
import com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper;
import com.sonyericsson.extras.liveware.extension.util.registration.RegistrationInformation;
public class HelloExtensionService extends ExtensionService {
public static final String EXTENSION_SPECIFIC_ID = "EXTENSION_SPECIFIC_ID_HELLO_NOTIFICATION";
public static final String EXTENSION_KEY = "com.kpbird.hellosmartwatch.key";
public static final String INTENT_ACTION_ADD = "com.kpbird.hellosmartwatch.action.add";
public static final String INTENT_ACTION_CLEAR = "com.kpbird.hellosmartwatch.action.clear";
private String TAG = this.getClass().getSimpleName();
public HelloExtensionService() {
super(EXTENSION_KEY);
Log.i(TAG, "Constructor");
}
@Override
public void onCreate() {
super.onCreate();
Log.i(TAG, "onCreate()");
}
@Override
public void onDestroy() {
super.onDestroy();
Log.i(TAG, "onDestroy()");
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
int retVal = super.onStartCommand(intent, flags, startId);
if (intent != null) {
if (INTENT_ACTION_CLEAR.equals(intent.getAction())) {
Log.d(TAG, "onStart action: INTENT_ACTION_CLEAR");
clearData(intent);
stopSelfCheck();
} else if (INTENT_ACTION_ADD.equals(intent.getAction())) {
Log.d(TAG, "onStart action: INTENT_ACTION_ADD");
addData(intent);
stopSelfCheck();
}
}
return retVal;
}
@Override
protected RegistrationInformation getRegistrationInformation() {
return new HelloRegistrationInformation(this);
}
@Override
protected boolean keepRunningWhenConnected() {
return false;
}
private void clearData(Intent intent) {
NotificationUtil.deleteAllEvents(this);
}
private void addData(Intent intent) {
String name = "Name";
String message = "Message";
if (intent.getExtras().containsKey("name"))
name = intent.getExtras().getString("name");
if (intent.getExtras().containsKey("message"))
message = intent.getExtras().getString("message");
long time = System.currentTimeMillis();
long sourceId = NotificationUtil.getSourceId(this,
EXTENSION_SPECIFIC_ID);
Log.i(TAG, "Source ID :" + sourceId);
if (sourceId == NotificationUtil.INVALID_ID) {
Log.e(TAG, "Failed to insert data");
return;
}
String profileImage = ExtensionUtils.getUriString(this,R.drawable.ic_launcher);
ContentValues eventValues = new ContentValues();
eventValues.put(Notification.EventColumns.EVENT_READ_STATUS, false);
eventValues.put(Notification.EventColumns.DISPLAY_NAME, name);
eventValues.put(Notification.EventColumns.MESSAGE, message);
eventValues.put(Notification.EventColumns.PERSONAL, 1);
eventValues.put(Notification.EventColumns.PROFILE_IMAGE_URI,profileImage);
eventValues.put(Notification.EventColumns.PUBLISHED_TIME, time);
eventValues.put(Notification.EventColumns.SOURCE_ID, sourceId);
try {
getContentResolver().insert(Notification.Event.URI, eventValues);
} catch (IllegalArgumentException e) {
Log.e(TAG, "Failed to insert event", e);
} catch (SecurityException e) {
Log.e(TAG,
"Failed to insert event, is Live Ware Manager installed?",
e);
} catch (SQLException e) {
Log.e(TAG, "Failed to insert event", e);
}
}
@Override
protected void onViewEvent(Intent intent) {
String action = intent.getStringExtra(Notification.Intents.EXTRA_ACTION);
Log.i(TAG, "Action : " + action);
String hostAppPackageName = intent.getStringExtra(Registration.Intents.EXTRA_AHA_PACKAGE_NAME);
Log.i(TAG, "HostAppPackageName: " + hostAppPackageName);
boolean advancedFeaturesSupported = DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(this, hostAppPackageName);
Log.i(TAG, "Advanced Features Supported: " + advancedFeaturesSupported);
int eventId = intent.getIntExtra(Notification.Intents.EXTRA_EVENT_ID,-1);
try {
Cursor cursor = getContentResolver().query(Notification.Event.URI,null, Notification.EventColumns._ID + " = " + eventId,null, null);
if (cursor != null && cursor.moveToFirst()) {
String name = cursor.getString(cursor.getColumnIndex(Notification.EventColumns.DISPLAY_NAME));
String message = cursor.getString(cursor.getColumnIndex(Notification.EventColumns.MESSAGE));
Toast.makeText(this,"Notification: Name: " + name + " Message: " + message,Toast.LENGTH_LONG).show();
Log.i(TAG, "Name: " + name);
Log.i(TAG, "Message: "+ message);
}
cursor.close();
} catch (Exception ex) {
ex.printStackTrace();
}
}
@Override
public void onRegisterResult(boolean success) {
super.onRegisterResult(success);
Log.d(TAG, "onRegisterResult :" + success);
}
}
Step 7: Finally we need to register HelloExtensionReceiver and HelloExtensionService in AndroidManifest.xml like following. We also need to provide user permission "EXTENSION_PERMISSION".
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kpbird.hellosmartwatch"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="16" />
<uses-permission android:name="com.sonyericsson.extras.liveware.aef.EXTENSION_PERMISSION" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.kpbird.hellosmartwatch.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".HelloExtensionService" />
<receiver
android:name=".HelloExtensionReceiver"
android:permission="com.sonyericsson.extras.liveware.aef.HOSTAPP_PERMISSION" >
<intent-filter>
<!-- Generic extension intents. -->
<action android:name="com.sonyericsson.extras.liveware.aef.registration.EXTENSION_REGISTER_REQUEST" />
<action android:name="com.sonyericsson.extras.liveware.aef.registration.ACCESSORY_CONNECTION" />
<action android:name="android.intent.action.LOCALE_CHANGED" />
<!-- Notification intents -->
<action android:name="com.sonyericsson.extras.liveware.aef.notification.VIEW_EVENT_DETAIL" />
<action android:name="com.sonyericsson.extras.liveware.aef.notification.REFRESH_REQUEST" />
<!-- Widget intents -->
<action android:name="com.sonyericsson.extras.aef.widget.START_REFRESH_IMAGE_REQUEST" />
<action android:name="com.sonyericsson.extras.aef.widget.STOP_REFRESH_IMAGE_REQUEST" />
<action android:name="com.sonyericsson.extras.aef.widget.ONTOUCH" />
<action android:name="com.sonyericsson.extras.liveware.extension.util.widget.scheduled.refresh" />
<!-- Control intents -->
<action android:name="com.sonyericsson.extras.aef.control.START" />
<action android:name="com.sonyericsson.extras.aef.control.STOP" />
<action android:name="com.sonyericsson.extras.aef.control.PAUSE" />
<action android:name="com.sonyericsson.extras.aef.control.RESUME" />
<action android:name="com.sonyericsson.extras.aef.control.ERROR" />
<action android:name="com.sonyericsson.extras.aef.control.KEY_EVENT" />
<action android:name="com.sonyericsson.extras.aef.control.TOUCH_EVENT" />
<action android:name="com.sonyericsson.extras.aef.control.SWIPE_EVENT" />
</intent-filter>
</receiver>
</application>
</manifest>
Step 8: Connect your SmartPhone and run this example. It will display MainActivity. Before jumping to "Send Notification", open Accessory Emulator and select Extension to verify that our HelloExtension is installed or not. Click on extension menu and it will display the registration details. If extension gets registered successfully then you can go back to Hello SmartWatch application and play with Send and Clear Notification functionality.
Screen Shots
Download Source CodeNote: 1. Import project in eclipse 2. Make sure that you change SmartExtensionUtils and SmartExtensionAPI path from project properties.
Hello,
I try to create anew Web Application for the GS2 using the Tizen SDK (Version : 2.4.0_Rev5 Build id : 20151223-1448).
In the main page I create a list element, to which I then add new button elements via code.
I'm using the template TAUList. Unfortunately, the scrolling using the bezel is only scrolling through the items in the list, which are initially in the list. All later added items can be scrolled only by using the touch screen. Can someone tell me, what I'm doing wring here?
Is there something,which I have to re-init, after I have altered the list?
Thanks for any hints.
HTML:
( function () {
window.addEventListener( 'tizenhwkey', function( ev ) {
if( ev.keyName === "back" ) {
var page = document.getElementsByClassName( 'ui-page-active' )[0],
pageid = page ? page.id : "";
if( pageid === "main" ) {
try {
tizen.application.getCurrentApplication().exit();
} catch (ignore) {
}
} else {
window.history.back();
}
}
} );
} () );
var XML_ADDRESS = "them? cmd=jsonlist2 room=Wohnzimmer STATE&XHR=1",
XML_METHOD = "GET";
var devListArray;
var xmlhttp;
function getFhemData(){
var objDevs = document.getElementById('devList');
var i;
xmlhttp = new XMLHttpRequest();
xmlhttp.open(XML_METHOD, XML_ADDRESS, true);
xmlhttp.overrideMimeType("application/json");
xmlhttp.setRequestHeader("Authorization", "Basic " + btoa("xxxxx" + ":" + "xxxxxxxx"));
xmlhttp.send();
xmlhttp.onreadystatechange = function() {
var JSONCode = JSON && JSON.parse(xmlhttp.responseText);
devListArray = JSONCode.Results;
var dli;
for (i = 0; i < devListArray.length; i++) {
dli = createDevice(devListArray[i]);
objDevs.appendChild(dli);
}
xmlhttp = null;
};
}
function createDevice(dev) {
var li = document.createElement('li');
li.setAttribute('class','li-has-toggle');
var la = document.createElement('label');
la.innerHTML =dev.Name;
var divInp = document.createElement('div');
divInp.setAttribute('class','ui-toggleswitch');
var inp = document.createElement('input');
inp.setAttribute('type','checkbox');
var state = dev.Internals;
if(state.STATE ==='on'){
inp.setAttribute('checked');
}
inp.setAttribute('class','ui-switch-input');
inp.setAttribute('value','test2');
var divInpBut = document.createElement('div');
divInpBut.setAttribute('class','ui-switch-button');
divInp.appendChild(inp);
divInp.appendChild(divInpBut);
la.appendChild(divInp);
li.appendChild(la);
return li;
}
function init() {
getFhemData();
}
window.onload = function() {
init();
};
The Page:
HTML:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,user-scalable=no">
<title>Circular UI</title>
<link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
<link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="lib/tau/wearable/theme/default/tau.circle.min.css">
<!-- load theme file for your application -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="ui-page ui-page-active" id="main">
<header class="ui-header">
<h2 class="ui-title">TAU List</h2>
</header>
<div class="ui-content">
<ul class="ui-listview" id="devList">
<li>List1</li>
<li>List2</li>
</ul>
</div>
</div>
<script type="text/javascript" src="lib/tau/wearable/js/tau.min.js"></script>
<script type="text/javascript" src="js/circle-helper.js"></script>
<script src="app.js"></script>
<script src="lowBatteryCheck.js"></script>
</body>
</html>
hi, I have the same problem :/
did you find an soloution?
Hi,
the CircleHelper.js must be adapted. After adding new items in list, call destroy on your list in listHelper[], and then call again tau.helper.SnapListStyle.create() on the list.
I don't know if there is a cleaner why as of now.
Could the problem be "devListArray.length;" related? Limiting the new items to show up...
Not sure about this.
I just came across the same problem, solution is like @jamesst20 said destroying/re-creating the SnapListStyle items in circle-helper.js
In case anyone still looking for a solution, change circle-helper.js to
Code:
/*global tau */
/*jslint unparam: true */
(function (tau) {
var page,
list,
listHelper = [],
snapList = [],
i, len;
function createSnapListStyle(page) {
if (tau.support.shape.circle) {
list = page.querySelectorAll(".ui-listview");
if (list) {
if (page.id !== "pageMarqueeList" && page.id !== "pageTestVirtualList" && page.id !== "pageAnimation") {
len = list.length;
for (i = 0; i < len; i++) {
listHelper[i] = tau.helper.SnapListStyle.create(list[i]);
}
len = listHelper.length;
if (len) {
for (i = 0; i < len; i++) {
snapList[i] = listHelper[i].getSnapList();
}
}
}
}
}
}
function destroySnapListStyle() {
len = listHelper.length;
if (len) {
for (i = 0; i < len; i++) {
listHelper[i].destroy();
}
listHelper = [];
}
}
document.addEventListener("pagebeforeshow", function (e) {
page = e.target;
createSnapListStyle(page);
});
document.addEventListener("pagebeforehide", function (e) {
destroySnapListStyle();
});
document.addEventListener("onsnaplistitemschanged", function (e) {
destroySnapListStyle();
page = e.target;
createSnapListStyle(page);
}, false);
}(tau));
Than call
Code:
document.dispatchEvent(new CustomEvent("onsnaplistitemschanged"));
whenever your list items changed.
I want to use Edit text on my table row. My codes are bellow
My XML code is
XML:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#3d455b"
android:layout_alignParentLeft="true" >
<HorizontalScrollView
android:id="@+id/hscrll1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_gravity="center"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TableLayout
android:id="@+id/table_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" >
</TableLayout>
</RelativeLayout>
</HorizontalScrollView>
</ScrollView>
My Java code is
JavaScript:
public void init() {
TableLayout stk = (TableLayout) findViewById(R.id.table_main);
TableRow tbrow0 = new TableRow(this);
TextView tv0 = new TextView(this);
tv0.setText(" Actual Values ");
tv0.setTextColor(Color.WHITE);
tbrow0.addView(tv0);
TextView tv1 = new TextView(this);
tv1.setText(" Meter Reading ");
tv1.setTextColor(Color.WHITE);
tbrow0.addView(tv1);
TextView tv2 = new TextView(this);
tv2.setText(" Error ");
tv2.setTextColor(Color.WHITE);
tbrow0.addView(tv2);
stk.addView(tbrow0);
for (int i = 0; i < 200; i++) {
TableRow tbrow = new TableRow(this);
TextView t1v = new TextView(this);
t1v.setText("" + i * 20);
t1v.setTextColor(Color.WHITE);
t1v.setGravity(Gravity.CENTER);
tbrow.addView(t1v);
TextView t2v = new TextView(this);
t2v.setText("" );
t2v.setTextColor(Color.WHITE);
t2v.setGravity(Gravity.CENTER);
tbrow.addView(t2v);
TextView t3v = new TextView(this);
int temp1 = Integer.parseInt(t1v.getText().toString());
int temp2 = Integer.parseInt(t2v.getText().toString());
t3v.setText(String.valueOf(temp1 - temp2));
t3v.setTextColor(Color.WHITE);
t3v.setGravity(Gravity.CENTER);
tbrow.addView(t3v);
stk.addView(tbrow);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_ascendingorder);
init();
}
}
I want to convert t2v from Textview to Edittext.
I tried Edittext t2v = new Edittext(this); But it is not working.
Can anyone guide me on how to do this?
Spoiler
```java
if (type=="dialer") {
String timestamp = list.get(position).get(Constants.DATE);
holder.txtTimestamp.setVisibility(View.VISIBLE);
holder.imgDelete.setVisibility(View.GONE);
holder.txtTimestamp.setText(getDate(Long.parseLong(timestamp),"dd/MM/yyyy hh:mm:ss"));
if (Integer.parseInt(callType) == CallLog.Calls.BLOCKED_TYPE)
holder.imgCallType.setImageDrawable(context.getResources().getDrawable(R.drawable.block));
if (Integer.parseInt(callType) == CallLog.Calls.BLOCKED_TYPE)
holder.imgCallType.setImageDrawable(context.getResources().getDrawable(R.drawable.rejected));
if (Integer.parseInt(callType) == CallLog.Calls.OUTGOING_TYPE)
holder.imgCallType.setImageDrawable(context.getResources().getDrawable(R.drawable.outgoing_call));
if (Integer.parseInt(callType) == CallLog.Calls.INCOMING_TYPE)
holder.imgCallType.setImageDrawable(context.getResources().getDrawable(R.drawable.incoming_call));
if (Integer.parseInt(callType) == CallLog.Calls.MISSED_TYPE)
holder.imgCallType.setImageDrawable(context.getResources().getDrawable(R.drawable.missed_call));
if (Integer.parseInt(callType) == CallLog.Calls.ANSWERED_EXTERNALLY_TYPE)
holder.imgCallType.setImageDrawable(context.getResources().getDrawable(R.drawable.call_received));
}else if (type=="contact") {
holder.txtTimestamp.setVisibility(View.GONE);
holder.imgCallType.setVisibility(View.GONE);
holder.imgDelete.setVisibility(View.GONE);
}else if (type=="favourite"){
holder.txtTimestamp.setVisibility(View.GONE);
holder.imgCallType.setVisibility(View.GONE);
}
// listener
Bitmap finalBitmap = imgBitmap;
holder.imgPic.setOnLongClickListener(view -> {
CustomDialog imageDialog = new CustomDialog(activity,R.layout.image_dialog,"","","", finalBitmap);
imageDialog.setCancelable(true);
imageDialog.show();
return false;
});
holder.itemView.setOnLongClickListener(view->{
if (type=="dialer"){
}else if (type=="contact"){
Intent intent = new Intent(context, ContactDetailsActivity.class);
intent.putExtra("id",list.get(position).get(Constants.ID));
context.startActivity(intent);
}else if (type=="favourite"){
Intent intent = new Intent(context, FavouriteContactDetailsActivity.class);
intent.putExtra(Constants.FAVOURITE_ID,list.get(position).get(Constants.FAVOURITE_ID));
intent.putExtra(Constants.ID,list.get(position).get(Constants.ID));
ActivityOptions anim = ActivityOptions.makeSceneTransitionAnimation(activity);
context.startActivity(intent, anim.toBundle());
}
return false;
});
holder.imgDelete.setOnClickListener(v->{
SqliteFavourite sqliteFavourite = new SqliteFavourite(context.getApplicationContext());
boolean check = sqliteFavourite.deleteData("",list.get(position).get(Constants.ID));
if (check)
Snackbar.make(v,"Successfully deleted",Snackbar.LENGTH_SHORT).show();
else Snackbar.make(v,"Error occurred when deleting",Snackbar.LENGTH_SHORT).show();
});
holder.itemView.setOnClickListener(view->{
call(activity,phoneNumber);
});
```
I was using these code in an adapter.
```java
@override
public int getItemCount() {
return list.size();
}
@override
public int getItemViewType(int position) {
return position;
}
public class MyViewHolder extends RecyclerView.ViewHolder {
TextView txtContactName,txtContactNumber,txtTimestamp;
ImageView imgPic,imgCallType,imgDelete;
ConstraintLayout contactItem;
public MyViewHolder(@NonNull View itemView) {
super(itemView);
txtContactName = itemView.findViewById(R.id.txtName);
txtContactNumber = itemView.findViewById(R.id.txtContactNumber);
txtTimestamp = itemView.findViewById(R.id.txtTimestamp);
imgPic = itemView.findViewById(R.id.imgContact);
imgCallType = itemView.findViewById(R.id.imgCallType);
contactItem = itemView.findViewById(R.id.contactItem);
imgDelete = itemView.findViewById(R.id.imgDeleteContact);
}
}
```
Whenever I am clicking on first or second item then I can hear the clickListener. But when I click on 3rd 4th or higher item then I can't hear the clickListener. Even I had set a selector there but the selector is only working for 1st and 2nd
```xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
androidadding="5dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/contactItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selector"
android:clickable="true">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/imgContact"
android:layout_width="50dp"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/user_profile"
app:civ_border_color="#FF000000"
app:civ_border_width="2dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SpeakableTextPresentCheck" />
<TextView
android:id="@+id/txtName"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Name"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/txtContactNumber"
app:layout_constraintEnd_toStartOf="@+id/imgCallType"
app:layout_constraintStart_toEndOf="@+id/imgContact"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/txtContactNumber"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Contact Number"
app:layout_constraintBottom_toTopOf="@iD/txtTimestamp"
app:layout_constraintEnd_toStartOf="@+id/imgCallType"
app:layout_constraintStart_toEndOf="@+id/imgContact"
app:layout_constraintTop_toBottomOf="@+id/txtName" />
<TextView
android:id="@+id/txtTimestamp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="TextView"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/txtContactNumber"
app:layout_constraintStart_toEndOf="@+id/imgContact"
app:layout_constraintTop_toBottomOf="@iD/txtContactNumber" />
<ImageView
android:id="@+id/imgCallType"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/call_received"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imgDeleteContact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@android:drawable/ic_menu_delete" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
```
When I scroll down then I can hear the listener but whenever I am on top at that layout then I can't access the listener in 3rd or more. Why it's happening? I am not getting any error in logcat. Although I can't click on some items why? I had tried to use `holder.contactItem.setOn....` but it wasn't working also.
<hr/>
When I scroll down I can listen the click. But whenever I am at top I can't listen. But I wonder I can click on Image. I meant `holder.imgPic.setOnLongClickListener.....`.
<hr/>
I have set `onTouchListener` to `itemView` but it's working. It's only not working for onCLickListener and onLongClickListener (As I said earlier it's working when I scroll down).
xxxxxx
MOD EDIT: Unnecessary link removed.