Have anyone tried this tutorial ?
Hello everyone, i'm trying to follow the tutorials for a camera app located in ; the problem is that when i try and copy paste to my project, i get an error showing there is something wrong int he following code:
Code:
public void surfaceCreated(SurfaceHolder holder) {
// The Surface has been created, now tell the camera where to draw the preview.
try {
mCamera.setPreviewDisplay(holder);
mCamera.startPreview();
} catch (IOException e) {
Log.d(TAG, "Error setting camera preview: " + e.getMessage());
}
}
the error goes something like "TAG variable is not set", but, as far as i understood, TAG is some sort of internal class/function on the Android API, so, ¿ is there something i'm missing ?.
Thanks in advance.
Re: Have anyone tried this tutorial ?
I don't know about your tutorial, but your understanding of TAG is wrong.
Log.d uses the Log class which has a class function d (which stands for debug).
You pass to that function a 'tag' parameter which should be a String (or maybe a CharSequence or other similar class). Obviously, the second parameter is also a String or CharSequence.
So you can put a line higher above like
TAG = "myApp";
Re: Have anyone tried this tutorial ?
oh i'm sorry about the tutorial site, i'm adding the address :
http://developer.android.com/guide/t...#custom-camera
As for TAG, ¿so what you are saying is that TAG should be a string in my string.xml ?
Re: Have anyone tried this tutorial ?
I don't know about this and never used it before.
Re: Have anyone tried this tutorial ?