Ionic 2: Cordova is not available. Make sure to include cordova.js or run in a device/simulator (running in emulator)

This is quite late but anyone going through the same problem might benefit from this answer.First try to add browser by running below command ionic platform add browser and then run command ionic run browser. which is the difference between ionic serve and ionic run browser? Ionic serve – runs your app as a website … Read more

Best way to access web camera in Java

I think the project you are looking for is: https://github.com/sarxos/webcam-capture (I’m the author) There is an example working exactly as you’ve described – after it’s run, the window appear where, after you press “Start” button, you can see live image from webcam device and save it to file after you click on “Snapshot” (source code … Read more

Is there a way to ask user for Camera access after they have already denied it on iOS?

After some research it looks like you can’t do what I’d like. Here is the alternative that I coded to pop a dialog and open the Settings app automatically if on iOS 8+. Some notes: Since iOS 10 you need to specify NSCameraUsageDescription key in your Info.plist to be able ask for camera access, otherwise … Read more

How get permission for camera in android.(Specifically Marshmallow)

First check if the user has granted the permission: if (ContextCompat.checkSelfPermission(context, Manifest.permission.CAMERA) == PackageManager.PERMISSION_DENIED) Then, you could use this to request to the user: ActivityCompat.requestPermissions(activity, new String[] {Manifest.permission.CAMERA}, requestCode); And in Marshmallow, it will appear in a dialog

Taking pictures with camera on Android programmatically

Look at following demo code. Here is your XML file for UI, <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” > <Button android:id=”@+id/btnCapture” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Camera” /> </LinearLayout> And here is your Java class file, public class CameraDemoActivity extends Activity { int TAKE_PHOTO_CODE = 0; public static int count = 0; /** Called when the … Read more

Single intent to let user take picture OR pick image from gallery in Android

You can try doing something like this: // … // Within your enclosing Class // … private static final int SELECT_PICTURE = 1; // … Intent pickIntent = new Intent(); pickIntent.setType(“image/*”); pickIntent.setAction(Intent.ACTION_GET_CONTENT); Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); String pickTitle = “Select or take a new Picture”; // Or get from strings.xml Intent chooserIntent = Intent.createChooser(pickIntent, … Read more

Android Camera Intent: how to get full sized photo?

To get full sized camera image you should point camera to save picture in temporary file, like: private URI mImageUri; Intent intent = new Intent(“android.media.action.IMAGE_CAPTURE”); File photo; try { // place where to store camera taken picture photo = this.createTemporaryFile(“picture”, “.jpg”); photo.delete(); } catch(Exception e) { Log.v(TAG, “Can’t create file to take picture!”); Toast.makeText(activity, “Please … Read more

How to draw an overlay on a SurfaceView used by Camera on Android?

SurfaceView probably does not work like a regular View in this regard. Instead, do the following: Put your SurfaceView inside of a FrameLayout or RelativeLayout in your layout XML file, since both of those allow stacking of widgets on the Z-axis Move your drawing logic into a separate custom View class Add an instance of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)