gitawego / cordova-screenshot Goto Github PK
View Code? Open in Web Editor NEWscreenshot plugin for cordova/phonegap
License: Other
screenshot plugin for cordova/phonegap
License: Other
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.
Here's the updates to Screenshot.m to get a callback for iOS with the filepath.
//
// 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
//
@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]];
}
How do you delete the screenshot - eg I took a screen shot sent it to server now want to remove from device?
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...
How can i get the screen shot of a particular portion of a view with their id?
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 ? :(
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?
How are duplicated file names handled? Currently on iOS it seems as the plugin just stops working without throwing any errors.
Like the title says, can I create a screenshot outside the app, so I can take a screenshot of my homescreen for example?
Hi to all,
is there the possibility to rescan media file to show the new screenshots into gallery ?
Thanks.
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 :-)
I am trying to use the code but I am not able to see the image in the Photo Gallery in iOS.
Is there any procedure to attach the taken screenshot with my email account.
according to this
http://phonegap.com/blog/2015/05/26/npm-plugins-available/
http://cordova.apache.org/announcements/2015/04/21/plugins-release-and-move-to-npm.html
so...just want to inform you that your plugin should be move to npm in the future...
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.
Seeing an issue in iOS 8.0.2 on an iPad Air. Latest build of phonegap/cordova and cordova-screenshot plugin.
Despite the device being in landscape mode, the screenshot is in portrait.
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
</script>
</head>
<body>
<button onClick="CallMe()">Click message</button>
</body>
Because I always screenshot main CordovaWebview.
Is it possible screenshot inappbrowser?
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
/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
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.
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
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]];
}
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
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!
Hello, I need to get the Data URI when i take a screenshot. Is it possible ? If no, will you add this feature ?
Not able to see the screenshot which is taken in iOS 7.
How can i fetch the pictures.
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
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?
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.?
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:
Does the plugin actually take a screenshot, or is it doing something different?
Thanks
Has this ever been submitted to Phonegap Build? It would be great to use with that service.
Would it be possible to have the plugin return a path to the saved image? I think this would be very useful, especially when integrating with other plugins, as highlighted here: EddyVerbruggen/SocialSharing-PhoneGap-Plugin#92
It's possible to get the base 64 data instead of save to storage?
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.
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.
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
});
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.
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?
Hi,
not working for me in Cordova 3.1 on Android.
Error in Screenshot.java on lines 50,53,59
Why ? :)
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)
What should I do to install this plugin?
Thank you,
Thin Nguyen
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)
]
Hi all;
is this production ready for ios6+ and android 2+ (i see its v0.1.0)?
thanks.
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.
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.
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
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.
Hi,
Where in iOS are the pictures stored?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.