I am developing an application which is having push notification functionality. I followed the following link as Android Push Notification
I tried and successfully s
Send JSON data via push notification
You can send the JSON as data in the notification message from your server side code. Once you get the notification then you would receive a JSON in the message where you can do whatever you want.
Save the data into SQLite database
This is simple as per your requirement, you can insert the data whatever received in the JSON. You can get the data from the JSON after parsing.
Open new activity on click of push notification.
You can do like below
mNotificationManager = (NotificationManager)
this.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, YourActivity.class), 0);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_stat_gcm)
.setContentTitle("GCM Notification")
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(msg))
.setContentText(msg);
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
Display data coming from push notification of new activity.
You can display the data whatever receive from push message but you have to parse the JSON.
If the application is closed so after click on notification the app get started.
My above code will work for you in this case also.
See here for JSON parsing : http://www.vogella.com/tutorials/AndroidJSON/article.html
All in all, you have to add the data in the JSON form in your server cod that you would get when you push the GCM from the server and later perform parse the JSON and do whatever you want.