i would like to add a widget that i found from a website into my android app.is that possible?this is the code,as i get it from the site:
<iframe src="http://www.mykosmos.gr/loc_mk/wforecast_widget.asp?city_code=0032&bcolor=F0F0F0&fcolor=000000&font=Trebuchet MS&pos=hor" frameborder="0" height="180" width="430" marginheight="0" marginwidth="0"></iframe>
If all you want to do is show the html response as part of your View, not having the user able to interact with it and not needing any javascript to run, then I think the Android WebView would give you what you need.
It allows you to embed the rendered page into a standard Android layout, but does not allow any interaction with the content.
Check out the API docs for android.webkit.WebView Note that the first answer confuses WebView with launching the Web browser via an intent. WebViews allow embedding.
Related
I am loading Website inside App using cordova.InAppBrowser.open('example.com', '_self', 'location=no,clearsessioncache=yes') and everything is works fine i.e it shows complete website mobile view inside the app, but now I am using some navigation inside assets\www\index.html file and when user will click on link the navaigation I want to load the website inside the div OR without losing the navigation.
function load_web(URL)
{
cordova.InAppBrowser.open(URL, '_self', 'location=no,clearsessioncache=yes');
}
<a href="javascript:load_web('example1.com')" >Web 1</a>
<a href="javascript:load_web('example2.com')" >Web 2</a>
In other words, you want to show a non-fullscreen external site using Cordova's InAppBrowser. You can't do this, as it will always cover the entire app window. You have to use iframes for this, but this may or may not cause your app to be rejected by the store.
Notice that iframes and InAppBrowsers are becoming more and more restricted and eventually, Google and Apple could simply delete all apps using iframes and InAppBrowsers for the so-called security concerns paranoia. (and I wouldn't blame them, for the ill-use of iframes that we see everywhere)
I'm trying to use Chrome's new Intent:// structure, and I've determined these intent URLs don't resolve when inside an iframe.
For example:
iframe.html
Take a QR code
test.html
<iframe src="iframe.html" width="300px" height="300px"> </iframe>
When you click on the link, you'll get a 302 UNKNOWN_URL_SCHEME within the iframe. This happens both Chrome and Chrome Beta.
Is there any plan to support this use case? What is the reasoning behind this design choice? Is there any way I can load an intent from an iframe?
Thanks,
https://developers.google.com/chrome/mobile/docs/intents
Quick answer: No, it is a potential security risk.
I have replicated the three ways developers used it here http://jsbin.com/ozecok/latest (all fail)
Intents are the officially supported way to launch Android applications from the web and you have to do that either via a user gesture in the host page (not an iframe) or via a redirect to the intent syntax.
Try to add target="_blank" in your link tag, this worked for me.
In a WebView on the Android platform, is it possible to listen to when a div that is marked with contenteditable=true is edited?
If it is not possible, what would be my next best option?
Do you own the web page loaded in the WebView?
Javascript runs in the WebView can interact with the host Android app (see this guide), and it seems that the listening can be done in javascript (see this), so if you can modify the web page and add a callback to Android java code then it can be done.
I have a string which consumes the html code of a form and I want to show that form in my app and it should also work further as on submit it should move forward to next page.
I used WebView, it just shows the page in a static way. It don't support buttons and DatePicker, so I DONT WANT WEBVIEW.
First off, WebView does support buttons, and you could support a DatePicker either by using an HTML/JS one or by doing something fancy to route a request to the Java side of things. I really suspect your insistence on not using WebView is going to prove unproductive.
That said, sure you should show your HTML in your app without using WebView... you could write your own web control or take another (Firefox is open source as is WebKit on which WebView is based, in fact so is WebView itself for that matter). That's going to be a heck of a lot of work though.
I just noticed that one of the things that keep working in browsers on PC, does not work on an Android browser.
I want to POST a form to a hidden iframe. This is basically to initiate a file download after verifying user credentials.
<form method="post" action='/downloader.php' target="hiddenframe">
....
......
...
<input type="submit" value="Download">
</form>
<iframe name="hiddenframe" style="display:none;"></iframe>
This doesn't work on Android browsers. I suppose I should be concerned of the iframe. What should I take care of or what alternatives I have to make this work?
Thank you for any insight.
check this notes about using iframe in Android:
dose apple and Android Browsers support Iframe??
I hope this helps you.
I don't know how Android handles frames, plus different Android roms use different browsers.
What I do know is that as of HTML5 frames are deprecated, therefore not a very good practise. If not anything you are going to have more and more compatibility issues with new browsers in the future.
Why don't you do the request on the same page? If the downloader.php has the proper headers the download process should start without breaking or changing the current page at all.