- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am a complete noob.
I am trying to create a camera plugin following this example: https://www.youtube.com/watch?v=nGuHwzqJI2Y, of geolocation.
I've basically done the same, i.e. copy and past the code containing the functions underneath the code for the button, and the part containing the navigator stuff at 'your code goes here'
I've tried both seperately in the example here: https://github.com/apache/cordova-plugin-camera,
and when I go to apppreview nothing happens when i press the button,
I have no idea what to do.
Any help greatly appreciated,
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please build your application using build tab. It has plugin so it cannot be tested by either app preview or emulator. Build the project, email it to yourself and install the project from the link which is in the email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Amrita C. (Intel) wrote:
Hello,
Please build your application using build tab. It has plugin so it cannot be tested by either app preview or emulator. Build the project, email it to yourself and install the project from the link which is in the email.
Thanks very much for your reply.
Insight of https://software.intel.com/en-us/forums/topic/560058, and other information online, I thought that cordova plugins were included in apppreview, and that it was only third party plugins that you needed to build the app for.
Will build the app and give it a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure why Amrita gave the advice that was given; it was in error. As you noted, the "included plugins", of which the camera plug-in you referenced, are available via AppPreview for on-device debugging. In the past, there was also some behavior implemented for this in the emulator (i.e. a call to the camera)
I actually just verified it myself as well, invocation of "navigator.camera.getPicture" works just fine in App Preview via USB debugging.
Whatever problem you are having, it is presumably related to how it is being invoked. If you are doing the on-device debugging (i.e. with a device connected via USB to the machine running the XDK, you may be able to use the debugger, or even some console.log messages to see what is or isn't going on).
You might also want to mention what device you are trying to target (iOS or Android EDIT: I see you mention Android in your last comment). My experience is limited, but I have found accessing the iOS camera via the plugin to be less reliable than on Android. Dialing back the desired image quality often seemed to help. However, even on iOS, one could see "something" was happening - it's just that usually the "something" would involve crashing out of the app! :-D
I would first double check the simple explanation for why you're not seeing the camera get triggered, for example adding an "alert" before invoking the camera just to make certain this isn't a simple issue like not having the event handler wired to the button due to a typo somewhere as well as double-checking that the Camera plugin is indeed checked in the included plugins list in your project, just as a sanity check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Sara,
As Barry mentioned the camera plugin should work for you on App Preview and with built app. We have a sample camera app under Projects > samples and demo > General > HTML5+Cordova. Please try that and let us know if it does not work with App Preview or on device. In emulator you will be asked select a file when you try to capture an image (for obvious reasons).
Swati
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Sara,
I installed the same application following exactly the youtube video and it works at least on the emulator.

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