PersonalShopper Example

J Jon-Luke West 3 years 5 months ago
14 1 0

Is there some sample source code that shows how to correctly interface with the MC18KK Personal Shopper and Cradle that I can look at?  My current implementation of the EMDKListener class is not opening the EMDKManager as I expect it to resulting in a NullPointerReference when trying to obtain a pointer to the PersonalShopper through EMDKManager.getInstance();  I feel I might be missing something in my Activity OnCreate() method, but I cannot find anything about this in the reference material.

Thank you!

Please Register or Login to post a reply

1 Replies

J Jon-Luke West

public class MainActivity extends Activity implements EMDKManager.EMDKListener {
 
    private EMDKManager manager;
    private EMDKResults results;

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

        EMDKManager.getEMDKManager(getApplicationContext(), this);
    }

    @Override
    protected void onDestroy() {

        if(manager != null) {

            manager.release();
        }
        super.onDestroy();
    }

    @Override
    public void onOpened(EMDKManager emdkManager) {

        manager = emdkManager;
    }

    @Override
    public void onClosed() {

        manager.release();
    }
}

I went back and followed the EMDK Walkthrough (), but it did not fix my problem.
I am thrown this error upon execution of the application:

Caused by: java.lang.RuntimeException:
com.symbol.emdk.EMDKManager.getEMDKManager(Unknown Source)

CONTACT
Can’t find what you’re looking for?