surfaceview

Textureview/Surface view for Camera preview - Android

佐手、 提交于 2021-02-11 05:12:41
问题 I am working on developing an Android applications that uses camera. To display the camera preview, I observed a lot of examples using surface view or texture view. Why are these preferred over using ImageView to display the camera preview? I have used Imageview to display the preview and it works fine. Thanks. 回答1: Please do not use ImageView for this. It is extremely inefficient, and I'd be surprised if you are able to produce high-resolution preview (1080p) with this approach. SurfaceView

Textureview/Surface view for Camera preview - Android

本秂侑毒 提交于 2021-02-11 05:09:31
问题 I am working on developing an Android applications that uses camera. To display the camera preview, I observed a lot of examples using surface view or texture view. Why are these preferred over using ImageView to display the camera preview? I have used Imageview to display the preview and it works fine. Thanks. 回答1: Please do not use ImageView for this. It is extremely inefficient, and I'd be surprised if you are able to produce high-resolution preview (1080p) with this approach. SurfaceView

Textureview/Surface view for Camera preview - Android

大兔子大兔子 提交于 2021-02-11 05:09:13
问题 I am working on developing an Android applications that uses camera. To display the camera preview, I observed a lot of examples using surface view or texture view. Why are these preferred over using ImageView to display the camera preview? I have used Imageview to display the preview and it works fine. Thanks. 回答1: Please do not use ImageView for this. It is extremely inefficient, and I'd be surprised if you are able to produce high-resolution preview (1080p) with this approach. SurfaceView

How to implement double tap for surface view in android

前提是你 提交于 2021-02-04 12:27:05
问题 Please tell how to implement double tap for SurfaceView in Android using gesture detector. Can anybody provide code example? 回答1: You could try following.. actually i tested this and it works pretty well: 1) Extend GestureDetector.SimpleOnGestureListener and override it's onDoubleTap() method: class DoubleTapGestureDetector extends GestureDetector.SimpleOnGestureListener { @Override public boolean onDoubleTap(MotionEvent e) { Log.d("TAG", "Double Tap Detected ..."); return true; } } 2)

Creating canvas on top of SurfaceView android

前提是你 提交于 2021-01-29 20:08:49
问题 I am trying to create canvas like the below image on the top SurfaceView using which i will open the camera This rectangular canvas should support every screen size in android and should be at center_vertical and center_horizontal of the screen with rest of the screen as translucent black as displayed in the image. I am very new with Canvas and have tried this: Java: package com.example.cameraapplication; import android.content.Context; import android.graphics.Canvas; import android.graphics

How to record SurfaceView preview

老子叫甜甜 提交于 2021-01-29 14:55:52
问题 I am working on an app in which I am using Surface View only for preview of frames. Can anyone tell me how can I record videos of this SurfaceView preview? 回答1: You have 3 possibilities : 1 - Capture each frame of your SurfaceView and store all the captured bitmaps into an array, after that you can encode it to a video file using MediaRecord Here's a full example of how it works : ViewRecorder 2 - Using EZFilter (I've already tested) , It's a little long but it's worth a try : XML :

Android VirtualDisplay.release() not releasing the display

二次信任 提交于 2021-01-28 04:11:01
问题 I'm using android MediaProjection for taking screenshot. The projection needs to be stopped after taking screenshot and virtual display should be released but VirtualDisplay.release() is not releasing the display. Here is the code to create display. startActivityForResult(mProjectionManager.createScreenCaptureIntent(), REQUEST_CODE); @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE) { sMediaProjection =

ANR internal function on some devices

谁都会走 提交于 2021-01-28 03:02:44
问题 I've got a app which uses a surfaceview for displaying the UI. The app runs stable for about 18k users but there are 3 devices that get an ANR when returning to the surfaceview activity (sv activity->regular activity->back to sv activity). The 3 devices are: Onda Tablet (Allwinner A31 Chipset) Sero 8 (Rockchip chipset) Acer 10" Tablet with Intel Atom I tried to recreate the ANR but failed. According to my users the app runs fine for hours without any problems except for the devices listed

VideoView vs SurfaceView - Android

岁酱吖の 提交于 2020-12-13 07:21:17
问题 I am going to create InApp Video player which will play the videos from our content server and will also support live streaming. Previously was using third party API. I am confused about going with SurfaceView or VideoView as I have read that VideoView has more lines of code and will be less efficient. Help needed regarding from where should I start? Also need clarity between both. Yes, I have gone through some questions but still confused. Thank you in Advance. 回答1: Frankly Speaking,