2016-08-02 16 views
1

Ich habe versucht, eine App in Android Studio 2.1.2 für Sony Smart Glass zu entwickeln. Ich habe die Programmierung geschrieben und jetzt muss ich die App registrieren, damit der Smart Connect die App erkennen kann, damit sie für Sony Smart Glass verwendet werden kann.Wie registriere ich eine App für Sony Smart Glass?

Sony hat einige Anweisungen zur Registrierung gegeben, aber ich konnte es nicht verstehen. Trotzdem habe ich mein Bestes versucht, es zu registrieren. Ich bekomme 13 Fehler. Ich habe meine Codierung unten gepostet.

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); 
} 
} 

Fehler:

 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. 
+0

Scheint, dass Sie nicht Sony Sdk in Gradle-Datei hinzugefügt haben. Hast du? –

Antwort

0

diese Schritte für Registrierung Folgen:

  • Erstellen Sie eine Klasse, die RegistrationInformation erstreckt.
  • Überschreiben Sie die Methoden zum Definieren der verwendeten API-Versionen.
  • Übergehen Sie die Methode getExtensionRegistrationConfiguration(), um die Registrierungsinformationen Ihrer App zu definieren.
  • Übergehen Sie die Methode isDisplaySizeSupported(), um zu definieren, welche Zubehörteile von Ihrer App unterstützt werden.
  • Geben Sie in Ihrer ExtensionService-Klasse eine Instanz von RegistrationInformation zurück.
+0

Ja, ich habe diese vorgegebenen Prozeduren von Sony verfolgt. Da wir nicht zwei öffentliche Klassen erstellen können, kommt das Problem –