我正在尝试在Android Studio 2.1.2中为Sony Smart Glass开发应用程序。我编写了编码,现在我必须注册应用程序,以便Smart Connect可以识别应用程序,以便它可以用于索尼智能玻璃。
索尼已经提供了很少的注册说明,但我无法理解。不过我尽力注册。我得到了大约13个错误。我在下面发布了我的编码。
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Intent intent = this.getIntent()
mUserEmail = intent.getStringExtra(Constants.USER_EMAIL);
setContentView(R.layout.search_list_activity);
RecyclerView mRecy = (RecyclerView) findViewById(R.id.rv_ff);
mProgBar = (ProgressBar) findViewById(R.id.prog_bar_ff);
mRecy.setLayoutManager(new LinearLayoutManager(this));
mImageView = (ImageView) findViewById(R.id.iv_ff);
nothingToShow = (ImageView) findViewById(R.id.nothing_to_show_here);
Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar);
/* Common toolbar setup */
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
searchEditText = (EditText) findViewById(R.id.search_edit_text);
Log.d(TAG+"init","search");
mQueryString = searchEditText.getText().toString();
Log.d(TAG+"mQuery",mQueryString);
searchEditText.setOnEditorActionListener(new EditText.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
Log.d(TAG+"mQuery",mQueryString);
return true;
}
return false;
}
});
mAdapter = new OfferAdapter(this);
mRecy.setAdapter(mAdapter);
}
错误:
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);
}
}
答案 0 :(得分:0)
请按照以下步骤进行注册: