Questions tagged [surfaceholder]

Abstract interface to someone holding a display surface. Allows you to control the surface size and format, edit the pixels in the surface, and monitor changes to the surface. This interface is typically available through the SurfaceView class.

Abstract interface to someone holding a display surface.
Allows you to control the surface size and format, edit the pixels in the surface, and monitor changes to the surface.
This interface is typically available through the SurfaceView class.

When using this interface from a thread other than the one running its SurfaceView, you will want to carefully read the methods lockCanvas() and Callback.surfaceCreated().

Reference page: http://developer.android.com/reference/android/view/SurfaceHolder.html

175 questions
0
votes
1 answer

SurfaceView on Android 2.3.6 doesn't render full region

In my app I create SurfaceView and use it from NDK using ANativeWindow API: ANativeWindow_lock and then ANativeWindow_unlockAndPost. The size of the surface is set by ANativeWindow_setBuffersGeometry to 320x480. The screen size is bigger -…
Dmitry
  • 2,837
  • 1
  • 30
  • 48
0
votes
1 answer

How to crop the video via the surfaceview/surfaceholder class?

Here is my question: how to crop the video via the surfaceview/surfaceholder class? In my survey, the only way to crop the video is to use the TextureView::setTransform/setLayoutParams, am I right? But there is only one interface working with…
steven
  • 13
  • 4
0
votes
0 answers

Does SurfaceHolder or creating new Thread interfere with activity life cycle?

I am creating an application that requires a thread. When I test the life cycle I get a weird result. When I run the app from eclipse everything is called correctly - onCreate() then onResume(). When I press the home button on my phone onPause() is…
0
votes
1 answer

Android take picture withoud preview

Do you know a way to take a picture without previewing? I searched and found only non-working solutions like setting the surface view width and height to 1 dp.
dephinera
  • 3,703
  • 11
  • 41
  • 75
0
votes
2 answers

How to update SurfaceView from another Thread?

I have a thread where I will get some Bitmap one by one. Then whenever I get a new Bitmap I need to update my SurfaceView which in the main thread. How can I do this?
Harry
  • 81
  • 9
0
votes
0 answers

android SurfaceView add callback Asynctask

i try to play video from url.i wrote some code witch can play video.now i want to use Asynctask class to load video from URl.when i used Asynctask i have RuntimeException the eclipse error is : Cannot create handler inside thread that has no called…
user3804530
  • 95
  • 1
  • 1
  • 7
0
votes
0 answers

surface view onResume crashes app

I am working with voice recognition and surface view in my app and my app crashes when I press home button and when I again launch the application from background it crashes... Here is my concern ... 1) if I open camera in onCreate() method and…
DjP
  • 4,537
  • 2
  • 25
  • 34
0
votes
1 answer

Skipping the Frame on onPreviewFrame(byte[] data, Camera camera)

I want to save the frame in the Arraylist code works but the problem is frames are skipping while capturing the video. CameraArrray is the arraylist and ModelFrameProcess is the model class which takes bytes array and save into the arraylist. I have…
Ahmad Arslan
  • 4,498
  • 8
  • 38
  • 59
0
votes
1 answer

How to invalidate the canvas after Draw function

I am calling Draw function as follows.Basically i want to display bouncing ball in surface holder. For this i am writing the code as follows: private void getDrawing() { for (i = 0; i < 1000; i++) { if ((i + 1 % 20) == 0) { …
Mayank Agarwal
  • 447
  • 1
  • 7
  • 21
0
votes
1 answer

How can i convert canvas to bitmap for save in sdCard

I use SurfaceView to move two bitmap picture over the screen. I tried this: ... @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); ... canvas.drawBitmap(bitmap,matrix,paint); …
0
votes
1 answer

switching a camera from back to front shows java.lang.runtimeexception method called after release()

I am developing my own Android camera app.what I would like to do is when I open my app it has to show two buttons likely capture and take photo along with camera screen.when I click the capture button I can take image of current position(from back…
Pans
  • 199
  • 17
0
votes
2 answers

Logcat Throws errors when overlaying a Fragment with a SurfaceHolder

I am trying to overlay afragment with cameraPreview instance. The root of the fragment layout has a xml tag
Amrmsmb
  • 1
  • 27
  • 104
  • 226
0
votes
2 answers

Android SurfaceView not retaining previously drawn objects

I am experimenting with SurfaceView. My requirement is to simply render a node (simple drawable) first. Then, render more nodes at a later point in time. The snippets of my thread's run method & my doDraw method are below. I am just trying to…
Ravi
  • 3,719
  • 6
  • 28
  • 40
0
votes
1 answer

Switching from Main thread to multiple Thread while analyzing a frame

I have been working on a Mobile application that analyzes the frame looking for specific objects. The processing was to heavy, and I keep getting 05-08 17:44:24.909: I/Choreographer(31606): Skipped 114 frames! The application may be doing too much…
0
votes
1 answer

Null Pointer Exception when accessing a method of a class extends view from inside a sensor listener

I want to pass the readings of a sensor to the class MyCompassView that extends a view, and based on the readings from the sensor to be passed, a pointer is changing its orientation. Actually, all this works fine, i tested it. But the same concept…
user3558352