2012-12-14 2 views
1

안드로이드 폰의 카메라가 최소화되면 (예 : 새 애플리케이션을 시작할 때) 안드로이드 폰의 카메라 작동이 멈 춥니 다. 제 질문은 : 안드로이드 카메라로 앱을 만들 수있는 방법이 있습니까? 안드로이드 카메라를 최소화하는 경우에도 기록을 남기므로 휴대 전화에서 뭔가 다른 일을하는 동안 동영상을 녹화 할 수 있습니까? 아니면 MediaStore를 사용하지 않고 카메라를 만들면 가능합니까? 나를 도울 수있는 링크 나 코드를 공유하면 감사하겠습니다. 미리 감사드립니다.최소화 후 안드로이드 카메라 작동

답변

1

나는 하나 https://developer.android.com/reference/android/hardware/Camera.html에서

public final void setPreviewTexture (SurfaceTexture surfaceTexture) 

Added in API level 11 
Sets the SurfaceTexture to be used for live preview. 
Either a surface or surface texture is necessary for preview, 
and preview is necessary to take pictures. 

를 사용해야 이에 대한 대답은 생각합니다. 그리고 https://developer.android.com/reference/android/graphics/SurfaceTexture.html에서 :

The image stream may come from either camera preview or video decode. 
A SurfaceTexture may be used in place of a SurfaceHolder when specifying the 
output destination of a Camera or MediaPlayer object. Doing so will cause all the 
frames from the image stream to be sent to the SurfaceTexture object rather than 
to the device's display. 

내가 정말이 시도하고 몇 가지 코드를 전송하고 싶습니다,하지만 난 진저 이하 전화는 최근이 있고, 이것은 벌집 도입되었습니다. 활동이 최소화 될 때 이상한 전화가 절전 넣을 때가 아니라, 비록 액티비티와 관련된 surface 사용

surfaceDestroyedonPauseonStop 사이에 언젠가라고 : How SurfaceHolder callbacks are related to Activity lifecycle? 그러나 나는 surfaceTexture이 아닌 희망 이런 식으로 파괴되었습니다.

+0

내 앱으로 카메라를 안드로이드로 시작하면 카메라가 다른 애플리케이션으로 열리기 때문에 내 앱에서 해당 안드로이드 카메라를 제어 할 수 없다는 한 가지 문제가 있습니다. 아니면 내가 간과 할 수도 있습니다. 어떤 아이디어? – user1313236

+0

아, 카메라 앱에 인 텐트를 보내야합니다. 죄송합니다. http://stackoverflow.com/questions/13127914/android-focus-mode-continuous-video-and-capturing-preview-frames에서 github과 같은 완벽한 독립형 녹음 응용 프로그램을 언급했습니다. 나는 표준 카메라 응용 프로그램이 당신이 원하는 것을 할 것이라고 생각하지 않습니다. – emrys57

+0

그래서 내 카메라를 만들어야합니까? 어떤 아이디어를 시작하는 방법? – user1313236