Topic: Custom development
Hi
I am new to develop an android application, I am trying to use Wialon Java API to design an application.
on my application i need following steps
Step 1. Login - Using username and password
Step 2. Loading available vehicles in Listview in my app
when i am runnig my application i ma getting following error
06-01 12:36:54.326 19935-19935/net.atsuae.myapplicationwialon W/System: ClassLoader referenced unknown path: /system/framework/QPerformance.jar
06-01 12:36:54.330 19935-19935/net.atsuae.myapplicationwialon E/BoostFramework: BoostFramework() : Exception_1 = java.lang.ClassNotFoundException: Didn't find class "com.qualcomm.qti.Performance" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib64, /vendor/lib64]]
06-01 12:36:54.526 19935-19935/net.atsuae.myapplicationwialon E/AndroidRuntime: FATAL EXCEPTION: main
Process: net.atsuae.myapplicationwialon, PID: 19935
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.wialon.
here i am attaching my source code
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.wialon.core.Errors;
import com.wialon.core.Session;
import com.wialon.extra.SearchSpec;
import com.wialon.item.Item;
import com.wialon.remote.handlers.ResponseHandler;
import com.wialon.remote.handlers.SearchResponseHandler;
public class MainActivity extends AppCompatActivity {
private Session session;
EditText userName, pssword;
Button userlogin;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
userName = (EditText) findViewById(R.id.username);
pssword = (EditText) findViewById(R.id.password);
userlogin = (Button) findViewById(R.id.loginbtn);
userlogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String userid = userName.getText().toString();
String pass = pssword.getText().toString();
session.initSession("http://host.wialon.com");
session.login(userid, pass, new ResponseHandler() {
@Override
public void onSuccess(String response) {
super.onSuccess(response);
System.out.println(String.format("Logged successfully. User name is %s", session.getCurrUser().getName()));
}
@Override
public void onFailure(int errorCode, Throwable throwableError) {
super.onFailure(errorCode, throwableError);
// login failed, print error
System.out.println(Errors.getErrorText(errorCode));
}
});
}
});
}
}