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
1
vote
1 answer

Render Byte Array on SurfaceView of android

Hi I have a raw dump of image which i store as byte array i have to display this on surface view. I tried to convert this byte array into a mutable bitmap and render on the canvas of surface holder but i get this null pointer…
amIT
  • 664
  • 13
  • 27
1
vote
1 answer

SurfaceView + Canvas, fade from one color to another

I have ArrayList colors = new ArrayList(); for(int i = 0; i = intList.size(); i++){ //some list of ints colors.add(new ColorDrawable(intList.get(i))); I want to fade from one color in the list to another, using a…
snotyak
  • 3,709
  • 6
  • 35
  • 52
1
vote
1 answer

Is It about Augmented Reality or Camera Preview?

I jsu have small inquiry, and please dont underestimate it. I Have a class that implements Render, and another CLass implements Surface.callback. When I run the class the implements the surface.Callback, I manage to show the camera preview. And When…
1
vote
1 answer

"Error 1" occurring during camera overlay in Android

I have created an Activity that has a SurfaceView and a SurfaceHolder in order to create a Camera overlay. For some reason, I am getting the following in ADB: 04-08 10:54:06.747: E/Camera(1152): Error 1. I am able to take a picture, but I cannot…
Swifty McSwifterton
  • 2,637
  • 1
  • 30
  • 37
0
votes
1 answer

Android Application Crashes When Element Added to A List

I have a list an element defined as such: public List Bullets; Bullet newBullet = new Bullet(0, 0, 0, 0, 0, 0, 0, 0); When an onscreen button is pressed I run: newBullet.setProperties((int)(CannonCenterX + CannonEndX), (int)(CannonCenterY…
Nathan Tornquist
  • 6,468
  • 10
  • 47
  • 72
0
votes
1 answer

How can I re-use a surfaceHolder with camera.startPreview after I've already taken a picture?

RESOLVED : issue was unrelated to Android camera or SDK, but rather my own logic to determine whether the camera and surface are both ready. I have a situation where I've got a SurfaceView that exists in an activity's layout xml, to which I add a…
scriptocalypse
  • 4,942
  • 2
  • 29
  • 41
0
votes
1 answer

How to hold every view in one?

I need to transport every view in my layout somewhere else in that layout... So i need something to put every view in it, and move only it... How can i manage this? (It may be too easy, sorry if it is, but i'm pretty new on android. I've heard…
yahya
  • 4,810
  • 3
  • 41
  • 58
0
votes
1 answer

Is SURFACE_TYPE_NORMAL a valid Android camera type?

I am building an augmented reality app that takes frames from the camera, filters them using a few image processing techniques, and displays them to the user in place of the camera preview. When I first started I was simply calling: holder =…
Grimmace
  • 4,021
  • 1
  • 31
  • 25
0
votes
1 answer

Camera application using SurfaceView crashing

The application crashes(Before anything starts there's a dialog that has to be forced closed and then the app exits) at setPreviewDisplay(holder) in SurfaceCreated and I can't figure out why. Please advise. Below is my code. public void…
Namratha
  • 16,630
  • 27
  • 90
  • 125
0
votes
0 answers

Who is correct to use SurfaceView in background Thread?

I'm trying to make a simple game for Android and have a problem with animation rendering. First of all, I started from drawing in View by calling of .invalidate() method. But it gives only 30 FPS. Than, I founded SurfaceView. I'm drawing in…
0
votes
2 answers

SurfaceHolder.lockCanvas returns null if the surface is not in the foreground

I'm currently doing a test with a LiveWallpaper in Android. I am drawing something on the canvas using code that looks something like this: final SurfaceHolder holder = getSurfaceHolder(); Canvas c = new Canvas(); c = holder.lockCanvas(); // c…
citizen conn
  • 15,300
  • 3
  • 58
  • 80
0
votes
1 answer

Independent android camera app works but does not work when said camera app code is called by another activity

I built together a simple camera app (from various sources in the internet, using SurfaceHolder) as a prototype to be integrated later on with a bigger project. The app works really well. It doesn't crash and saves the images properly. I started…
0
votes
1 answer

How do I initiate xml-defined surface view via button press?

I've patterned my initial code from another tutorial to create classes to handle drawing to a SurfaceView. This tutorial (and others I've found) associate an xml-defined SurfaceView to a class which intiates upon creation of the activity. My goal…
user695977
  • 91
  • 1
  • 4
0
votes
1 answer

android java.lang.RuntimeException:Fail to connect to camera service using SurfaceView

Im getting the exception java.lang.RuntimeException:Fail to connect to camera service when reopening the same activity. For the first time the code works fine without capturing video file(only camera preview).But after finishing MainActivity.If I…
Bhagyashri
  • 182
  • 1
  • 15
0
votes
2 answers

Nothing Shows Up on Canvas from SurfaceHolder . lockCanvas() [Android]

I'm trying to draw on the canvas that is returned from the surface holder's .lockCanvas() function but the canvas that is rendered is simply white. My MySurface extends SurfaceView and implements SurfaceHolder The constructor: MySurface(Context…
dev
  • 1