As a beginner I advise you to give a firebase, as other colleagues have indicated. I have recently made an app and I can tell you that you will need to create an account on the firebase console . In this access you will find the information how to proceed with the configuration file to be inserted in your app.
In Gradle of your app, you should add the sdk configuration:
in the build.gradle file of the root folder, set up similar to:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}
already in the /build.gradle file of the / app
subfolder
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 the firebase and search for registry updates, the code looks like this:
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());
}
});