i want to open google chrome from my android application. when chrome opens the display area, address bar, buttons, etc should be visible but the the tabs must become invisible or an application name or image must be placed on top of the tab. the user should not get the feeling that chrome web browser is being used. i want to publish the application in google play.
As stated in the information for Android Webapps, you have two choices - run your app in the browser or via webviews.
Have a look at Android Webviews and the Webview api
Your users will not feel that chrome is being used. There's no address bar and you have to add navigation if you need it
It is not possible to do this to load Chrome and have the controls removed. Chrome is also not part of the WebView on Android.
The closet you can get is to load Chrome as a page and then force full screen mode via the scrollTo(0,1) method and then on first touch call webkitRequestFullscreen on the document... however once the user breaks out of full-screen they will see the normal browser UI.
If you really want, you could embed ContentShell, however this adds 30+MB to your package size and it also is insanely hard to do just for a simple app.
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 a WordPress website and I am transforming this website to a PWA with the help of a plugin.
The PWA is working as expected: notifications, working without internet …
I have also followed this tutorial completely:
https://css-tricks.com/how-to-get-a-progressive-web-app-into-the-google-play-store/
At the end, I have an Android launcher.
The new app is doing this:
If the browser is not set by default, it will ask the user to choose a browser.
I have an URL bar at the top of the app.
The app is not working without internet.
How can I fix all those points?
If the browser is not set by default, it will ask the user to choose a browser
Can't get this one, every mobile phone already do that by default, I think.
I have an URL bar on top of the app
Check if you have included the tag:
"display": "standalone"
on the manifest.json file
the app is not working without internet.
Check your service-worker.js file to see the resources needed to provide an offline experience are effectively cached. One can use this nice tool from Google to define routes policy easily.
You can use this Helpful tool.
Not installed yet
A URL bar being still visible at the top is indicative that the web page has not been installed yet as a PWA on your device. Choose Install from the tab menu or click on a [↓] icon next to the URL bar.
This will most probably also solve your other problems.
I want to build an android app, that display web sites, but instead of displaying it in normal browser (e.g. Google chrome), i want to display it in my app window.
I am thinking, for each site, my app will call separate chrome window, so it will open in a chrome, but in my app.
What do you think?
Thanks all for ur help
I have a responsive website which can be accessed across multiple devices, our design and application is mainly targeted for mobile users.
To ease access to the site, we want to create a launch icon which will apear on the mobile home screen and user can access the site using one touch, as against launching the browser and typing the url / opening the bookmarked page.
I found a solution for it in IOS, which is also supported by the safari browser using which you can save the page url as a launch icon, can a similar feature be found on a android device? I would also be interested in prompting the users to create the launch icon if they are accessing it from a mobile phone /tablet.
Default Android
This is the preferred way since this is all based on default Android options and doesn't add any maintenance.
As a widget from bookmarks
If on android you long press the home screen and then select the widget option you can create a bookmark. This will let you select a bookmark from your chrome bookmarks to be linked on the desktop. If that works for you you're all set with default Android features. The icon from the bookmark is used on the desktop.
Directly from Chrome
Similar to this approach is selecting the "Add to homescreen" option in the chrome settings menu.
The icon is the icon from the website.
Custom alternative
As stated before the alternative is to create an app that only serves the purpose of being a link to your mobile website. Then you have 2 options:
Using default browser of user
An app that uses intents to open the default browser of the user with your URL. This should be the way to go since the user can now keep on using his favorite browser.
In app browser
An app that contains a single webview loading the URL of your webapp. This last option gives you more control over the browsing experience (blocking scripts, overriding requests, ...). However the user can no longer use his preferred browser.
About the icon
In both cases the Icon will be the icon configured and distributed within the app. This also introduce the need of a new app release if the icon or the URL should change.
About the code
Code examples and information about this webapp in app approach can be found at http://developer.android.com/guide/webapps/webview.html
Another good resource is https://developers.google.com/chrome/mobile/docs/webview/overview where mobile app development using a native android app with webview is covered with several aspects like tools, css tricks and more.
If I have understood your issue exactly then you would want to show a launcher icon for your website without creating any activity (screen) or doing any programming in android.
If this is the case then my answer is YES, as depicted in snap Google chrome provides this functionality to create a launcher/app icon on home screen.
Some webBrowsers like chrome enable the user to make a bookmark for a specific URL as an icon in the home screen, but I did not get evolved in a project like that. So it is possible.
You can make it simple by creating an application that contain only a webview to open your url and you can then create an icon for your app that hold the website on the home screen as the following in this answer
In my 3 years on Android I have never seen a website ask me to make a shortcut on my homescreen, however, the standard Android browser as well as Dolphin can create shortcuts from bookmarks.
While researching this with a quick search I found this thread states that Chrome allows this as well, and there's even a way to specify a homescreen icon for your users.
I'm looking to build an android app based off a mobile site. Basically, I just need an app with a browser that I can use as a platform.
Many of the "build an app online" sites offer this, where you just put in the home url etc, but they all include their own ads etc.
Any ideas where to start?
If you want to make your own simple app without Ads, use just a WebView inside of a simgle activity layout set to fill the screen.
Doing this you will eliminate all ads, as well as have the ability to add in more features later on if you so choose.
If you just want to create a launcher icon that will open up the default browser to your sites page, you can do that by just starting a browser intent, and then closing the actual app.
This will allow you to have an app icon and play store listing, however the only thing that iw will do is bring the user to your website like you have mentioned.
Create an Activity with a WebView.
I think you're looking for an app that displays a WebView. However, that will only display the website as if you were looking at it in a mobile browser such as Android Chrome.
If you want the data from a mobile site, without anything else, then you have to hope that the site provides that, or you have to download its HTML and scrape it.