我想在我的音频调用代码中实现 mesibo 实时 API,但这里提供的代码仍然有问题,随机数给出空指针。这里犯了什么错误。
Mesibo api = Mesibo.getInstance();
api.init(getApplicationContext());
// set path for storing DB and messaging files
Mesibo.setPath(Environment.getExternalStorageDirectory().getAbsolutePath());
// add listener
Mesibo.addListener(this);
// set access token
if(0 != Mesibo.setAccessToken(access_token)) {
// return false;
}
// set database after setting access token so that it's associated with the user
Mesibo.setDatabase("mesibo.db", 0);
// Now start mesibo
if(0 != Mesibo.start()) {
// return false;
}
Mesibo.UserProfile mProfile = new Mesibo.UserProfile();
mProfile.name = "user_name";
mProfile.address = "xyz";