Android - How do we make notification visible once application is installed?

by paresh mayani » Fri, 18 Mar 2011 14:40:30 GMT


Sponsored Links
 Hi,

As per my this question, i have written the below code to show
notification and also made a notification steady at the notification
bar.

private void showNotification()
{
        CharSequence title = "Hello";
        CharSequence message = "Notification Demo";

        NotificationManager notificationManager =
(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
        Notification notification = new Notification(R.drawable.icon,
"A Notification", System.currentTimeMillis());
        Intent notificationIntent = new Intent(this,
Main_Activity.class);
        PendingIntent pendingIntent = PendingIntent.getActivity(this,
0, notificationIntent, 0);

        notification.setLatestEventInfo(Main_Activity.this, title,
message, pendingIntent);
        notification.flags = Notification.FLAG_NO_CLEAR;
        notificationManager.notify(NOTIFICATION_ID, notification);
}

But, is there any way to make a notification visible once the
application is installed in the phone? I think there should be any
scenario/method/file in which we can write this code and notification
will be visible as soon as the application gets installed in the
phone.

Again i am taking an example of "yahoo mail" application, in the same
application, once we installed the yahoo application, the notification
is appeared with icon at the same time.

Please share your ideas and suggestions.

-- 



Android - How do we make notification visible once application is installed?

by paresh mayani » Fri, 18 Mar 2011 14:43:50 GMT


 Hi,

As per my this question, i have written the below code to show
notification and also made a notification steady at the notification
bar.

private void showNotification()
{
        CharSequence title = "Hello";
        CharSequence message = "Notification Demo";

        NotificationManager notificationManager =
(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
        Notification notification = new Notification(R.drawable.icon,
"A Notification", System.currentTimeMillis());
        Intent notificationIntent = new Intent(this,
Main_Activity.class);
        PendingIntent pendingIntent = PendingIntent.getActivity(this,
0, notificationIntent, 0);

        notification.setLatestEventInfo(Main_Activity.this, title,
message, pendingIntent);
        notification.flags = Notification.FLAG_NO_CLEAR;
        notificationManager.notify(NOTIFICATION_ID, notification);
}

But, is there any way to make a notification visible once the
application is installed in the phone? I think there should be any
scenario/method/file in which we can write this code and notification
will be visible as soon as the application gets installed in the
phone.

Again i am taking an example of "yahoo mail" application, in the same
application, once we installed the yahoo application, the notification
is appeared with icon at the same time.

Please share your ideas and suggestions.

-- 


Sponsored Links


Re: Android - How do we make notification visible once application is installed?

by TreKing » Sat, 19 Mar 2011 09:52:17 GMT


 



No. The user must run an app once it's installed.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 



Other Threads

1. High "Battery Usage", but no "Use details" listed

The battery usage shows usage from when the device was last unplugged.  When
it is plugged in the stats are stopped, because you are now on power so
nothing you can do is going to use battery.  (And when you then next unplug,
the stats are reset and start collecting again.)






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

2. duration and loopiness of sound

I want to get the duration of a ringtone, so I do this:

MediaPlayer mp = MediaPlayer.create(context, sound);
duration = mp.getDuration();

I have two questions:

1. Is there another way of getting the duration?  Maybe I can get it
from the library meta data so that I don't have to create a
MediaPlayer for it when I don't want to actually play it.

2. How do I find out if the sound is a looping sound?  Again, without
playing it.

Thanks in advance

Neil

--~--~---------~--~----~------------~-------~--~----~

3. PVMFFailure when using MediaPlayer for radio streams

4. Android design issue about cts test case "testThreadCpuTimeNanos"?

5. How to draw 3D objects on a MapView

6. changing the shape of Button

7. Android activity as overlay over other app