calling the Backendless.initApp() app crash

hi guys,i am new to backendless but not android, i have a problem when
using the Backendless.initApp() on my android app it crashes

i have setup the requirements on the manifest.xml

Hi.

Please provide your code and error message.
Regards,
Kate.

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_items);

	String appVersion = "v1";
    Backendless.initApp( this, "79B818AE-2FD1-7772-FF09-1350C7807E00", "18D54A4D-99E9-B6A8-FF2F-79E8D679ED00", appVersion );
    
	Bitmap photo = (Bitmap) getIntent().getExtras().get(Defaults.DATA_TAG);
	if (photo == null) {
		finishActivity(RESULT_CANCELED);
		return;
	}


	
	String name = UUID.randomUUID().toString() + ".png";
	
	Backendless.Files.Android.upload(photo, Bitmap.CompressFormat.PNG, 100,
			name, Defaults.DEFAULT_PATH_ROOT,
			new AsyncCallback<BackendlessFile>() {
				@Override
				public void handleResponse(
						final BackendlessFile backendlessFile) {
					ImageEntity entity = new ImageEntity(System
							.currentTimeMillis(), backendlessFile
							.getFileURL());
					Backendless.Persistence.save(entity,
							new BackendlessCallback<ImageEntity>() {
								@Override
								public void handleResponse(
										ImageEntity imageEntity) {
									Intent data = new Intent();
									data.putExtra(Defaults.DATA_TAG,
											imageEntity.getUrl());
									setResult(RESULT_OK, data);
									finish();
								}
							});
				}


				@Override
				public void handleFault(BackendlessFault backendlessFault) {
					Toast.makeText(AddItems.this,
							backendlessFault.toString(), Toast.LENGTH_SHORT)
							.show();
				}
			});


	
	
	
}

i have attached a screen shot of the error message from the logCat

Have you added our client SDK library (backendless.jar) to your project or maybe Gradle dependency to it?

yes. i have i am using eclipse

i have downloaded the genarated code from the console they work ok,but get this problem when i use backendless sdk on my own custom app

Are you sure that backendless.jar is packaged into your application when you make .apk using Eclipse?

Hi Thabo,

Could you please attach a screenshot from Eclipse that shows the dependencies/libraries included into your project?

Regards,
Mark

not sure if you fixed your issue yet, but to help others with the NoClassDef error…

if you are packing the backendless.jar module, add the module reference in your app dependencies under File>Project Structure

when i used the maven reference, it would always crash on me. Doing this worked well for me… i hope it only helps another

Ronnie,

We are anxiously waiting on the updated version of the backendless library in the central maven repository, it should show up some time tomorrow. That one should not give any compile time errors.

Regards,
Mark

Mark,

That is good to know. it took me a couple hours and a few tries to nail it down, but it is working really nice now. i will look forward to the maven fix and make a change once it is in place. That will definitely help.

Hi

I still can’t compile latest sdk. I’ve tried in gradle by adding following dependency:

‘com.backendless:backendless:3.0.8’
but after sync got this error:

Error:Failed to resolve: com.backendless:commons:2.1.0
commons:2.10 link is not valid in maven.

I just created a basic app, pulled Backendless from maven (version 3.0.8.1) and was able to compile without any errors:

http://support.backendless.com/public/attachments/86d615e79b3f785c0604bde43e57d77e.png</img>

http://support.backendless.com/public/attachments/89b08a462675064958bf81fbcad2d7c9.png</img>

I think your project has some extra references to an older library.

Hi Mark

version 3.0.8.1 worked flawlessly .
good job

Hi, I am new to Backendless but not to android.
I have registered my android device into the backendless devices tab and I am trying to send a push notification by selecting the particular device but not receiving it at the device end.

Hopeful with a positive reply from your side.
Thanks in advance.

Jay

Hi Jay,

Have you properly configured push notification for Android by this guide - https://backendless.com/documentation/messaging/android/messaging_push_notification_setup_androi.htm ?

Also check whether you send proper Android headers from here - https://backendless.com/documentation/messaging/android/messaging_publish_push_notifications.htm

And the best option would be to watch the latest webinar on Push Notifications at https://www.youtube.com/watch?v=nIbv0GUyZ_Q - this should explain you a lot.

Thanks Sergey for your quick reply.

I got it solved by adding proper headers and got the push notification.

Now I am having one fine issue that is, how can I add autoincrement column in our Database Table?
And how can a user recover his password if its forgotten ?

Hoping for your kind and quick response.
Jay

how can I add autoincrement column in our Database Table?

You could add a beforeCreate event handler and in there use the atomic counter API:
https://backendless.com/documentation/utilities/android/ut_atomic_counters_api_android.htm

And how can a user recover his password if its forgotten ?

https://backendless.com/documentation/users/android/users_password_recovery.htm

Hi All,

I have a question regarding Primary Key & Foreign Key in backendless.
How can I give Primary Key to a column and use that col as FK in other table. It is quite much required now at this stage of my project.
Hope for a quick and kind reply from you friends. Thanks in advance.

Jay