You need to sign in to do that
Don't have an account?

Facing Null Pointer Exception in Android Rest API
Hello Guys,
I am trying to connect from Android to SFDC through Rest API. In the follwing link when I try to do CRUD operation it is showing Null Pointer Exception....
http://wiki.developerforce.com/page/Getting_Started_with_the_Mobile_SDK_for_Android
Code is
String objectType = "Account";
fields.put("Name","Test Account");
RestRequest request = null;
try {
request = RestRequest.getRequestForCreate("22.0",
objectType,
fields);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
client.sendAsync(request, new AsyncRequestCallback() {
public void onSuccess(RestResponse response) {
try {
}
Catch(Exception e)
{
}
Error is at the Red Line
Any Help is much appreciated ...
Thanks
Mahesh
Looking at the code, I think your API version is incorrect in your call to RestRequest.getRequestForCreate(). The API version numbers are prefaced with a 'v', so your call should be:
request = RestRequest.getRequestForCreate("v22.0", objectType, fields);
Hope this helps,
Kevin