This is a migrated thread and some comments may be shown as answers.

Create Screenshot on Android

3 Answers 105 Views
Show your code
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stoyan
Top achievements
Rank 1
Stoyan asked on 02 Apr 2015, 09:11 AM
Hello All,
Please tell me how to capture Android phone screen and save it to file on phone storage?
Natively in HTML5 do not have such feature.
I test it with toDataURL, but is not working.
I'm using AppBuilder for Windows and trying to do it in Javascript.

Best regards,

Stoyan

3 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 07 Apr 2015, 06:57 AM
Hello Stoyan,

You can consider using a custom plugin like this one to capture and save a screenshot on an Android device:
cordova-screenshot

To see how to import a custom plugin in AppBuilder, check this article:
Import Custom Plugins

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Stoyan
Top achievements
Rank 1
answered on 07 Apr 2015, 07:18 AM

Hello Tsvetina,

After plugin import, do I need to declare it injavascript section like that:

    <body onLoad="initialise()">
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="Plugins/Screenshot.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
        <script type="text/javascript" src="js/main.js"></script>

or do not need?

Best regards,

 

Stoyan

0
Accepted
Tsvetina
Telerik team
answered on 07 Apr 2015, 09:21 AM
Hello Stoyan,

When plugin.xml contains this js-module declaration:
<js-module src="www/Screenshot.js" name="screenshot">
    <merges target="navigator.screenshot" />
</js-module>

you should be able to use the plugin without referencing the js file in index.html.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Show your code
Asked by
Stoyan
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Stoyan
Top achievements
Rank 1
Share this question
or