0

I'm trying to use a method from another class inside my Control method for camera of smarteyeglass and I'm getting an error. It's telling me that Method in class can not be applied to smarteyeglass.extension.Samplecamera.SamplecameraControl. This is my definition for method which I am trying to use in camera control method.

public DatabaseHelper(Context context) {
    super(context, DB_NAME, null, 10);
    this.myContext = context;
    this.DB_PATH = "/data/data/" + context.getPackageName() + "/" + "databases/";
    Log.e("Path 1", DB_PATH);
}

This is where i use the method in camera control class.

 case SmartEyeglassControl.Intents.CAMERA_MODE_JPG_STREAM_HIGH_RATE:

            if (cameraStarted) {



                DatabaseHelper myDbHelper = new DatabaseHelper(SampleCameraControl.this);

                try {
                 myDbHelper.createDataBase();
                 } catch (IOException ioe) {
                     throw new Error("Unable to create database");
                 }
                 try {
                    myDbHelper.openDataBase();
                 } catch (SQLException sqle) {
                    throw sqle;
                }
                d = myDbHelper.query("Rota", null, null, null, null, null, null);
                if (d.moveToFirst()) {
                    do {
                        canvas.drawText("Alınacak Parça " + d.getString(0) + "    " + "Raf Adresi:" + d.getString(1), pointBaseX, pointY, paint);
                    } while (d.moveToNext());





                } else {
                    canvas.drawText("Başlamak için dokun ", pointBaseX, pointY, paint);
                }

                break;

                    canvas.drawText("wrong recording type.", pointBaseX, pointY, paint);
            }
        default:
            utils.showBitmap(displayBitmap);
arman1991
  • 1,166
  • 1
  • 18
  • 28

1 Answers1

0

I think that the answer depends on what you what you are looking to do here. It looks like you are starting with the SampleCameraControl sample, which is a great start. If you just need the applications context you can pull that from the constructor in the SampleCameraControl.java class.

public SampleCameraControl(final Context context, final String hostAppPackageName) {

If you are trying to perform some action using the SmartEyeglass utility then your DatabaseHelper constructor needs to retrieve the SmartEyeglass control extension. Something like this:

import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension;
public DatabaseHelper(Context context, ControlExtension smartEyeglassControl) {

Let me know if this helps!

pg316
  • 1,380
  • 1
  • 8
  • 7
  • I was trying to extract data from tadabase and print to SmartEyeGlass screen.There is this error that show up this time; _24162-24162/com.example.sony.smarteyeglass.extension.helloworld E/Path 1: /data/data/com.example.sony.smarteyeglass.extension.helloworld/databases/_ I dont know what that is means. @Robert - Sony – Ozan Yağcı Jun 13 '16 at 09:26