android - How to Show Notification before read data from server? -
I am developing an application in which I have to send data and get data from the server. There is no problem communicating with the server for me. Here's a requirement, that is, I want to show a notification in my app before receiving data from the server. I've discovered many examples that use the Android Cloud to Device Messaging Concepts. I am unable to understand it, it is so difficult for me. Send an easy way to get notifications.
Simple code usage:
notification n = new notification. Builder (this) .setContentTitle ("New mail from test@gmail.com") .setContentText ("subject"). SetSmallIcon (R.drawable.icon) .setContentIntent (pIntent) .setAutoCancel (true) .addAction (R. Drawable.icon, "call", pIntent) .addAction (R.drawable.icon, "more", pIntent) .addAction (R.drawable.icon, "and more", pIntent) .build (); can be found with a complete example.
You need to separate those 2 topics, adding / modifying / removing notifications is in your app, wherever you want it Decide, h As long as you do not handle it, the server will not see anything from the response. For example, if you want to upload the file to your server, you can take some notifications with "upload upload" once If this is done (the server is cured) then you will change to "uploaded".
Comments
Post a Comment