So that I don't ask the wrong question, my end goal is to build a PWA that is accessible from Android 5.x and up now and iOS later in the year. The main problem with this is Classic Bluetooth is not yet stable/standardized enough for the web.
My next plan was to build a "native" app (in .NET MAUI so that I can reuse parts in iOS) using a WebView for displaying the PWA and calling back to the native app for Bluetooth. The problem here is the WebView version on the devices I have to support doesn't support PWAs, service workers, etc. (upgrading the hundred or so hardware devices is not possible, upgrading the OS is not possible, and it's pre-Android-8 so upgrading WebView is not possible without a new ROM).
Finally I've tried installing Chrome via device management and using "Chrome Custom Tabs" from MAUI. The simplest implementation works:
// Browser is <IBrowser>Microsoft.Maui.ApplicationModel.Browser.Default
await Browser.OpenAsync(
"https://www.whatismybrowser.com/detect/what-is-my-user-agent/",
BrowserLaunchMode.SystemPreferred);
and the tab is displayed "in" my app, however the location bar is shown within the tab:
Which brings me to the question:
How do I use a Chrome Custom Tab from MAUI but hide the location bar? Is this even possible?
There's little to no documentation on this for MAUI. I've tried looking through the MAUI source, but all I can see are some options:
await Browser.OpenAsync("https://www.whatismybrowser.com/detect/what-is-my-user-agent/", new BrowserLaunchOptions
{
LaunchMode = BrowserLaunchMode.SystemPreferred, // open inside the MAUI app, i.e. Custom Tab
TitleMode = BrowserTitleMode.Hide, // doesn't seem to have any effect
Flags = BrowserLaunchFlags.LaunchAdjacent // the only Android flag
});
The LaunchAdjacent flag just opens "up" instead of sideways. The other flags are for iOS, detailed here. The TitleMode doesn't seem to do anything.
Reading about Chrome Custom Tabs here, it appears it's not possible, unless I own the destination URL and setup a Trusted Web Activity. Hosting a web app combined with a native app for Bluetooth may be the only way to go if I can't use a WebView.
Related
I want my app to launch chrome but also monitor the user's actions on chrome, such as navigating, back, etc. I think I can launch chrome using Intents, but I'm not sure about monitoring user input.
With chrome application is not possible. For do that you must implement a webview within your own app.
Well you can try Custom Tabs
With Custom Tabs you can get instance of browser which support CustomTabs like chrome without creating a web view. As it provide navigation awareness, the browser delivers a callback to the application upon an external navigation. You can modify and update following -
Custom menu
Color of the address bar
Custom action button
Custom enter and exit animations
Check Custom Tabs Implementation Guide
You need to use Web view or create your own browser then you can achieve your goal.
I need to create a wrapper app. Basically it is just a webview pointed to our online hosted react app. It must build to both iOS and Android. Therefore I have considered using plain react native.
Most important feature is that the app must be registered on the device as an app that can handle links when using the native "share" feature.
Example; if I do a google search in chrome/safari/whatever I am able to press-hold any of the links (search results) I can then click "share" this will normally open a menu with lets say share to; "drive", "gmail", "messenger", "sms".... etc. I want our wrapper app to show up in the menu and be able to handle the link.
I have tried to search for libraries/frameworks that makes this possible. But all search result I am getting seems to be explanation on how to do the opposite thing, opening the native share menu from within the app.
I have been looking at expo, but can't figure out if they support this feature, otherwise I would consider create-react-native-app which is react-native based, but I am also not able to find direct documentation on how to implement such feature.
Further more, I know that there is a unity plugin that will do this, and that I could combine it with a uniWebView which would handle the wrapper app part.
How can I achieve a native share to feature on a simple wrapper app that builds to both iOS and Android?
You won't be able to do that in react native on Android because its not part of the native code. Its part of the manifest. You need to follow the instructions at https://developer.android.com/training/sharing/receive and set up an intent filter in your manifest telling the OS your app handles the correct mime type, and what activity to send it to. That activity would then have to handle the incoming data, either directly or by sending it to react native (which is going to be at least a mild pain, RN is ok when you want it to display a isolated view or want it to call a native module, calling RN code isn't very easy). This doesn't mean your app can't use react native, but that you'll need to modify the default manifest it creates.
If that's a major usecase of your app and your app is 90% just displaying your webpage, you may have an easier time of things not using react native and just displaying a web view. (I'll leave my bias of RN just being a horrible solution for everything at the door here).
How can I, in Android APP, open a URL in browser with a named window?
There are many good solutions for, from Android APP, opening a URL in a browser window with the Intent.ACTION_VIEW, but is there a way to specify a target name?
The reason I need this is because there is a specific step that needs to done is a browser, instead of in my APP. If a new browser window is opened every time, there will be multiple browser windows open. What I need is just using one fixed browser window.
To make it clear, below are two similar situations when open another browser window with a link. What I need is the latter one.
< href="url" target='_blank'> Pop open a new window each time clicked.</>;
< href="url" target='MyWindow'> always open in the same window</>;
Thanks.
The behaviour you're trying to achieve is only possible through a custom webview or a 3rd party library. I would recommend Chrome Custom Tabs though because many mobile browsers actually do implement those and they offer much flexibility. Also some websites block features when they're shown in webview. For example you cannot use Google login in a Webview. You need to launch a browser or a custom chrome tab.
I have a Firefox add on implemented as a web extension.
When I install the app on firefox for android, there is no button to trigger the action for the app - this is because browser actions are not supported on Firefox for Android
So, next I looked into adding a context menu item, to allow the user to trigger the extension that way. However, unfortunately the context menu API is not supported in Firefox for android either.
So - what options do I have with regards to adding some sort of UI so that the user can trigger my web extension?
It seems like the only answers to this at the current time are:
i) to use pageActions which weren't really designed for this purpose (they are supposed to be for things which are only applicable to certain pages.
ii) as in #Makyen comment above to add something to the dom which is clickable
I have never seen this type of EditText, Toggle Button and Bottom Bar Button used by Opera Mobile / Mini in other applications on Android. I want to know which GUI framework they have used to build such a great cross platform UI application?. Is there any open source framework available for this or they have used their own proprietary. Also I want to know how can we develop such a great user interface based applications?.
It's a custom framework, see the press release for what is public about it.