android-studiosony-smarteyeglass

How to register an app for Sony Smart Glass?


I was trying to develop an app in Android Studio 2.1.2 for Sony Smart Glass. I wrote the coding and now I have to register the app so that the Smart Connect can recognize the app, so that it can be used for Sony Smart Glass.

Sony has given few set of instructions to register but I couldn't understand it. Nevertheless I tried my best to register it. I am getting around 13 errors. I have posted my coding below.

package com.example.balakrishnan.newapp;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

 public class MainActivity extends AppCompatActivity implements RegistrationInformation {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

public void onButonTap(View v) {
    Toast myToast = Toast.makeText(getApplicationContext(), "sony smart glass", Toast.LENGTH_LONG);
    myToast.show();
}

public void browserapp(View view) {
    Intent browserIntent=new  Intent(Intent.ACTION_VIEW, Uri.parse("http://192.168.72.101/smartglass/datetime.php"));
    startActivity(browserIntent);
}

@Override
public int getRequiredControlApiVersion() {

    return 4;
}

@Override
public int getTargetControlApiVersion() {

    return 4;
}

@Override
public int getRequiredSensorApiVersion() {
    // Return 0 if the API is not required for your app
    return 0;
}

@Override
public boolean isDisplaySizeSupported(int width, int height) {
    boolean isSEG =
            (width == HelloLayoutsSEGControl.getSupportedControlWidth(mContext) &&
                    height == HelloLayoutsSEGControl.getSupportedControlHeight(mContext));

    return isSW2 || isSEG;

}

@Override
protected RegistrationInformation getRegistrationInformation() {
    return new SampleRegistrationInformation(this);
}
}

Errors:

     Error:(13, 64) error: cannot find symbol class RegistrationInformation
     Error:(60, 15) error: cannot find symbol class RegistrationInformation
     Error:(37, 5) error: method does not override or implement a method from a supertype
    Error:(31, 5) error: method does not override or implement a method from a supertype
   Error:(43, 5) error: method does not override or implement a method from a supertype
   Error:(49, 5) error: method does not override or implement a method from a supertype
   Error:(52, 75) error: cannot find symbol variable mContext
   Error:(52, 27) error: cannot find symbol variable HelloLayoutsSEGControl
   Error:(53, 84) error: cannot find symbol variable mContext
   Error:(53, 35) error: cannot find symbol variable HelloLayoutsSEGControl
   Error:(55, 16) error: cannot find symbol variable isSW2
   Error:(59, 5) error: method does not override or implement a method from a supertype
   Error:(61, 20) error: cannot find symbol class       SampleRegistrationInformation
 :app:compileDebugJavaWithJavac FAILED
   Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
  > Compilation failed; see the compiler error output for details.

Solution

  • Follow these steps for registration process: