- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to use Device plugin copyToClipboard but it's not working...test on Android. please someone help. Thank You
below is my code
<!DOCTYPE html> <html> <script src="cordova.js" id="xdkJScordova_"></script> <script src="js/app.js"></script> <!-- for your event code, see README and file comments for details --> <script src="js/init-app.js"></script> <!-- for your init code, see README and file comments for details --> <script src="xdk/init-dev.js"></script> <!-- normalizes device and document ready events, see file for details --> <script src="xhr.js"></script> <script type="text/javascript" src="js/SocialSharing.js"></script> <script type="text/javascript"> var onDeviceReady=function(){ // called when Cordova is ready if( window.Cordova && navigator.splashscreen ) { // Cordova API detected navigator.splashscreen.hide() ; // hide splash screen } } ; document.addEventListener("deviceready", onDeviceReady, false) ; </script> <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> </head> <body> <script> function openExternal(elem) { window.open(elem.href, "_system"); return false; // Prevent execution of the default onClick handler } </script> <script> //Test for javascript interface "intel.xdk.device.copyToClipboard()". function copyToClipboard(text){ intel.xdk.device.copyToClipboard(text); } </script> <button onclick="copyToClipboard('hello, world');">copyToClipboard</button> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/base.min.js"></script> </body> </html>
- Tags:
- HTML5
- Intel® XDK
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
urgent.....please help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The intel.xdk.device plugin is being deprecated, so I suggest that you find another Cordova plugin that will do what you are looking for.
That being said, it should work if you have selected that plugin in the project settings-plugins. Is this in App Preview, XDK, or on a built application? What platform?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IntelXDK ....Windows 10 ......Android
its not working,,,and there no other plugins.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I copied your code, built an apk, installed on an S4 running android 5.0.1 and it copied the "hello,world" just fine.
I then opened a browser, and pasted it in. It worked as it should.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page