Giter VIP home page Giter VIP logo

cordova-screenshot's People

Contributors

aik9508 avatar anthonytsang-etx avatar brunohnq avatar bryant1410 avatar dpa99c avatar eddyverbruggen avatar fujunwei avatar gabrielecirulli avatar gitawego avatar halilbilgin avatar heyl0822 avatar ismaeldcom avatar macdonst avatar mikowals avatar r0b1n avatar roblav96 avatar tbassett44 avatar tony-- avatar tripodsan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-screenshot's Issues

Error in Cordova 3.6.3 +

/Plugins/com.darktalker.cordova.screenshot/Screenshot.m:71:38: 'toSuccessCallbackString:' is deprecated: Deprecated in Cordova 3.6. Use the CDVCommandDelegate method sendPluginResult:callbackId instead. This will be removed in 4.0.0

How can I fix it please help

plugin not work with crosswalk. "org.crosswalk.engine.XwalkCordovaWebView can not be cast to ViewGroup"

Hi, after update my ionic project from using native webview to crosswalk. The plugins can't not be built
(error on line 76 because the plugin can not detected my currently ionic is running on crosswalk).

I played around with the screenshot.java, replace the getBitmap function with this:
private Bitmap getBitmap() {
Bitmap bitmap = null;

    boolean isCrosswalk = true;
    TextureView textureView = findXWalkTextureView((ViewGroup)webView);
            bitmap = textureView.getBitmap();

    return bitmap;
}

Now, the project can be built successfully. But when i capture a screen, an error raised:
"org.crosswalk.engine.XwalkCordovaWebView can not be cast to ViewGroup"

My crosswalk version is 13.41.318.0 , publish at 3-11-2015.

Please talk a look at this.

/sdcard/Pictures for android

How about when there's no sdcard?
I am using .URI for now, but the problem is it crashes a lot since the new phones take high resolution pictures with many Megabytes and Android phones tend to be very low on available memory.

Any hint?

P.S: Thanks a lot for the plugin!

License?

Please add a license file or state the license in the README.md. I'd love to use this ;) MIT or Apache 2 would be great.

Return image as Base64 string

Would it be possible to return the image using returnBase64 instead of saving image to library? I would really appreciate this feature. I have an older version/variation of this plugin that had this feature that you can see here: https://github.com/adrian3/cordova-save-screenshot

Update: I misunderstood how this plugin worked. I thought it was saving the screenshot to the photo library. Instead it saves the image within the app. So if anyone is needing a string instead of an image, you can use Javascript to convert the local image. If you need to save the screenshot to the photo library, I had success with the Canvas2ImagePlugin.

Screenshot in iOS isn't a real screenshot

I'm trying to write an application for applying a door on a environment, and I have to "attach" the door on the background. With canvas I have some problems so I decided to try with a screenshot, it works on Android but not on iOS.
As you can see in the images, if I use your plugin the door is not deformed, but if I take a screenshot with iPad's physical buttons it works (the door is a img html).
My question is: are there other ways in Objective-C for taking the screenshot? I searched on Google but I haven't found anything (and I'm not good with Objective-C).
Thanks.

image-1
img_0095

not working :(

Hi,

i'm trying your plugin but i have this error:

ERROR: Method 'saveScreenshot:' not defined in Plugin 'Screenshot'
[61094:70b] -[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [
"Screenshot1928587281",
"Screenshot",
"saveScreenshot",
[
"png",
100
]
]

why ? :(

Non working for me

Hi,

not working for me in Cordova 3.1 on Android.

Error in Screenshot.java on lines 50,53,59

Why ? :)

how to save images in Albums in iphone

Hi gitawego,

in android images save in pictures folde,But in iPhone screenshot images not appear in camera role (albums) how to save images in Camera albums in iPhone.Now i am using iPhone 5 ,cordova 3.5

Rescan media after save

Hi to all,

is there the possibility to rescan media file to show the new screenshots into gallery ?

Thanks.

production ready?

Hi all;
is this production ready for ios6+ and android 2+ (i see its v0.1.0)?
thanks.

Orientation Problem

I am using the app in landscape mode on iPad Air but the screenshot is returned in portrait mode. My app is designed to be used in Landscape only. However, I can see the condition in there in the Screenshot.m file but its not working. Kindly refer to the screenshot attached.
screenshot_1426056553949

Adding file callback for iOS

Here's the updates to Screenshot.m to get a callback for iOS with the filepath.

  • added a callback function for iOS that saves that returns the resulting file
  • file is always stored in tmp folder
  • added third command line argument, which allows you to specify a filename
  • the jpeg quality parameter wasn't being used so added that back in

//
// Screenshot.h
//
// Created by Simon Madine on 29/04/2010.
// Copyright 2010 The Angry Robot Zombie Factory.
// - Converted to Cordova 1.6.1 by Josemando Sobral.
// MIT licensed
//
// Modifications to support orientation change by @ffd8
//

import <Cordova/CDV.h>

import "Screenshot.h"

@implementation Screenshot

@synthesize webView;

//- (void)saveScreenshot:(NSArray_)arguments withDict:(NSDictionary_)options

  • (void)saveScreenshot:(CDVInvokedUrlCommand*)command
    {
    NSString *filename = [command.arguments objectAtIndex:2];
    NSNumber *quality = [command.arguments objectAtIndex:1];
    NSString *path = [NSString stringWithFormat:@"%@",filename];

    NSString *jpgPath = [NSTemporaryDirectory() stringByAppendingPathComponent:path ];

    CGRect imageRect;
    CGRect screenRect = [[UIScreen mainScreen] bounds];

    // statusBarOrientation is more reliable than UIDevice.orientation
    UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;

    if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
    // landscape check
    imageRect = CGRectMake(0, 0, CGRectGetHeight(screenRect), CGRectGetWidth(screenRect));
    } else {
    // portrait check
    imageRect = CGRectMake(0, 0, CGRectGetWidth(screenRect), CGRectGetHeight(screenRect));
    }

    // Adds support for Retina Display. Code reverts back to original if iOs 4 not detected.
    if (NULL != UIGraphicsBeginImageContextWithOptions)
    UIGraphicsBeginImageContextWithOptions(imageRect.size, NO, 0);
    else
    UIGraphicsBeginImageContext(imageRect.size);

    CGContextRef ctx = UIGraphicsGetCurrentContext();
    [[UIColor blackColor] set];
    CGContextTranslateCTM(ctx, 0, 0);
    CGContextFillRect(ctx, imageRect);

    [webView.layer renderInContext:ctx];

    UIImage image = UIGraphicsGetImageFromCurrentImageContext();
    NSData
    imageData = UIImageJPEGRepresentation(image,[quality floatValue]);
    [imageData writeToFile:jpgPath atomically:NO];

    UIGraphicsEndImageContext();

    CDVPluginResult* pluginResult = nil;
    NSDictionary *jsonObj = [ [NSDictionary alloc]
    initWithObjectsAndKeys :
    jpgPath, @"filePath",
    @"true", @"success",
    nil
    ];

    pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:jsonObj];
    [self writeJavascript:[pluginResult toSuccessCallbackString:command.callbackId]];

}

@EnD

Plugin not working on android build

Hello, with ios build it's ok.
But with android build return

-compile:
    [javac] Compiling 3 source files to /Users/.../.../Weather/Proyecto/Que Onda/platforms/android/ant-build/classes
    [javac] /Users/.../.../Weather/Proyecto/Que Onda/platforms/android/src/com/darktalker/cordova/screenshot/Screenshot.java:71: cannot find symbol
    [javac] symbol  : method getView()
    [javac] location: class org.apache.cordova.CordovaWebView
    [javac]                 TextureView textureView = findXWalkTextureView((ViewGroup)webView.getView());
    [javac]                                                                                  ^
    [javac] 1 error

BUILD FAILED
/Users/.../XXX/Android SDK/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/.../XXX/Android SDK/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 2 seconds

/Users/.../.../Weather/Proyecto/Que Onda/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: ant with args: debug,-f,/Users/.../.../Weather/Proyecto/Que Onda/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
ERROR building one of the platforms: Error: /Users/.../.../Weather/Proyecto/Que Onda/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project

After cordova plugin rm com.darktalker.cordova.screenshot it works again.

Ideas?

Image missing file extension

Hi

I'm using this extension in iOS on cordova 3.4.1

I'm able to save a screen shot and i get the filePath as below - but when i try and add this to an email its missing the extension or has a .dat file extension.

I've tried adding .jpg to the end but that does not work either.
This is what i'm getting back...
{"success":"true","filePath":"/private/var/mobile/Applications/D3A4511E-A50A-4914-AF1A-6C989FC15EED/tmp/myScreenshot"}

navigator.screenshot.save(function (error, res) {
if (error) {
console.log(error);
} else {
console.log('ok' + res.filePath);
console.log(res);
}
}, 'jpg', 50, 'myScreenshot' ); //

Thanks
John

handling of duplicated files

How are duplicated file names handled? Currently on iOS it seems as the plugin just stops working without throwing any errors.

Delete screenshot iOS

How do you delete the screenshot - eg I took a screen shot sent it to server now want to remove from device?

Screenshot not working

Hi, Actually when I install the plugin and run the code on my device screenshot is working fine.

But then I check-in the code on github and than my manager takes the code from github by checkout and then try to use the screenshot but it not works and this same also happens with me when I pull the new code from github screenshot does'nt work.

Can you please help me in this.?

Anyone here who is using this plugin ? Need help

Hello,

I am trying to use this plugin in iOS 7.1 but I am not able to see any filepath neither I am able to see error. Can you please help me to use this plugin

Below is my code sample


<title>Ringside</title> <script type="text/javascript" charset="utf-8" src="js/cordova.js"></script> <script> //Calling screenshot function function CallMe(){ navigator.screenshot.save(function(error,res){ if(error){ alert(error); }else{ alert('ok',res.filePath); } },'jpg',50,'myScreenShot'); }
    </script>
</head>
<body>

    <button onClick="CallMe()">Click message</button>
</body>

base64

It's possible to get the base 64 data instead of save to storage?

Can't add cordova-screenshot plugin

Hi,

I have a problem while installing this plugin.

$ cordova plugin add com.darktalker.cordova.screenshot
Fetching plugin "com.darktalker.cordova.screenshot" via cordova plugins registry

npm http GET http://registry.cordova.io/com.darktalker.cordova.screenshot
npm http 404 http://registry.cordova.io/com.darktalker.cordova.screenshot
Fetching from cordova plugins registry failed: 404 Not Found: com.darktalker.cor
dova.screenshot
Fetching plugin "com.darktalker.cordova.screenshot" via npm
npm http GET https://registry.npmjs.org/com.darktalker.cordova.screenshot
npm http 404 https://registry.npmjs.org/com.darktalker.cordova.screenshot
Fetching from npm failed: 404 Not Found: com.darktalker.cordova.screenshot
Error: 404 Not Found: com.darktalker.cordova.screenshot
    at RegClient.<anonymous> (c:\Users\DRAGON223\AppData\Roaming\npm\node_module
s\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\npm-registry-cl
ient\lib\request.js:268:14)
    at Request.self.callback (c:\Users\DRAGON223\AppData\Roaming\npm\node_module
s\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.j
s:148:22)
    at Request.emit (events.js:98:17)
    at Request.<anonymous> (c:\Users\DRAGON223\AppData\Roaming\npm\node_modules\
cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:
876:14)
    at Request.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (c:\Users\DRAGON223\AppData\Roaming\npm\node_
modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\i
ndex.js:827:12)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:944:16
    at process._tickCallback (node.js:442:13)
Cordova version: 5.1.1
Installed platforms: android 4.0.2

What should I do to install this plugin?

Thank you,
Thin Nguyen

On-screen pixels not captured

My app uses css transforms to show navigation to a detail page from the home screen. The screenshot plugin does not capture on-screen pixels when the detail screen is displayed. It always captures the home screen.

So:

  1. From home screen, tap menu item. App transitions to detail screen via css transform.
  2. Take screenshot using plugin
    Expected: Screenshot should be an image of the detail screen
    Actual: Screenshot is an image of the home screen

Does the plugin actually take a screenshot, or is it doing something different?

Thanks

Capturing Video in an iFrame

I have a Cordova/Android app that plays youtube videos in an iframe. When I take a screenshot of the screen that is currently playing the video everything is captured except the current video frame, which is replaced with a BLACK area. Please help.

It is not working in Cordova iOS Platform 3.8.0

I am trying to use the plugin in OS Platform 3.8.0 but it is giving me an ERROR: Plugin 'Screenshot' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml
[CDVCommandQueue executePending] [Line 159] FAILED pluginJSON = ["Screenshot1570436602","Screenshot","saveScreenshot",["jpg",50,"myScreenShot"]]

Can you please tell me the solution so that I can solve the problem, Thank you

File path in iOS 7.

Not able to see the screenshot which is taken in iOS 7.

How can i fetch the pictures.

iOS 7.0

Hi,
Where in iOS are the pictures stored?

iOS return URI

Hi, great plugin... i saw that iOS did not have URI, this was what i needed for bot android and iOS... not saying this is perfect (not an objective c type but can play), but it works great for me for URI.

in Screenshot.h

  • (void)getScreenshotAsURI:(CDVInvokedUrlCommand*)command;

in Screenshot.m

  • (void)getScreenshotAsURI:(CDVInvokedUrlCommand*)command
    {

    CGRect imageRect;
    CGRect screenRect = [[UIScreen mainScreen] bounds];

    // statusBarOrientation is more reliable than UIDevice.orientation
    UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;

    if (([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)) {
    if (orientation != UIInterfaceOrientationLandscapeLeft && orientation != UIInterfaceOrientationLandscapeRight) {
    // landscape check
    imageRect = CGRectMake(0, 0, CGRectGetWidth(screenRect), CGRectGetHeight(screenRect));
    } else {
    // portrait check
    imageRect = CGRectMake(0, 0, CGRectGetWidth(screenRect), CGRectGetHeight(screenRect));
    }

    } else {
    if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
    // landscape check
    imageRect = CGRectMake(0, 0, CGRectGetHeight(screenRect), CGRectGetWidth(screenRect));
    } else {
    // portrait check
    imageRect = CGRectMake(0, 0, CGRectGetWidth(screenRect), CGRectGetHeight(screenRect));
    }
    }

    // Adds support for Retina Display. Code reverts back to original if iOs 4 not detected.
    if (NULL != UIGraphicsBeginImageContextWithOptions)
    UIGraphicsBeginImageContextWithOptions(imageRect.size, NO, 0);
    else
    UIGraphicsBeginImageContext(imageRect.size);

    CGContextRef ctx = UIGraphicsGetCurrentContext();
    [[UIColor blackColor] set];
    CGContextTranslateCTM(ctx, 0, 0);
    CGContextFillRect(ctx, imageRect);

    if ([webView respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) {
    [webView drawViewHierarchyInRect:webView.bounds afterScreenUpdates:YES];
    } else {
    [webView.layer renderInContext:ctx];
    }

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

    NSString* imageData = [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];

    UIGraphicsEndImageContext();

    CDVPluginResult* pluginResult = nil;

    NSDictionary *jsonObj = [ [NSDictionary alloc] initWithObjectsAndKeys : imageData, @"URI", @"true", @"success", nil ];

    pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:jsonObj];

    [self writeJavascript:[pluginResult toSuccessCallbackString:command.callbackId]];

}

Error using a inAppBrowser

It seems that it doesn't take screenshots from the inAppBrowser when its open.
It takes instead a screenshot of the app that is behind the opened inAppBrwoser...

Help!

I am not able to get the photo back. I checked your read me but I am not able to achieve it.

What i am trying to do is take a screenshot of the current event and share it on FB or Twitter.

If possible can you please help me in achieving this.

Take screenshot of user home screen

Hi,
I'm trying to modify the Screenshoot.java to capture the user home screen instead of appView screen when the app runs in background.

After some research, I have tried to change the code:
View view = webView.getRootView();

to code:
View view = getWindow().getDecorView().getRootView();

but it gives an error that method getWindow() can not found even after: import android.view.Window;

Then I changed the code to:
View view = cordova.getActivity().getWindow().getDecorView().getRootView();

The above code compiles but still captures the app screen even if it's running in background and not the user home screen.

Can you pls, help me to figure out how to get the "view" of user home screen instead of app screen?

Regards.

This plugin is compatible with Windows Phone 8.1 ?

Hi,
I am going to use this plugin for windows phone 8.1 I just want to know that if this plugin is compatible with 8.1 or it is still 8 ?

If not can you please update this plugin accordingly

Thanks.

Moving iOS screenshot

Currently I am able to take a screenshot and move the file to another directory on Android perfectly using the Phonegap File API. I do this because I wish I store this file for later use in my app.
However I am find this extremely difficult to do on iOS as I cannot obtain a valid FileEntry of this image in the default tmp folder. (Maybe you could offer developers the choice of where this could be stored?).
Is there a method you could recommend in doing this?

Build fails after adding plugin

Hello.

After adding your plugin my android build fails and I cannot build new applications until I remove the plugin again.

Here is my log:

cordova run android --verbose
cordova library for "android" already exists. No need to download. Continuing.
Generating config.xml from defaults for platform "android"
Calling plugman.prepare for platform "android"
Preparing android project
Processing configuration changes for plugins.
Iterating over installed plugins: [ 'org.apache.cordova.console',
  'org.apache.cordova.device',
  'org.apache.cordova.dialogs',
  'org.apache.cordova.file',
  'org.apache.cordova.geolocation',
  'org.apache.cordova.network-information',
  'org.apache.cordova.splashscreen',
  'org.apache.cordova.file-transfer',
  'org.apache.cordova.inappbrowser',
  'com.smartmobilesoftware.inappbilling',
  'cc.fovea.plugins.inapppurchase',
  'com.phonegap.plugins.OrientationLock',
  'de.appplant.cordova.plugin.local-notification',
  'com.ququplay.websocket.WebSocket',
  'org.apache.cordova.globalization',
  'de.appplant.cordova.plugin.background-mode',
  'org.apache.cordova.vibration',
  'nl.x-services.plugins.socialsharing',
  'com.phonegap.plugins.facebookconnect',
  'com.aquto.cordova.AppleAdvertising',
  'com.liyamahendra.cordova.plugins.flurry',
  'com.liyamahendra.cordova.plugins.playhaven',
  'org.apache.cordova.screenshot' ]
Writing out cordova_plugins.js...
Ensuring plugin "cc.fovea.plugins.inapppurchase" is installed correctly...
Plugin "cc.fovea.plugins.inapppurchase" is good to go.
Ensuring plugin "com.aquto.cordova.AppleAdvertising" is installed correctly...
Plugin "com.aquto.cordova.AppleAdvertising" is good to go.
Ensuring plugin "com.liyamahendra.cordova.plugins.flurry" is installed correctly...
Plugin "com.liyamahendra.cordova.plugins.flurry" is good to go.
Ensuring plugin "com.liyamahendra.cordova.plugins.playhaven" is installed correctly...
Plugin "com.liyamahendra.cordova.plugins.playhaven" is good to go.
Ensuring plugin "com.phonegap.plugins.OrientationLock" is installed correctly...
Plugin "com.phonegap.plugins.OrientationLock" is good to go.
Ensuring plugin "com.phonegap.plugins.facebookconnect" is installed correctly...
Plugin "com.phonegap.plugins.facebookconnect" is good to go.
Ensuring plugin "com.ququplay.websocket.WebSocket" is installed correctly...
Plugin "com.ququplay.websocket.WebSocket" is good to go.
Ensuring plugin "com.smartmobilesoftware.inappbilling" is installed correctly...
Plugin "com.smartmobilesoftware.inappbilling" is good to go.
Ensuring plugin "de.appplant.cordova.plugin.background-mode" is installed correctly...
Plugin "de.appplant.cordova.plugin.background-mode" is good to go.
Ensuring plugin "de.appplant.cordova.plugin.local-notification" is installed correctly...
Plugin "de.appplant.cordova.plugin.local-notification" is good to go.
Ensuring plugin "nl.x-services.plugins.socialsharing" is installed correctly...
Plugin "nl.x-services.plugins.socialsharing" is good to go.
Ensuring plugin "org.apache.cordova.console" is installed correctly...
Plugin "org.apache.cordova.console" is good to go.
Ensuring plugin "org.apache.cordova.device" is installed correctly...
Plugin "org.apache.cordova.device" is good to go.
Ensuring plugin "org.apache.cordova.dialogs" is installed correctly...
Plugin "org.apache.cordova.dialogs" is good to go.
Ensuring plugin "org.apache.cordova.file" is installed correctly...
Plugin "org.apache.cordova.file" is good to go.
Ensuring plugin "org.apache.cordova.file-transfer" is installed correctly...
Plugin "org.apache.cordova.file-transfer" is good to go.
Ensuring plugin "org.apache.cordova.geolocation" is installed correctly...
Plugin "org.apache.cordova.geolocation" is good to go.
Ensuring plugin "org.apache.cordova.globalization" is installed correctly...
Plugin "org.apache.cordova.globalization" is good to go.
Ensuring plugin "org.apache.cordova.inappbrowser" is installed correctly...
Plugin "org.apache.cordova.inappbrowser" is good to go.
Ensuring plugin "org.apache.cordova.network-information" is installed correctly...
Plugin "org.apache.cordova.network-information" is good to go.
Ensuring plugin "org.apache.cordova.screenshot" is installed correctly...
Plugin "org.apache.cordova.screenshot" is good to go.
Ensuring plugin "org.apache.cordova.splashscreen" is installed correctly...
Plugin "org.apache.cordova.splashscreen" is good to go.
Ensuring plugin "org.apache.cordova.vibration" is installed correctly...
Plugin "org.apache.cordova.vibration" is good to go.
Wrote out Android application name to "Project 2.0"
Wrote out Android package name to "de.project.app"
Running app on platform "android" via command "/Users/<user>/Project/20/Project/platforms/android/cordova/run" --device
Looks like your environment fully supports cordova-android development!

exec: ant clean -f /Users/<user>/Project/20/Project/platforms/android/build.xml

[ 'ant clean -f /Users/<user>/Project/20/Project/platforms/android/build.xml',
  null,
  'Buildfile: /Users/<user>/Project/20/Project/platforms/android/build.xml\n\n-check-env:\n [checkenv] Android SDK Tools Revision 22.6.2\n [checkenv] Installed at /Users/<user>/.adt\n\n-setup:\n     [echo] Project Name: Project20\n  [gettype] Project Type: Application\n\n-pre-clean:\n\nclean:\n   [delete] Deleting directory /Users/<user>/Project/20/Project/platforms/android/bin\n   [delete] Deleting directory /Users/<user>/Project/20/Project/platforms/android/gen\n[getlibpath] Library dependencies:\n[getlibpath] No Libraries\n   [subant] No sub-builds to iterate on\n\nBUILD SUCCESSFUL\nTotal time: 0 seconds\n',
  '' ]

exec: ant debug -f /Users/<user>/Project/20/Project/platforms/android/build.xml

[ 'ant debug -f /Users/<user>/Project/20/Project/platforms/android/build.xml',
  { [Error: Command failed: 
  BUILD FAILED
  /Users/<user>/.adt/tools/ant/build.xml:720: The following error occurred while executing this line:
  /Users/<user>/.adt/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

  Total time: 2 seconds
  ] killed: false, code: 1, signal: null },
  'Buildfile: /Users/<user>/Project/20/Project/platforms/android/build.xml\n\n-set-mode-check:\n\n-set-debug-files:\n\n-check-env:\n [checkenv] Android SDK Tools Revision 22.6.2\n [checkenv] Installed at /Users/<user>/.adt\n\n-setup:\n     [echo] Project Name: Project20\n  [gettype] Project Type: Application\n\n-set-debug-mode:\n\n-debug-obfuscation-check:\n\n-pre-build:\n\n-build-setup:\n[getbuildtools] Using latest Build Tools: 18.1.0\n     [echo] Resolving Build Target for Project20...\n[gettarget] Project Target:   Android 4.2.2\n[gettarget] API level:        17\n     [echo] ----------\n     [echo] Creating output directories if needed...\n    [mkdir] Created dir: /Users/<user>/Project/20/Project/platforms/android/bin\n    [mkdir] Created dir: /Users/<user>/Project/20/Project/platforms/android/bin/res\n    [mkdir] Created dir: /Users/<user>/Project/20/Project/platforms/android/bin/rsObj\n    [mkdir] Created dir: /Users/<user>/Project/20/Project/platforms/android/bin/rsLibs\n    [mkdir] Created dir: /Users/<user>/Project/20/Project/platforms/android/gen\n    [mkdir] Created dir: /Users/<user>/Project/20/Project/platforms/android/bin/classes\n    [mkdir] Created dir: /Users/<user>/Project/20/Project/platforms/android/bin/dexedLibs\n     [echo] ----------\n     [echo] Resolving Dependencies for Project20...\n[dependency] Library dependencies:\n[dependency] No Libraries\n[dependency] \n[dependency] ------------------\n     [echo] ----------\n     [echo] Building Libraries with \'debug\'...\n   [subant] No sub-builds to iterate on\n\n-code-gen:\n[mergemanifest] Merging AndroidManifest files into one.\n[mergemanifest] Manifest merger disabled. Using project manifest only.\n     [echo] Handling aidl files...\n     [aidl] Found 1 AIDL files.\n     [aidl] Compiling 1 AIDL files.\n     [echo] ----------\n     [echo] Handling RenderScript files...\n     [echo] ----------\n     [echo] Handling Resources...\n     [aapt] Generating resource IDs...\n     [echo] ----------\n     [echo] Handling BuildConfig class...\n[buildconfig] Generating BuildConfig class.\n\n-pre-compile:\n     [echo] Set jars path to: /Users/<user>/Project/20/Project/platforms/android/libs/FlurryAds_3.4.0.jar:/Users/<user>/Project/20/Project/platforms/android/libs/spring-android-core-1.0.1.RELEASE.jar:/Users/<user>/Project/20/Project/platforms/android/libs/android-support-v4.jar:/Users/<user>/Project/20/Project/platforms/android/libs/cordova-3.2.0-rc1.jar:/Users/<user>/Project/20/Project/platforms/android/libs/gcm.jar:/Users/<user>/Project/20/Project/platforms/android/libs/FlurryAnalytics_3.4.0.jar:/Users/<user>/Project/20/Project/platforms/android/libs/json-smart-1.1.1.jar:/Users/<user>/Project/20/Project/platforms/android/libs/spring-android-rest-template-1.0.1.RELEASE.jar:/Users/<user>/Project/20/Project/platforms/android/libs/commons-lang-2.6.jar:/Users/<user>/Project/20/Project/platforms/android/libs/json-path-0.8.1.jar:/Users/<user>/Project/20/Project/platforms/android/libs/java_websocket.jar\n\n-compile:\n    [javac] Compiling 118 source files to /Users/<user>/Project/20/Project/platforms/android/bin/classes\n    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release\n    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release\n    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.\n    [javac] /Users/<user>/Project/20/Project/platforms/android/src/org/apache/cordova/screenshot/Screenshot.java:58: error: no suitable method found for put(String,String)\n    [javac] \t\t\t\t\t\t\tjsonRes.put("filePath",f.getAbsolutePath());\n    [javac] \t\t\t\t\t\t\t       ^\n    [javac]     method JSONArray.put(int,boolean) is not applicable\n    [javac]       (argument mismatch; String cannot be converted to int)\n    [javac]     method JSONArray.put(int,double) is not applicable\n    [javac]       (argument mismatch; String cannot be converted to int)\n    [javac]     method JSONArray.put(int,int) is not applicable\n    [javac]       (argument mismatch; String cannot be converted to int)\n    [javac]     method JSONArray.put(int,long) is not applicable\n    [javac]       (argument mismatch; String cannot be converted to int)\n    [javac]     method JSONArray.put(int,Object) is not applicable\n    [javac]       (argument mismatch; String cannot be converted to int)\n    [javac] Note: Some input files use or override a deprecated API.\n    [javac] Note: Recompile with -Xlint:deprecation for details.\n    [javac] Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output\n    [javac] 1 error\n    [javac] 3 warnings\n',
  '\nBUILD FAILED\n/Users/<user>/.adt/tools/ant/build.xml:720: The following error occurred while executing this line:\n/Users/<user>/.adt/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.\n\nTotal time: 2 seconds\n' ]



/Users/<user>/Project/20/Project/platforms/android/cordova/node_modules/q/q.js:126

                    throw e;

                    ^
Error executing "ant debug -f /Users/<user>/Project/20/Project/platforms/android/build.xml": 
BUILD FAILED
/Users/<user>/.adt/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/<user>/.adt/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 2 seconds


child_process.spawn(/Users/<user>/Project/20/Project/platforms/android/cordova/run,[--device]) = 8
Error: An error occurred while running the android project.
/Users/<user>/Project/20/Project/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error executing "ant debug -f /Users/<user>/Project/20/Project/platforms/android/build.xml": 
BUILD FAILED
/Users/<user>/.adt/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/<user>/.adt/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 2 seconds


    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/run.js:67:22)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Socket.<anonymous> (child_process.js:956:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)
sebastians-mbp:Project <user>$ 
sebastians-mbp:Project <user>$ cordova build ios
Generating config.xml from defaults for platform "ios"
Preparing ios project
Compiling app on platform "ios" via command "/Users/<user>/Project/20/Project/platforms/ios/cordova/build" 
[Error: An error occurred while building the ios project.2014-04-17 15:02:03.482 xcodebuild[43953:4313]  DeveloperPortal: Using pre-existing current store at URL (file:///Users/<user>/Library/Developer/Xcode/DeveloperPortal%205.1.1.db).
2014-04-17 15:02:04.507 xcodebuild[43963:441f]  DeveloperPortal: Using pre-existing current store at URL (file:///Users/<user>/Library/Developer/Xcode/DeveloperPortal%205.1.1.db).
2014-04-17 15:02:05.489 xcodebuild[43973:470b]  DeveloperPortal: Using pre-existing current store at URL (file:///Users/<user>/Library/Developer/Xcode/DeveloperPortal%205.1.1.db).
** BUILD FAILED **


The following build commands failed:
    CompileC build/Project\ 2.0.build/Debug-iphoneos/Project\ 2.0.build/Objects-normal/armv7/Screenshot.o Project\ 2.0/Plugins/org.apache.cordova.screenshot/Screenshot.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
** BUILD FAILED **


The following build commands failed:
    CompileC build/Project\ 2.0.build/Debug-iphonesimulator/Project\ 2.0.build/Objects-normal/i386/Screenshot.o Project\ 2.0/Plugins/org.apache.cordova.screenshot/Screenshot.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
]

How to capture complete screen

I have a html page with some scrollable content, i want to take screenshot/capture whole screen, not only the visible part.

Thanks in advance :-)

Plugin not approved yet?

Hi - your plugin doesn't seem to be found on build.phonegap platform under the 3-rd party plugins.

Have you already sent it for the approval?

trying to work in angularjs

I really need help. I'm using angularjs in my project.

I installed it via cordova add.

I added those angularjs lines at the end of my controller.

Then i use a ng-click to call a function that has

navigator.screenshot.save(function(error,res){
if(error){
console.error(error);
}else{
console.log('ok',res.filePath);
}

nothing happens
});

Plugin slows css transform3d animations

Hi,

First of all, thank you for the plugin. My issue is in the title: the screenshot plugin works as advertised but after the plugin is called, my css transform3d animations are sluggish. I think that this is because of the way that the plugin works with 3d transforms.

Is there any way to clear the 3d transform memory after the plugin is called?

Thank you,
Olivier

publish github releases

Can you please start adding github releases starting with version 0.1.0?
It will make possible to upgrade/downgrade the plugin as needed. For example, I'm having issues with
Cordova 3.6.4 and Crosswalk compilation after getting the newest master. It's ok, but the issue is that I have no means to downgrade to previous version that worked, except maybe local backup. Release after each meaningful and tested update will make such problems less harmful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.