मैं अपने आवेदन के लिए एंड्रॉइड में स्थानीय अधिसूचना का उपयोग करना चाहता हूं। यदि स्थानीय अधिसूचना से 24 घंटे के लिए ऐप नहीं खोला जाता है। क्या कोई मुझे बता सकता है कि इसे कैसे किया जाना चाहिए।एंड्रॉइड में स्थानीय नोटिफिकेशन भेजना
उत्तर
देखें: Local Notifications in Android? आपको हर घंटे अलार्म प्रबंधक के साथ एक इरादा निर्धारित करने में सक्षम होना चाहिए।
के लिए कुछ ट्यूटोरियल प्रदान कर सकते हैं त्वरित प्रतिक्रिया के लिए धन्यवाद लेकिन ऐप बंद होने पर अलार्म मैनेजर का उपयोग किया जा सकता है। ऐप बंद होने पर अधिसूचना कैसे ट्रिगर की जाएगी? –
ऐप बंद होने पर भी अलार्म प्रबंधक का उपयोग किया जा सकता है। हालांकि ऐप इंस्टॉल होने पर आप अलार्म मैनेजर सेट करने में सक्षम नहीं होंगे, केवल तभी जब ऐप लोड हो जाए (कम से कम एक बार) (देखें: http://stackoverflow.com/a/8492846/986105)। अलार्म मैनेजर का उपयोग करके अधिसूचना बनाने के लिए इसे देखें: http://smartandroidians.blogspot.com/2010/04/alarmmanager-and-notification-in.html – KrispyDonuts
आप शीर्षक के साथ एक अधिसूचना में बहु पाठ के साथ, बड़ा डेटा यानी के साथ स्थानीय अधिसूचना सक्रिय करना चाहते हैं, टिकर, आइकन, ध्वनि .. निम्न कोड का उपयोग करें .. मुझे लगता है कि .. यह तुम्हारी मदद करेगा
Intent notificationIntent = new Intent(context,
ReminderListActivity.class);
notificationIntent.putExtra("clicked", "Notification Clicked");
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP); // To open only one activity
// Invoking the default notification service
NotificationManager mNotificationManager;
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
context);
Uri uri = RingtoneManager
.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
mBuilder.setContentTitle("Reminder");
mBuilder.setContentText("You have new Reminders.");
mBuilder.setTicker("New Reminder Alert!");
mBuilder.setSmallIcon(R.drawable.clock);
mBuilder.setSound(uri);
mBuilder.setAutoCancel(true);
// Add Big View Specific Configuration
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
String[] events = null;
events[0] = new String("Your first line text ");
events[1] = new String(" Your second line text");
// Sets a title for the Inbox style big view
inboxStyle.setBigContentTitle("You have Reminders:");
// Moves events into the big view
for (int i = 0; i < events.length; i++) {
inboxStyle.addLine(events[i]);
}
mBuilder.setStyle(inboxStyle);
// Creates an explicit intent for an Activity in your app
Intent resultIntent = new Intent(context,
ReminderListActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder
.create(context);
stackBuilder.addParentStack(ReminderListActivity.class);
// Adds the Intent that starts the Activity to the top of the stack
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent = stackBuilder
.getPendingIntent(0, PendingIntent.FLAG_CANCEL_CURRENT);
mBuilder.setContentIntent(resultPendingIntent);
mNotificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
// notificationID allows you to update the notification later on.
mNotificationManager.notify(999, mBuilder.build());
Intent intent = new Intent(context, yourActivity.class);
PendingIntent pIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder b = new NotificationCompat.Builder(context);
b.setAutoCancel(true)
.setDefaults(Notification.DEFAULT_ALL)
.setWhen(System.currentTimeMillis())
.setSmallIcon(R.drawable.ic_launcher)
.setTicker("notification")
.setContentTitle("notification")
.setContentText("notification")
.setDefaults(Notification.DEFAULT_LIGHTS| Notification.DEFAULT_SOUND)
.setContentIntent(pIntent)
.setContentInfo("Info");
NotificationManager notificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(1, b.build());
- 1. एंड्रॉइड, नोटिफिकेशन
- 2. एंड्रॉइड नोटिफिकेशन
- 3. विस्तारणीय नोटिफिकेशन एंड्रॉइड 4.1
- 4. एंड्रॉइड एसक्यूएलएट डीबी नोटिफिकेशन
- 5. रेल मेलर: स्थानीय फ़ाइल में ईमेल भेजना
- 6. स्थानीय नोटिफिकेशन के लिए कस्टम ध्वनि चुनें
- 7. एकाधिक रिमोट सहकर्मियों को स्थानीय स्ट्रीम भेजना
- 8. एंड्रॉइड में HTML स्वरूपित ईमेल भेजना
- 9. एंड्रॉइड में HTTP DELETE अनुरोध भेजना
- 10. एंड्रॉइड फेसबुक एसडीके - फेसबुक नोटिफिकेशन कैसे पूछें
- 11. जावा में freedesktop.org नोटिफिकेशन
- 12. वर्तमान नोटिफिकेशन प्राप्त करें
- 13. एंड्रॉइड पर प्रोग्रामिंग रूप से एमएमएस भेजना
- 14. IAudioSessionManager2 नोटिफिकेशन
- 15. वेबकिट एचटीएमएल नोटिफिकेशन में फॉर्म?
- 16. कैसे दिखाएं "आपको पुश नोटिफिकेशन भेजना चाहते हैं" अलर्ट फिर से देखें?
- 17. एंड्रॉइड फोन में हेडफोन जैक के माध्यम से डेटा भेजना
- 18. वेबस्टेज एंड्रॉइड में स्थानीय HTML पथ देखें
- 19. एंड्रॉइड पर पुश नोटिफिकेशन: Google जीसीएम बनाम अमेज़ॅन एसएनएस?
- 20. क्या एंड्रॉइड फर्मवेयर अपडेट नोटिफिकेशन को अक्षम करना संभव है?
- 21. सिल्वरलाइट और पुश नोटिफिकेशन
- 22. UIApplication handleOpenURL नोटिफिकेशन
- 23. PHP - पुश नोटिफिकेशन
- 24. हैंडल पुश नोटिफिकेशन
- 25. मल्टीलाइन नोटिफिकेशन प्रदर्शित करना
- 26. सूची बॉक्स नोटिफिकेशन
- 27. एपीएनएस नोटिफिकेशन ऐप्पल एमडीएम
- 28. डबल जीसीएम नोटिफिकेशन
- 29. आईओएस पुश नोटिफिकेशन वितरण
- 30. आईफोन notify_post नोटिफिकेशन
क्यों यू एक अलार्म – Zamani
मुझे लगता है कि आप सेवा बनाने और उसके बाद समय की जाँच करनी चाहिए का उपयोग नहीं है, लेकिन अधिसूचना दिखाने के लिए यू इसके बारे में पढ़ने चाहिए। =) – Gorets
गोरेट्स, आप बिल्कुल सही हैं, मुझे किसी प्रकार की सेवा का उपयोग करना होगा क्योंकि ऐप बंद होने पर अधिसूचना ट्रिगर की जाएगी। क्या आप मुझे –