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. New AndroidGL Tutorials Posted

Hey Folks,
I've posted up new code for the AndroidGL tutorials on writing OpenGL
programs on Android.  The tutorials have been updated so that they run
correctly on the m5 release.  Check them out at:

http://android-gl.googlecode.com/files/AndroidGL-0.3.zip

They are based on the OpenGL|ES tutorials at zeuscmd.com

I will eventually update the model renderering code as well.

Enjoy!
--brendan
--~--~---------~--~----~------------~-------~--~----~

2. Long list of LogCat error messages from DeviceMonitor

The following slows my system down: From time to time there is a long
list of error messages apparently from the DeviceMonitor. These error
messages stop after some time, and I can continue working. Still, they
slow down my work, and I wonder if anybody else has seen them or has a
hint what could cause them.

Peli

D/        ( 1663):  unable to unlink '/1207175722301' (errno=2)
W/android.server.am.DeviceMonitor( 1663): Couldn't delete
1207175722301.
D/        ( 1663): removing file '/1207175726154'
D/        ( 1663):  unable to unlink '/1207175726154' (errno=2)
W/android.server.am.DeviceMonitor( 1663): Couldn't delete
1207175726154.
D/        ( 1663): removing file '/1207175728084'
D/        ( 1663):  unable to unlink '/1207175728084' (errno=2)
W/android.server.am.DeviceMonitor( 1663): Couldn't delete
1207175728084.
D/        ( 1663): removing file '/1207175730041'
D/        ( 1663):  unable to unlink '/1207175730041' (errno=2)
W/android.server.am.DeviceMonitor( 1663): Couldn't delete
1207175730041.
D/        ( 1663): removing file '/1207175732044'
D/        ( 1663):  unable to unlink '/1207175732044' (errno=2)
W/android.server.am.DeviceMonitor( 1663): Couldn't delete
1207175732044.
D/        ( 1663): removing file '/1207175734108'
D/        ( 1663):  unable to unlink '/1207175734108' (errno=2)
W/android.server.am.DeviceMonitor( 1663): Couldn't delete
1207175734108.
D/        ( 1663): removing file '/1207175736225'
D/        ( 1663):  unable to unlink '/1207175736225' (errno=2)
W/android.server.am.DeviceMonitor( 1663): Couldn't delete
1207175736225.
D/        ( 1663): removing file '/1207175738331'
D/        ( 1663):  unable to unlink '/1207175738331' (errno=2)
W/android.server.am.DeviceMonitor( 1663): Couldn't delete
1207175738331.
D/        ( 1663): removing file '/1207175741504'
--~--~---------~--~----~------------~-------~--~----~

3. Creating events

4. How to add image to menuitem

5. Changing background color of button

6. synching a mobile app with an external database server

7. ButtonStyleRight -- no ButtonStyleLeft?