FATAL EXCEPTION: main
java.lang.NoSuchMethodError: java.lang.String.isEmptyat org.kaaproject.kaa.client.KaaClientProperties.parseBootstrapServers(KaaClientProperties.java:155)at org.kaaproject.kaa.client.KaaClientProperties.getBootstrapServers(KaaClientProperties.java:130)...
public class KaaEndpoint extends Application {
Profile profile;
private static Context mContext;
private KaaClient mClient;
public void initProfile () {
mClient = Kaa.newClient(new AndroidKaaPlatformContext(this), new SimpleKaaClientStateListener());
profile = new Profile("String_ID", "String_Name", "Type_AndroidPlarform" , false);
// Simple implementation of ProfileContainer interface that is provided by the SDK
mClient.setProfileContainer(new ProfileContainer() {
@Override
public Profile getProfile() {
return profile;
}
});
// Starts Kaa
mClient.start();
profile.setMaster(true);
mClient.updateProfile();
}
}
Attempt to invoke virtual method 'java.io.File android.content.Context.getFilesDir()' on a null object reference
There is normally no need to subclass Application. In most situation, static singletons can provide the same functionality in a more modular way. If your singleton needs a global context (for example to register broadcast receivers), the function to retrieve it can be given aContextwhich internally usesContext.getApplicationContext()when first constructing the singleton.
public void onCreate ()
{
super.onCreate();
mContext = this;
}
public KaaEndpoint(Context context) {
mContext = context;
}mClient = Kaa.newClient(new AndroidKaaPlatformContext(mContext), new SimpleKaaClientStateListener())KaaEndpoint endpoint = new KaaEndpoint(this);
endpoint.initProfile();
;пятница, 20 ноября 2015 г., 20:47:57 UTC+2 пользователь Gianluca Barbera написал: