Push Commander Android Template

I’ve now spent an inordinate amount of time on the last part of the Push Commander mission. I’ve done everything it asked, but because of version issues and deprecated features, I’ve been unable to complete it. I feel I’ve learned how to do it, and now I think I just want to be handed a working android project so I can run it and complete the mission. I really want to move on.

Does anyone have a working project they can offer for download?

Hi @Adam_Cook ,

Could you please provide more details about the issue?
Step by step, could you describe exactly what you are doing to complete the mission?

You can find examples of new projects by clicking the ‘Information’ icon at the top.

Regards,
Sergey

Hi @Sergey_Androsov,

Thanks, I’ll check out the templates.

I appreciate the willingness to help me on this, but I have so little interest in developing on Android that I’d rather just have this one handed to me. That said, I’ve invested enough time into learning it for just this task alone that I’m pretty confident that this is simply a version issue with packages and outdated code/instructions. I’ll see if one of the templates makes it possible, and if not then I’ll pick your brain with the step by step. Assuming you are still willing. :smiley:

Hey @Sergey_Androsov,

I downloaded the template, but immediately was hit with version issues:

Your build is currently configured to use incompatible Java 21.0.5 and Gradle 6.1.1. Cannot sync the project.

I assumed the project would just work because its package versions would all be in harmony with each other. Is this not the case?

I did some Googling, and it appears that Java, like Node, is installed on my machine/IDE not the project. So I need to downgrade Android Studio’s Java to match this up. What version should I target?

@Sergey_Androsov, ok, I give in.

Symptom: App crashes on load when Backendless.Messaging.registerDevice is in the MainActivity, but loads fine when it is removed.

The code looks like this:

Backendless.initApp(applicationContext, "https://quirkytop-us.backendless.app" )
val channels: MutableList<String> = ArrayList()
channels.add("default")
Backendless.Messaging.registerDevice(
    channels,
    object : AsyncCallback<DeviceRegistrationResult?> {
        override fun handleResponse(response: DeviceRegistrationResult?) {
            Toast.makeText(
                applicationContext, "Device registered!",
                Toast.LENGTH_LONG
            ).show()
        }

        override fun handleFault(fault: BackendlessFault) {
            Toast.makeText(
                applicationContext, "Error registering " + fault.message,
                Toast.LENGTH_LONG
            ).show()
        }
    }
)

I’ll send you a link to download the project if you want.

Hi @Adam_Cook

Yes, we would like that. Please send us the link to your project.

Regards,
Viktor

Thanks @Viktor_Mudrevsky for helping me!