Hello All,
Here I am sharing some information to include and use of the SoftKeyboard Plugin for Android.
1.Install SoftKeyboard plugin using the latest version from GitHub:
$ cordova plugin add https://github.com/phonostar/PhoneGap-SoftKeyboard.git
2.Include the JavaScript wrapper:
Place a copy of softkeyboard.js from here in your application(e.g., in www/scripts/plugins and include it in your HTML files as needed; e.g.
<script src="scripts/plugins/softkeyboard.js"></script>
3.Reference the plugin in your Android configuration:
Add the following line to your www/config.android.xml file as a child element to the cordova/plugins element of your project:
<plugin name="SoftKeyboardPlugin" value="net.same2u.phonegap.plugin.SoftKeyboard" onload="true"/>
4.You can use the plugin as per your need by the following code:
if (device.platform === 'Android') { // Be sure to only call on Android devices.
plugins.softKeyboard.show(function () {
// success
},function (errDescr) {
// fail
});
}
0 Comment(s)