Set Custom Keyboard as default - javascript

Hey I created a custom keyboard for android studio following a tutorial.
But to use it I have to change the Keyboard on the device on my own. Is there any method to avoid this, so that my custom keyboard shows up automatically when I open the app.

Related

How to prevent outside JavaScript event handlers from being triggered from a Shadow DOM?

I am trying to create a Chrome extension that is toggled via keyboard shortcut. The keyboard shortcut brings up a ShadowDOM that contains a search bar (similar to spotlight search). The problem I am getting is some key presses (e.g. the key 's' on GitHub) will trigger a javascript action on the native webpage (in this case, selecting GitHub's own search bar).
Does anyone know of a way to disable outside JavaScript events, and/or a way to do this via Chrome Extension?

Opening the Virtual Keyboard in Touchscreen devices

I am trying to develop a very dynamic Website for my project using Javascript.
There I want to use custom input elements (purely custom elements, not customized) but I am not able to get that how to open the Virtual Keyboard in Touchscreen devices.

Can I programmatically hide the form input ribbon control above the keyboard in safari on iOS?

For a prototype that I'm working on, we'd like to hide the ribbon that shows up above the keyboard on mobile web browsers on iPhones. This control allows users to cycle through form fields on a web page, and looks like this:
What I've tried:
1. Using contenteditable divs instead of inputs in the hopes that if the browser doesn't see traditional inputs, it won't show this control
2. Removing the tabindex property
Is it possible to programmatically control the visibility of this ribbon on iOS mobile web browsers?

is it Possible to Trigger Android Toast Notification from Webpage?

Right now in web pages I sometimes want to send an alert to the user, saying that an Ajax request was successful or unsucessful. Using Javascript's alert() function works, but on Android it's a large popup that the user has to interact with before continuing.
Some apps trigger a different sort of message. It's a gray rectangle with rounded corners. It appears near the bottom of the screen and is unobtrusive but noticeable.
Is there a way to trigger this from Javascript?
Edit: I'm running a website, not an HTML5 app, and I don't need the undo functionality, just the messaging.
It depends on whether you're running a JavaScript/HTML5 app that uses WebView on your android device or if it is just a website.
If it is the first case, then there is a way to show native Android toast notification using Android JavaScript interface. This exact problem is solved here in Android WebView documentation.
In case you're running a website and you want it to look native on android, you will have to implement a notification on your own and style it so that it looks similar to native toast notification. You can use jQuery UI tooltip with custom styling for that purpose, for example.
You can achieve this by using JavascriptInterface callback in your android code.
This allows you to call android function using javascript, where you can call the function to display your toast.
See this documentation.

How to auto-scroll to input field in Android when the soft keyboard overlaps them on showing?

I am developing a hybrid app using Worklight, and I am experiencing the following issue:
When the user clicks on an input field, the soft keyboard that pops up hides the input field when the latter is relatively low on the screen. The page is scrollable, so the user can scroll and see the field again, but the customer requirements define that the page will auto-scroll until the field is visible.
Please note that this happens only in the Android environment. In the iPhone and iPad environments the default behavior is the the desired one.
Based on my findings, the trick should be done via the android:windowSoftInputMode attribute in the Android manifest file. However, all my efforts there failed to achieve the auto-scroll.
If there is a solution that is Worklight specific, I would prefer to use it, rather than intervening in the Android native code.
This isn't really about Worklight at all... but about web apps in general in Android, it seems (from a quick search in Stack Overflow).
Here are some suggested solutions, that differ from yours:
Textbox hidden below keyboard in Android webview
html textfield in WebView in an Android application is hidden by the soft keyboard
Keyboard hiding EditText when android:windowTranslucentStatus=true
You could possibly also use iScroll.js (lite edition) - or implement this yourself by catching the focus event - to scroll a specific amount of pixels upwards.

Categories

Resources