Found 1631 Articles for Android

How to check if an Android app is allowed to show notification?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

136 Views

This example demonstrate about Android NotificationBuilder.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; public class MainActivity extends AppCompatActivity {    public static final String NOTIFICATION_CHANNEL_ID = "10001" ;    private final static String default_notification_channel_id = "default" ;    @Override    protected void ... Read More

What are the sizes of the icons in Android notifications action-buttons?

Smita Kapse
Updated on 30-Jul-2019 22:30:26

108 Views

Asset Size: 32dp x 32dp Optical Square: 24dp x 24dp Color (Enabled): #FFFFFF 80% opacity Color (Disabled): #FFFFFF 30% opacityClick  here  to download the project code

Android NotificationBuilder Example

Anvi Jain
Updated on 30-Jul-2019 22:30:26

79 Views

This example demonstrate about Android NotificationBuilder.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; public class MainActivity extends AppCompatActivity {    public static final String NOTIFICATION_CHANNEL_ID = "10001" ;    private final static String default_notification_channel_id = "default" ;    @Override    protected void ... Read More

How to give emojis support in Android push notification?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

390 Views

This example demonstrate about How to give emojis support in Android push notificationStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; public class MainActivity extends AppCompatActivity {    public static final String NOTIFICATION_CHANNEL_ID = "10001" ;    private final static String default_notification_channel_id = "default" ... Read More

How to create an Android notification with a longer text?

Smita Kapse
Updated on 30-Jul-2019 22:30:26

284 Views

This example demonstrate about How to create an Android notification with a longer textStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; public class MainActivity extends AppCompatActivity {    public static final String NOTIFICATION_CHANNEL_ID = "10001" ;    private final static String default_notification_channel_id ... Read More

How to implement expand and collapse notification in Android?

Anvi Jain
Updated on 30-Jul-2019 22:30:26

678 Views

This example demonstrate about How to implement expand and collapse notification in Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; public class MainActivity extends AppCompatActivity {    public static final String NOTIFICATION_CHANNEL_ID = "10001" ;    private final static String default_notification_channel_id = "default" ... Read More

How to set Large icon instead of small icon on Android Notification?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

2K+ Views

This example demonstrate about How to set Large icon instead of small icon on Android Notification .Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.graphics.BitmapFactory ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; import android.widget.RemoteViews ; public class MainActivity extends AppCompatActivity {    public static final String NOTIFICATION_CHANNEL_ID ... Read More

How can I marquee the text content in Android Notification?

Smita Kapse
Updated on 30-Jul-2019 22:30:26

220 Views

This example demonstrate about How can I marquee the text content in Android Notification.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to res/layout/custom_notification_layout.xml.             Step 4 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; import android.widget.RemoteViews ; public class ... Read More

How to clear an Android notification if activity crashes?

Anvi Jain
Updated on 30-Jul-2019 22:30:26

155 Views

This example demonstrate about How to clear an Android notification if activity crashesStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.app.PendingIntent ; import android.content.Intent ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; public class MainActivity extends AppCompatActivity {    public static final String NOTIFICATION_CHANNEL_ID = "10001" ;    private ... Read More

How to change notification background colour in Android?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

1K+ Views

This example demonstrate about How can I marquee the text content in Android Notification.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to res/layout/custom_notification_layout.xml.             Step 4 − Add the following code to src/MainActivity.package app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; import android.widget.RemoteViews ; public class MainActivity ... Read More

Advertisements