Create Screenshot on Android

4 posts, 2 answers
  1. Stoyan
    Stoyan avatar
    2 posts
    Member since:
    Apr 2015

    Posted 02 Apr 2015 Link to this post

    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
  2. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 07 Apr 2015 Link to this post

    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.

     
  3. Stoyan
    Stoyan avatar
    2 posts
    Member since:
    Apr 2015

    Posted 07 Apr 2015 in reply to Tsvetina Link to this post

    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

  4. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 07 Apr 2015 Link to this post

    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.

     
Back to Top