I am trying to create an android application with phonegap and Cordova. I have got a Honeywell device 75e on which the app will be running. I have got to the point where by which if I press the scan button on the device, the bar code gets printed into the textbox which is in focus. However what I want to do is that when the scanner button is pressed and the bar code has been read using the internal scanner on the device, the application should go to the next page. I was thinking of adding a on key event on the input box itself but I cannt really do that as the user of the application can type the text in the textbox and then press the go button.
Is there a way to find out the keycode for the scanner button on the device and if there is then I could modify the application to look for the key code and fire the fake button click event.
Any help here would be much appreciated.
I think I have figured it out how to get around this but posting it here for anyone who is stuck as well. If you log into the honeywell technical support portal, (login is free) you can get the web API SDK which allows you to communicate with the hardware. It adds listeners to the bar code and also has additional functions.
Related
I have a CRM developed in PHP. I am developing an attendance system so that when a user logs in the CRM and clicks on the 'Shift Start' button then the agent will change that browser tab or minimize that tab and work on his system.
I need to check that the user is still using his system - I mean pressing the keyboard buttons and moving the mouse.
How can I detect that the user is active on his system or not as that tab is inactive or even he minimize his browser. Any jQuery code or suggestions please.
The challenge you have is that it seems your CRM is only used to start the shift, and the actual work is happening outside of the CRM. If so, any JavaScript code you develop and place in your CRM will only be able to detect mouse movement "inside" the browser window of the CRM.
Once a user's cursor goes "outside" the window (or in another tab), you won't know what it's doing. This is a good thing from a security perspective, and there is (fortunately) no way around it.
We have a chatbot using the bot framework. The front end connects to it via direct line using The Bot Framework Web Chat component (https://github.com/microsoft/BotFramework-WebChat).
We use this chatbot on our website that also serves mobile users (Android / iOS) that use a virtual keyboard. So far we have only been able to test our code on Android.
When a user taps the chatbots textbox the virtual keyboard shows up. The user types a message and presses the enter key on the keyboard. The message is sent and the keyboard is still visible for the user to send another message. All good so far.
But if the user sends the message using the button instead of the enter key the virtual keyboard disappears.
This means that users that prefer the send button over the enter key have to click the textbox to re-open the keyboard every time they send a message. This behavior is simply annoying and we do not want to annoy our users. So I have been tasked to fix this.
I have tried to show the keyboard using the following this:
var buttons = document.getElementsByClassName("webchat__icon-button");
for (i = 0; i < buttons.length; i++) {
buttons[i].addEventListener("click", focusChatbotInput);
}
function focusChatbotInput() {
let textbox = document.getElementsByClassName("webchat__send-box-text-box__input")[0];
if (textbox) {
textbox.focus();
}
}
I also tried calling focusChatbotInput from the click event of the entire webchat div. This does open the keyboard when the user clicks anywhere in the div except on the send button.
I also tried making my own custom send button that calls
<button onclick="focusChatbotInput(); document.getElementsByClassName("webchat__icon-button")[1].click();">Send</button>
This did not work.
It seems that something within the library in the send buttons click event handler breaks focusing on the textbox.
Does anybody have an idea of how to work around this? Any help is appreciated. Thanks in advance!
I am accessing an html webapp within a WebView in an Xbox XAML app. For context, it was previously a hosted webapp, but leaks while playing video content were causing crashes, which prompted me to use a XAML app with a WebView and a MediaElement.
Initially, my <input/> fields were not showing the keyboard (InputPane) when focused and pressing the 'A/ok' button on the controller/remote. Using the following
window.Windows.UI.ViewManagement.InputPane
.getForCurrentView()
.tryShow();
helped show the keyboard on first key press. With my app hosted in the WebView, I had the same problem, but window.Windows was not available. The solution seems to be the use the ScriptNotify event on the WebView, that itselfs calls the (very similar) following code in the C# portion of the code:
Windows.UI.ViewManagement.InputPane.GetForCurrentView().TryShow();
So far so good. Now the problem: when hitting the "B/return" button on the controller/remote, the InputPane leaves, and the <input/> element is obviously focused since it still shows a blinking text cursor, but the app does not respond to keypresses. I have to press the "B/return" button a second time to regain control on the webapp.
I looked into the InputPane api, and in hacks like focusing the WebView but without success so far.
Any help is greatly appreciated!
I am using phonegap to develop a web app for Android, and since I will have my own keypad in HTML, I need to disable android's system keyboard, preventing the it from showing up when the user clicks on any text input field. I don't want to use readonly input field or onblur() since I would like to have the cursor in the text filed so user can move the cursor position while they're entering inputs.
So I want to completely disable Android's keyboard on default, I tried adding android:windowSoftInputMode="stateAlwaysHidden" to manifest.xml but this does not work.
I also try use a javascript interface from here, but there was a javascript-java bridge crash issue on Android 2.3.x.(link to issue). So I still don't have a good solution now. Please help.
Thank in advance for any help.
Okay, you've got a few options! You can try to disable the keyboard completely using:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
If you choose this way, be sure to return the settings to normal if that's not done automatically. I haven't used this before and couldn't tell you how it behaves, but keep that in mind! You don't want a user to reply to a text they receive while using your app only to have their keyboard disabled :)
You could use something similar to the following link. I haven't dug through it very thoroughly (tl;dr) but he creates a custom view that extends from android.inputmethodservice.KeyboardView and uses that instead.
https://stackoverflow.com/a/1947370/1183256
Lastly (I'm not sure how much this would differentiate from the first one) you could create your own IME.
How to develop a soft keyboard for Android?
http://developer.android.com/guide/topics/text/creating-input-method.html
i have developped a mobile app with dojo and phonegap for android. The problem is, that I want to acces the bottom right corner button. I want to change its name to "send" and I want to connect the button with a function. Does anyone have an idea how to do that? Using javascript, or how to do that natively?
Natively it is possible to change the text to certain other limited options however I doubt whether it is possible to do from the context of a PhoneGap app.
Check this post which details the process of doing relatively same but in native.
Android - Handle "Enter" in an EditText
For more detail you need to check the doc