Results 1 to 5 of 5

Thread: Have anyone tried this tutorial ?

  1. #1
    Join Date
    Apr 2008
    Location
    Colombia
    Beans
    24
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    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.

  2. #2
    Join Date
    Jul 2012
    Beans
    58

    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";

  3. #3
    Join Date
    Apr 2008
    Location
    Colombia
    Beans
    24
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    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 ?

  4. #4
    Join Date
    Oct 2012
    Beans
    17

    Re: Have anyone tried this tutorial ?

    I don't know about this and never used it before.

  5. #5
    Join Date
    Nov 2012
    Beans
    0

    Re: Have anyone tried this tutorial ?

    am never tried it before... haha..

    [spoiler=Cerita ane gan!]


    [/spoiler]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •