What method to add for my NearablesDemoActivity.java

I have error at dbRow = stickerdb.getResult(currentNearable.identifier(“065473d63cd9d687”));
It says Method call expected

The error log:
Error:(96, 52) error: cannot find symbol method identifier(String)

public class NearablesDemoActivity extends BaseActivity {

private static final String TAG = NearablesDemoActivity.class.getSimpleName();

private Nearable currentNearable;
private BeaconManager beaconManager;
private String scanId;

TextView Desc;  //description
Spinner spinnerDropDown;  //for size available
String[] size = {
};                   //for size available
Spinner spinnerDropDown2;   //for colours available
String[] colour = {
};                      //for colours available
TextView COO;      //For country of origin
TextView SM; //For Shoe Model
TextView Price; //For price
Button btnRating;  //for button
private Database_sticker stickerdb;
Sresult dbRow;

@Override
protected int getLayoutResId() {
    return R.layout.nearable_demo;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.nearable_demo);


    currentNearable = getIntent().getExtras().getParcelable(ListNearablesActivity.EXTRAS_NEARABLE);
    displayCurrentNearableInfo();

    beaconManager = new BeaconManager(this);

    ArrayAdapter<String> adapter= new ArrayAdapter<>(this,android.R.layout.simple_spinner_dropdown_item ,size);  //for size available
    spinnerDropDown.setAdapter(adapter);
    ArrayAdapter<String> adapter1= new ArrayAdapter<>(this,android.R.layout.simple_spinner_dropdown_item ,colour); //for colours available
    spinnerDropDown2.setAdapter(adapter1);

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setNavigationIcon(R.drawable.ic_action_navigation_arrow_back);
    toolbar.setTitle(getTitle());
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });

    btnRating=(Button)findViewById(R.id.rd);

    btnRating.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent pageforRatingBar = new Intent(getApplicationContext(), RatingBar_main.class);
            startActivity(pageforRatingBar);
        }
    });

    stickerdb = new Database_sticker(this);
   // dbRow = stickerdb.getResult(1);//currentNearable.identifier()
    dbRow = stickerdb.getResult(currentNearable.identifier("065473d63cd9d687"));
    dbRow.getSa();
    dbRow.getDesc();
    dbRow.getCoo();
    dbRow.getId();
    dbRow.getPrice();
    dbRow.getSm();
}

@Override
protected void onResume() {
    super.onResume();
    beaconManager.setNearableListener(new BeaconManager.NearableListener() {
        @Override
        public void onNearablesDiscovered(List<Nearable> nearables) {
            updateCurrentNearable(nearables);
            displayCurrentNearableInfo();

        }
    });


    beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
        @Override
        public void onServiceReady() {
            scanId = beaconManager.startNearableDiscovery();
        }
    });
}

@Override
protected void onStop() {
    beaconManager.disconnect();
    super.onStop();
}

private void displayCurrentNearableInfo() {
            Desc = (TextView) findViewById(R.id.textview1);   //for description
            // Get reference of SpinnerView from layout/nearable_demo.xml
            spinnerDropDown = (Spinner) findViewById(R.id.spinner1);  //For size available
            spinnerDropDown2 = (Spinner) findViewById(R.id.spinner2);//for colours available
            COO = (TextView) findViewById(R.id.textview2);//for country of origin
            SM = (TextView) findViewById(R.id.textview3); //for shoe model
            Price = (TextView) findViewById(R.id.textview4); //for price
}

private void updateCurrentNearable(List<Nearable> nearables) {
    for (Nearable nearable : nearables) {
        if (nearable.equals(currentNearable)) {
            currentNearable = nearable;
        }
    }
}
}

Hi @Jaemin_Sung,

When you have scanned Nearables in your vicinity, do use Nearable#identifier property in order to get nearable’s identifier.

1 Like

Hi @wiktor
What do you mean by using Nearable#identifier property?

@Jaemin_Sung
Hi Jaemin, Can you please provide me your source code of nearable. I am also working on it so I can get some basic support from your code.
Thanks in advance.

You’re calling an identifier method on an object of the Nearable class. There is no such android method in this class:
http://estimote.github.io/Android-SDK/JavaDocs/com/estimote/sdk/Nearable.html
There is, however, an identifier property, and that’s the one you need to use:
http://estimote.github.io/Android-SDK/JavaDocs/com/estimote/sdk/Nearable.html#identifier
In other words, this line:
dbRow = stickerdb.getResult(currentNearable.identifier(“065473d63cd9d687”));
… needs to become:
dbRow = stickerdb.getResult(currentNearable.identifier);