I'm building an Android app using Phonegap, which means all of my code is in html and javascript but is compiled to a native app.
Phonegap has an "in-app browser" that allows users to be smoothly directed to webpages without leaving the app. I've gotten the browser to open; my problem is that I can't get it to close after that. There seems to be no exit button or any way of quitting the browser from the inside.
Is there a way to configure the in-app browser so that it has an exit button? Or -- even better -- is there a way to wrap a custom header or frame around the browser? Like the Facebook app for ios, which wraps its own navigation frame around external webpages that users can view inside the app
If you open the inAppBrowser with _blank set then the browser should open with a navigation bar with a 'Done' button that allows you to dismiss the browser:
window.open("http://www.ibm.com", "_blank", "location=yes");
Related
The title may be confusing. Let me explain :
When you open a website in Chrome in Android you can create a shortcut to the page clicking the three dot icon in the top right corner, after choosing "add to Home Screen".
For some website/webapp the shortcut acts as a standalone app starter. In other words it opens in a dedicated container in Android and if you were to tap the shortcut again the app wouldn't open twice, instead it is aware a container already exist and send it to the front (only one instance).
It is as if Chrome recognizes the website as an app.
But for my webapp it doesn't work. If I make a shortcut on the home screen and tap it, the page opens in a new tab in the main Chrome instance. This webpage/webapp is supposed to be standalone, there is no point to have multiple instance of it in the browser. Ideally when I tap the shortcut Chrome should open the app in its dedicated app window (to avoid clogging the tab list uselessly.)
Does anyone know how to circumvent this problem? Are there some instructions to add in the HTML to force Chrome to recognize the page as an "app" and make use of its own container?
As I write this question I believe this has something to do with Progressive Web App, Chrome only accepts to "install" your website as an app shortcut if it follows a certain format.
But also my app doesn't need to implement all these progressive features, it's just a simple app that only myself is using.
So if you know how to force Chrome to produce this effect without writing a lot of code I would appreciate.
It does need to be a PWA. Here are the requirements.
I have web-app build with php+mysql+html5+bootstrap. App is fully in https and all i want is make a cordova app that opens the webapps's url.
BUT also i need to implement in app purchase. That will come later on.
Currently the problem is that i reserved the sample main screen(index.html) for the in app purchase (perhaps not needed) and the app url wil open by using plugin
cordova.InAppBrowser.open(linkTarget, '_self', location=no,zoom=no,hardwareback=no');
It works, but whenever i click a textfield and the keyboard comes visible, i can see the index.html behind. How to hide it or load the https content into it ?
Tested with old sgs 3 i9600, updated to the latest available android 4.3
series of photos shows what i mean. After clicking the textfield:
http://postimg.org/image/ka2covazh/
Is there a way to prevent my site from being opened inside a UIWebView of any iOS or Android app, such as formatting the URL in a special way? These are apps that I do not own, so the call is coming from my page, not from the app.
Preferably, when an app tries to open the page on my site from within the UIWebView, it would automatically open up the page in the Safari or native browser app instead of inside the users application.
Otherwise, it looks like I would have to run some javascript to determine if the page is opened inside of a UIWebView and then just restrict access.
No. A browser is just an app. There is no specific distinction between a browser app using a webview and another app. That link for javascript browser detection will be pretty much useless for this scenario. Apps can set their user agents to whatever they want, including a user agent identical to what the native browser app uses. Essentially anything that you try to use to detect the default browser can be mimicked by another app.
You could change the user agent in your own app to something specific that you could then detect with javascript.
You can also call javascript functions in the webview from your iOS code so you could potentially wait to display things until that call comes from your app.
While these things can be easily mimicked, and wouldnt block a scraper that ignores javascript, it's unlikely someone will go through all the trouble. If you want further protection, you'll have to introduce some form of authentication.
Is it possible to open AdMob web links in native browser and market links in market app?
I.e. now when I click on the add my Phonegap WebView overrides by Ad content and there is no way back except pressing Back button (I should click many times to go back in some cases).
I'm using Phonegap 1.0 and "Smartphone Web" AdMob.
I would imagine this is a setting in the admob code you put in your UIWebView
I want to call android application on clicking of button on some website from mobile.
Suppose I am opening one url on android browser and I want to call my application on clicking on button provided by that site. How to do that??
Suppose we are using browser other than Chrome then is it allowing??
If you link to your application as "myapp://foo/bar", can't you use some sort of intent filter to start your application.
I mean, if you press a youtube link in the browser it asks if you want to complete the action with the YouTube app or the browser.
I have seen similar examples regarding Google Maps links (which would open in either browser, google maps(?) or GeoBeagle).
Please take a look at the WebViewDemo. Javascript code in the web page can call into your Activity. As well as the other way around.
You cannot... if the site is being browsed in the default browser (Chrome).
If you already have an application that embeds the WebView, then you can do some bit of handling of - mouse clicks, window alerts, navigation etc. Otherwise, not!