Android : Push data with notification -


i developing application. application client server based.

the need of application that:

  1. i want push data server device without web service, push notification. want push data more in size compare notification , data may text, xml, json, .png, .jpg thing.

    i had tried push notification demo this link

  2. whenever there data added server, data should push server device notification. when user click on notification data gets display device, don't want fetch data after click on notification web server.

please suggest me in middle of application.

so please suggest me steps should follow achieve task. guide me valuable knowledge.

the need of application that:

1. want push data server device without web service, push notification. want push data more in size compare notification , data may text, xml, json, .png, .jpg thing.  2. whenever there data added server, data should push server device notification. when user click on notification data gets display device, don't want fetch data after click on notification web server. 

you can push data in form of payload can send message server device. maximum size of data can send 4kb.

you check following code :

private static void generatenotification(context context, string message) {     notificationmanager notificationmanager = (notificationmanager) context.getsystemservice(context.notification_service);     notification notification = new notification(r.drawable.ic_launcher, "message received", system.currenttimemillis());     // hide notification after selected     notification.flags |= notification.flag_auto_cancel;      //adding led lights notification     notification.defaults |= notification.default_lights;      intent intent = new intent(context, messagereceivedactivity.class);     intent.putextra("payload", payload);      pendingintent pendingintent = pendingintent.getactivity(context, 0, intent, intent.flag_activity_new_task);     notification.setlatesteventinfo(context, "message", "new message received", pendingintent);     notificationmanager.notify(0, notification); } 

may you.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -