Google Cloud Messaging in Delphi XE5?

FerretDriver picture FerretDriver · Sep 17, 2013 · Viewed 9.4k times · Source

I've got an android app that I am thinking about porting to Delphi but I can't see a way to interface with GCM. I am thinking I would possibly have to run the GCMBaseIntentService in java and interface with the delphi shared object?

Alternatively, I am looking for a way to do push notifications in a Delphi Xe5 android app.

Answer

Avanz picture Avanz · Jan 27, 2014

You interface Java with Delphi using JNI. The JNI allows you to call in both directions: Java to Delphi or Delphi to Java. So you can extend your Delphi applications with Java classes.

For implementing what you want on Android, doing it in Java will be the easier path to follow, as some available examples do exactly what you have in mind. Just have a look:

To interface Java JNI and Delphi, you can follow detailed steps, thus allowing a smooth communication between front end and back end of your application.

If you decide to re-use some of the code, remember to give appropriate credit to the authors.