How to set Android camera orientation properly?

From other member and my problem: Camera Rotation issue depend on different Devices and certain Version. Version 1.6: to fix the Rotation Issue, and it is good for most of devices if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { p.set(“orientation”, “portrait”); p.set(“rotation”,90); } if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { p.set(“orientation”, “landscape”); p.set(“rotation”, 90); } Version 2.1: depend on kind … Read more

Android Camera Preview Stretched

I’m using this method -> based on API Demos to get my Preview Size: private Camera.Size getOptimalPreviewSize(List<Camera.Size> sizes, int w, int h) { final double ASPECT_TOLERANCE = 0.1; double targetRatio=(double)h / w; if (sizes == null) return null; Camera.Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; for (Camera.Size size : sizes) … Read more

Error inflating when extending a class

I think I figured out why this wasn’t working. I was only providing a constructor for the case of one parameter ‘context’ when I should have provided a constructor for the two parameter ‘Context, AttributeSet’ case. I also needed to give the constructor(s) public access. Here’s my fix: public class GhostSurfaceCameraView extends SurfaceView implements SurfaceHolder.Callback … Read more

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