Android register method runtime excption

Hello,
I am trying to use your service for the first time,
I added a simple register button, but pressing it I am receiving a runtime error.
this is my gradle line:
compile ‘com.backendless:android:3.0.3’
I also added backendless service to the manifest<service android:name=“com.backendless.AndroidService” />
this i my login code:
Backendless.initApp(this, Consts.BACKENDLESS_APP_ID, Consts.BACKENDLESS_SECRET_KEY, version);

Button testLoginButton = (Button)findViewById(R.id.btnTestLogin);

testLoginButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

    BackendlessUser user = new BackendlessUser();
    user.setEmail( "michael@backendless.com" );
    user.setPassword( "my_super_password" );

    Backendless.UserService.register( user, new BackendlessCallback&lt;BackendlessUser&gt;()
    {
        @Override
        public void handleResponse( BackendlessUser backendlessUser )
        {
            Log.i("Registration", backendlessUser.getEmail() + " successfully registered");
        }

        @Override
        public void handleFault(BackendlessFault fault) {
            Log.i( "Registration fault", "code: " + fault.getCode() + ". message: " + fault.getMessage());
            super.handleFault(fault);
        }
    } );
}

});
This is my printed error:
Registration fault: code: Internal client exception. message: https://api.backendless.com/1.0/binary

and this is the exception:

FATAL EXCEPTION: main
java.lang.RuntimeException: https://api.backendless.com/1.0/binary
at com.backendless.async.callback.BackendlessCallback.handleFault(BackendlessCallback.java:28)
at com.taldroid.apps.tapextreme.ui.activities.login.LoginTestActivity$1$1.handleFault(LoginTestActivity.java:62)
at com.backendless.UserService$1.handleFault(UserService.java:116)
at com.backendless.async.message.AsyncMessage$FaultHandler.handle(AsyncMessage.java:83)
at com.backendless.async.message.AsyncMessage.handleCallback(AsyncMessage.java:41)
at com.backendless.core.AndroidCarrier$1.handleMessage(AndroidCarrier.java:37)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5306)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)

Thank you for your help!

Hi Tal,

Could you please change the registration call to the following and then see in the debugger what you got in the Fault object:

    Backendless.UserService.register( user, new AsyncCallback&lt;BackendlessUser&gt;()
    {
      @Override
      public void handleResponse( BackendlessUser response )
      {
        
      }


      @Override
      public void handleFault( BackendlessFault fault )
      {
          // CHECK WHAT YOU GOT IN THE FAULT OBJECT HERE
      }

Regards,
Mark

Hey mark,

See the file attached.

I cannot reproduce the problem, it works for me every time. Can you zip up the project and email to me? I am at mark@backendless.com

Thanks,
Mark

Hi Tal,

I got your project and see a couple of issues:

    You do not need to put Backendless.initApp into every single activity. It needs to be called ONLY one time. Just like you have Parse.initialize in the TapExtremeAplication class, you need to call Backendless.initApp only once as well. The following code to determine the "version" makes little sense. The "version" of your app has nothing to do with the package manager. It is said on the backend, the default is always "v1", you could just hard code that for simplicity for now.
[code] String version; try { PackageManager manager = getPackageManager(); PackageInfo info = manager.getPackageInfo(getPackageName(), 0); version = info.versionName;

} catch (PackageManager.NameNotFoundException e) {
version = “v1”;
}

Backendless.initApp( this, Consts.BACKENDLESS_APP_ID, Consts.BACKENDLESS_SECRET_KEY, version);

[/code]

Regards,
Mark

Alright!

Now it works!

should this version be the same as the my app version name?