[Q] Calling Webservice from Android browser(Android 2.2) using html5 does not work - Android Q&A, Help & Troubleshooting

Hi,
I have been working on calling a simple web service in html5 from Android Browser(Android 2.2). Its not working on Android browser. But, it works if i run it on a PC. Nothing happens when i click the button. I have been on net for couple of weeks now. But, didn't get anything to work. Below is the code of the html page. please help.
<html>
<head>
<title>UseSwap</title>
<script language="JavaScript">
function InitializeService(){
service.useService("h t t p://localhost:2913/WebServicesUsingCSharp/WebService.asmx?wsdl",
"GetAgeService");
}
var StrYear, StrMonth, StrDay;
function GetAge(){
StrYear = document.DemoForm.StringYear.value;
StrMonth = document.DemoForm.StringMonth.value;
StrDay = document.DemoForm.StringDay.value;
service.GetAgeService.callService("GetAge", StrYear, StrMonth, StrDay);
}
function ShowResult(){
alert(event.result.value);
}
</script>
</head>
<body onload="InitializeService()" id="service"
style="behavior:url(webservice.htc)" onresult="ShowResult()">
<form name="DemoForm">
Year : <input type="text" name="StringYear"/>
Month : <input type="text" name="StringMonth"/>
Day : <input type="text" name="StringDay"/>
<button onclick="GetAge()">Get Age</button>
</form>
</body>
</html>
Regards,
Parashant.

Related

[Q] app for screencast

Hi,
im planning to use my tablet (no problem rooting also) for screen presentations in university. The computers at university are connected via wireless, my idea is to connect the pc from university to my tablet via browser and stream the content im changing in the tablet. I said via browser because we are not allowed to install any app on the computer.
Are there any apps that could do the job?
If your device is rooted you can simply use PICME, which serves screenshots via Http. You'll need to set up a slim JS wrapper to reload http://phoneIp:8082/snapshot.png over and over about once per second, but aside from that it would fit your needs perfectly.
Here's a very simple HTML file that you can use:
Code:
<!DOCTYPE html>
<html>
<head>
<title>Screencast</title>
<script>
var display=[null,null];
var ip;
var updateDelayMs=5000;
var currentBuffer=1;
function switchBuffer(){
display[currentBuffer].style.visibility="hidden";
currentBuffer=1-currentBuffer;
display[currentBuffer].style.visibility="visible";
window.setTimeout(function(){
display[1-currentBuffer].src="http://"+ip+":8082/snapshot.png?"+Math.random();
},updateDelayMs);
};
window.onload=function(){
display[0]=document.getElementById("display1");
display[1]=document.getElementById("display2");
ip=window.prompt("Please enter your Android device's IP in the form x.x.x.x");
display[0].onload=display[1].onload=switchBuffer;
display[0].src="http://"+ip+":8082/snapshot.png?"+Math.random();
};
</script>
<style>
.display{
position:absolute;
top:0px;
left:0px;
visibility:hidden;
}
</style>
</head>
<body>
<img src="" class="display" id="display1" />
<img src="" class="display" id="display2" />
</body>
</html>

Images in RSS (Flash Builder 4.5)

Hello all!
I really need help, because I`m not a programmer, but I make a very simple RSS reader for my website in Flash Builder 4.5, based on this tutorial. Now I have a problem. I need to put images into articles in application (DetailsView). In my RSS feed images in <enclosure> tag. I have no idea how put images in DetailsView and how to get it with enclosure tag.
Please, I really need this and I very greatful for any help!
This is source coude for DetailsView:
Code:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:rssreader="services.rssreader.*"
title="" viewActivate="getDetails()">
<fx:Script>
<![CDATA[
import valueObjects.Item;
[Bindable] private var rtitle:String;
[Bindable] private var rdate:String;
[Bindable] private var rcreator:String;
[Bindable] private var rlink:String;
[Bindable] private var rdesc:String;
private function getDetails():void
{
var p:RegExp = /(")/ig;
var thisItem:Item = data as Item;
rtitle = thisItem.title;
rdate = thisItem.pubDate;
rcreator = thisItem.author;
rlink = thisItem.link;
rdesc = thisItem.description;
rtitle = rtitle.replace(p, "");
}
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getDataResult"/>
<rssreader:Rssreader id="rssreader"/>
</fx:Declarations>
<s:navigationContent>
<s:Button label="Nazaj" click="navigator.popView()" />
</s:navigationContent>
<s:BorderContainer top="0" bottom="0" left="0" right="0"
backgroundColor="#FFFFFF">
<s:Label left="20" right="20" top="42" height="61"
backgroundColor="#FFFFFF" color="#000000" fontSize="24"
paddingBottom="20" paddingLeft="5" paddingRight="5"
paddingTop="5" text="{rtitle}"/>
<s:Label left="20" right="90" top="14" height="23" backgroundColor="#FEFDFD" color="#666666"
fontSize="18" fontStyle="italic" paddingBottom="5" paddingLeft="5" paddingRight="5"
paddingTop="5" text="{rdate}"/>
<s:BitmapImage y="91" left="20" right="20" height="135" source="image"/>
<s:Label left="20" right="20" top="335" bottom="69" color="#666666"
backgroundColor="#FFFFFF" fontSize="18" paddingBottom="5"
paddingLeft="5" paddingRight="5" paddingTop="5"
text="{rdesc}" maxDisplayedLines="50" />
<s:Button left="50" right="50" bottom="22" label="Preberi celoten članek"
click="navigator.pushView(ClanekHTML, data.link)"/>
</s:BorderContainer>
</s:View>
And this is link to my rss feed: http://www.elektro-vozila.si/rssnovice
I found this http://www.telexer.nl/code-snippets/retrieve-images-from-rss-all-of-them/2/ but how to put this code into my code?
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A
OK, thx for move topic. Anyone in this section have a solution for my problem?
Please, anyone with solution for this problem?

[Q] Android Dev help please- my activity stack isnt behaving and i dont know why!

I am going out of my mind trying to work out why one of my activities is not working correctly with the stack.back button.
Activity Brain is launched when the user presses an image button in Main activity, this works fine and the back button behaves as expected from Brain (ie it returns to main activity as expected).
Within brain i want to launch a PDF based on which image button the user presses, I am doing this via URI with the code below, the PDF loads fine, but when back is pressed within acrobat the app returns to Main activity and not the brain which is not the behaviour i want (or expected). I have read the app developers guide and tried all options with Intent Flag_activity (i think) but have not been able to fix the back button behaviour. I have tried linking to different PDFs (in case it was something random in acrobat) but the app behaves the same, always going back to main and not the brain that I want.
I am using Imagebuttons to allow the user to select the pdfs and the code below is calling the URI / intent to display the pdf. I have left in 2 of the Intent.Flags I have tried and had no luck with for amplification, I had expected Intent.Flag_Activity_Clear_Top to work, but i must have missed something.
Brain activity is called from main using the following onClick code
Code:
if (v==bbrain) {
Intent startbrain = new Intent(Main.this, Brain.class); //this is the Brain chooser
startActivity(startbrain);
overridePendingTransition(R.anim.pull_from_left_enter, R.anim.pull_out_to_left_exit);
}
Then brain activity java looks like this:
public void onClick(View v) {
if (v==bhome); {
Intent starthome = new Intent(Brain.this, Main.class); //this is main screen
startActivity(starthome);
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
}
if (v==babouttest){
Intent start1gp = new Intent(Brain.this, AboutScreen.class); //this is 1gp lesson
startActivity(start1gp);
overridePendingTransition(R.anim.pull_from_left_enter, R.anim.pull_out_to_left_exit);
}
if (v==imagepetro) {
File file = new File("/sdcard/documents/1.pdf");
if (file.exists()) {
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivity(intent);
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
}
catch (ActivityNotFoundException e) {
}
}
} //end of load
if (v==imagesteam) {
File file = new File("/sdcard/documents/2.pdf");
if (file.exists()) {
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {
startActivity(intent);
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
}
catch (ActivityNotFoundException e) {
}
}
} //end of load
}
//menu inflator bits
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_brain, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
}
I am not sure if i have missed something elsewhere when writing this app? Below is the brain and main activity sections out of the manifest if that makes any difference
Code:
<activity
android:name=".Main"
android:label="@string/title_activity_main"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
</intent-filter>
</activity>
<activity
android:name=".Brain"
android:label="@string/title_activity_brain"
android:screenOrientation="landscape" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.trainer.Main" />
</activity>
I am totally out of ideas why this code isnt working, i am launching PDFs from elsewhere in other activities and the URI way has worked fine, I am missing something but hopefully a fresh pair of eyes will spot what I cant!
So following this post here http://stackoverflow.com/questions/2442713/view-the-tasks-activity-stack
my activity stack prints out as follows from main to brain activity (correctly)
Code:
Running activities (most recent first):
Run #3: ActivityRecord{41cd3948 u0 com.trainer/.Brain}
Run #2: ActivityRecord{41ca29a0 u0 com.trainer/.Main}
Run #1: ActivityRecord{41a2c5d8 u0 com.cyanogenmod.trebuchet/.Launcher}
so all good so far I think, but when I launch any of the pdfs from the brain activity this is the resultant activity stack:
Code:
Run #5: ActivityRecord{4154ca00 u0 com.adobe.reader/.ARViewer}
Run #4: ActivityRecord{41bcbcf8 u0 com.trainer/.Main}
Run #3: ActivityRecord{41cd3948 u0 com.trainer/.Brain}
Run #2: ActivityRecord{41ca29a0 u0 com.trainer/.Main}
Run #1: ActivityRecord{41a2c5d8 u0 com.cyanogenmod.trebuchet/.Launcher}
So for some reason opening the PDF starts another version of the main activity, btu I have no idea at all why this is happening? Hopefully this means something to someone else?
Thanks for any help that can be offered on this....
Hopefully I have provided enough detail, if not please let me know what I should include. Thanks for any help, Andy

[Q] How to root hcl me v3

Guys Can anyone tell me how to root HCL v3 Tab. Thanks In advance.
HTML:
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2768528611534113";
/* text */
google_ad_slot = "9446745660";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
This is the I9100 forum.
karv26 said:
Guys Can anyone tell me how to root HCL v3 Tab. Thanks In advance.
HTML:
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2768528611534113";
/* text */
google_ad_slot = "9446745660";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Click to expand...
Click to collapse
Install vroot app with internet connection........rooted sucessfully

Sams. Gear S watch-face WEB APP , problem when implentation MaterialDisign Google fnt

Hi there,
"Samsung Gear S watch-face S watch-face, problem when implentation MaterialDisign Google fonts "
Gear S watch-face on Tizen WEB APP
Try to make implentation( self hosting) MaterialDisign Google fonts and have a some problems:
CSS
.......
.....
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(../css/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(../css/fonts/MaterialIcons-Regular.woff2) format('woff2'),
url(../css/fonts/MaterialIcons-Regular.woff) format('woff'),
url(../css/fonts/MaterialIcons-Regular.ttf) format('truetype');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 36px; /* Preferred icon size */
display: inline-block;
width: 1em;
height: 1em;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
position: absolute;
left: 150px;
top: 100px;
color: rgba(255, 255, 255, 1);
text-rendering: optimizeSpeed;
}
...
HTML:
...
THAT WORK :
<div class="material-icons batteryyc" id="batteryy"></div>
NOT WORK (crash CSS of the page app):
<div class="material-icons batteryyc" id="batteryy">battery_charging_full</div>
..
Not WORK: JS+HTML:
.....
<div class="material-icons md-18 batteryyc" id="batteryy"></div>
..
document.getElementById("batteryy").textContent ="";
...
Why on screen browser work as one old IE?
Google DOCs:
https://www.google.com/design/icons/#ic_battery_charging_full
http://google.github.io/material-design-icons/
It’s easy to incorporate icons into your web page. Here’s a small example:
<i class="material-icons">face</i>
For browsers that do not support ligatures, fall back to specifying the icons using numeric character references like the example below:
<i class="material-icons"></i>
etc
PLZ HLP
news
News;
I have one replay in the other website about tizen:
"17 aoû 2015 11:02
Hi,
It seems that Tizen doesn't support ligature for now. I'm expecting that it will support it soon.
Regards"
news 2 , Q2
Okay , i'm find one solution for make some code with MD icons in watchface, but MD-BADGES still on the "dark side" ))
DOCS: http://www.getmdl.io/components/index.html#badges-section
try to make this test code in the HTML of the watch face and look were is bages?
HTML:
<html>
<head>
<!-- Material Design Lite -->
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.3/material.min.js"></script>
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.3/material.brown-deep_orange.min.css" />
<!-- Material Design icon font -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<br>
<br>
<div class="material-icons mdl-badge mdl-badge--no-background" data-badge="99">sms</div>
<br>
<em class="material-icons mdl-badge" data-badge="99"></em>
<br>
<i class="material-icons"></i>
<br>
<br>
</body>
</html>

Categories

Resources