As you are beginner I advise you to give a look on the firebase, as other colleagues have indicated. I have made an app recently and can tell you that you will need to create an account on firebase console. In this access you will find the information how to proceed with the configuration file to be inserted in your app.
In your app’s Gradle, you should add the sdk:
in the archive build.Gradle root folder, configure similar to:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}
already in the archive /build.Gradle sub-folder /app
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
compile 'com.google.firebase:firebase-core:9.6.1'
}
apply plugin: 'com.google.gms.google-services'
With everything set up, your app should connect to firebase and search for updates of the logs, the code looks like:
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("message");
myRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
String value = dataSnapshot.getValue(String.class);
Log.d(TAG, "Value is: " + value);
}
@Override
public void onCancelled(DatabaseError error) {
// Failed to read value
Log.w(TAG, "Failed to read value.", error.toException());
}
});
This is it: https://developers.google.com/cloud-messaging/ and this http://stackoverflow.com/questions/19866623/getting-an-api-key-to-use-with-google-cloud-messaging
– Reginaldo Rigo
One option is Firebase, you can check this link https://firebase.google.com/docs/cloud-messaging/? hl=en
– Shogogan