Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easiest way to detect/listen to MySQL database changes from Android application?

Tags:

android

mysql

My question is stated in the title.

More specifically? In my MySQL database I have a table 'events' and each time an event is added/removed I would like to update the points on a Map on my android application.

If possible, a tutorial or code example would also be very much useful as I am still new to and exploring Android.

Appreciated.

like image 679
bubbly Avatar asked Dec 06 '25 15:12

bubbly


1 Answers

You can use C2DM to notify your Android application about database changes on your server:

https://developers.google.com/android/c2dm/

Update

Important: C2DM was officially deprecated on June 26, 2012, and has been shut down completely as of October 20, 2015. Existing C2DM developers are encouraged to migrate to Google Cloud Messaging (GCM). See the C2DM-to-GCM Migration document for more information. Developers must use GCM for new development.

Now a days C2DM is deprecated so you need to use Firebase or GCM(also deprecated)

FCM link

Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features! See the FAQ to learn more. If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future.

GCM link

like image 165
Andreas Ka Avatar answered Dec 08 '25 17:12

Andreas Ka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!