iPhone SDK – How to disable the picture preview in UIImagePickerController?

I asked a similar question here My solution was to create a customized view on top of the default UIImagePickerControllerView. I downloaded the example Augmented Reality Then you can use the OverlayView.m and OverlayView.h by adding them to your project: I made the custom picker toolbar, picker and overlayView global so that I can access … Read more

How can I set a website image that will show as preview on Facebook?

1. Include the Open Graph XML namespace extension to your HTML declaration <html xmlns=”http://www.w3.org/1999/xhtml” xmlns:fb=”http://ogp.me/ns/fb#”> 2. Inside your <head></head> use the following meta tag to define the image you want to use <meta property=”og:image” content=”fully_qualified_image_url_here” /> Read more about open graph protocol here. After doing the above, use the Facebook “Object Debugger” if the image … Read more

Converting preview frame to bitmap

Alternatively, if you DO need a bitmap for some reason, and/or want to do this without creating a YUVImage and compressing to JPEG, you can use the handy RenderScript ‘ScriptIntrinsicYuvToRGB’ (API 17+): @Override public void onPreviewFrame(byte[] data, Camera camera) { Bitmap bitmap = Bitmap.createBitmap(r.width(), r.height(), Bitmap.Config.ARGB_8888); Allocation bmData = renderScriptNV21ToRGBA8888( mContext, r.width(), r.height(), data); bmData.copyTo(bitmap); … Read more

Camera preview image data processing with Android L and Camera2 API

Combining a few answers into a more digestible one because @VP’s answer, while technically clear, is difficult to understand if it’s your first time moving from Camera to Camera2: Using https://github.com/googlesamples/android-Camera2Basic as a starting point, modify the following: In createCameraPreviewSession() init a new Surface from mImageReader Surface mImageSurface = mImageReader.getSurface(); Add that new surface as … Read more

How to WhiteList app in Doze mode Android 6.0

Add permission <uses-permission android:name=”android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS”/> request whitelist your app if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Intent intent = new Intent(); String packageName = getPackageName(); PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE); if (!pm.isIgnoringBatteryOptimizations(packageName)) { intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); intent.setData(Uri.parse(“package:” + packageName)); startActivity(intent); } }

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