Found 2041 Articles for Mobile Development

How to display count of notifications in Android app launcher icon?

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

2K+ Views

This example demonstrate about How to display count of notifications in Android app launcher icon.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.                                                                         Let's try to run your application. I assume you have connected ... Read More

How to implement an Android notification action without opening the app?

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

1K+ Views

This example demonstrate about How to implement an Android notification action without opening the app.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.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" ... Read More

How to use Notification.deleteIntent in Android?

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

514 Views

This example demonstrate about How to use Notification.deleteIntent in AndroidStep 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 final static ... Read More

How to start a service from notification in Android?

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

770 Views

This example demonstrate about How to start a service from 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.AlarmManager ; import android.app.PendingIntent ; import android.content.Intent ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; import java.util.Calendar ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super ... Read More

How to Create a Reminder Notification in Android?

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

3K+ Views

This example demonstrate about How to Create a Reminder Notification in AndroidStep 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.AlarmManager ; import android.app.PendingIntent ; import android.content.Intent ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; import java.util.Calendar ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState) ... Read More

How to make an Android status bar notification persist across phone reboot?

Nishtha Thakur
Updated on 03-Jul-2020 11:54:06

354 Views

This example demonstrate about How to make an Android status bar notification persist across phone rebootStep 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.os.Bundle ; import android.support.v7.app.AppCompatActivity ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState) ;       setContentView(R.layout. activity_main ) ;    } }Step 4 − Add ... Read More

Start and stop an Android notification from broadcast receiver?

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

535 Views

This example demonstrate about Start and stop an Android notification from broadcast receiverStep 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.os.Bundle ; import android.support.v7.app.AppCompatActivity ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState) ;       setContentView(R.layout. activity_main ) ;    } }Step 4 − Add the following code ... Read More

How to create an Android notification with expiration date?

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

644 Views

This example demonstrate about How to create an Android notification with expiration dateStep 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.AlarmManager ; import android.app.DatePickerDialog ; import android.app.Notification ; import android.app.PendingIntent ; import android.content.Context ; import android.content.Intent ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; import android.widget.Button ; import android.widget.DatePicker ; import java.text.SimpleDateFormat ; import ... Read More

How to create everyday notifications at certain time in Android?

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

2K+ Views

This example demonstrate about How to create everyday notifications at certain time in AndroidStep 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.AlarmManager ; import android.app.DatePickerDialog ; import android.app.Notification ; import android.app.PendingIntent ; import android.content.Context ; import android.content.Intent ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; import android.widget.Button ; import android.widget.DatePicker ; import java.text.SimpleDateFormat ; import ... Read More

How to set an Android notification to a specific date in the future?

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

2K+ Views

This example demonstrate about How to set an Android notification to a specific date in the future.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.AlarmManager ; import android.app.DatePickerDialog ; import android.app.Notification ; import android.app.PendingIntent ; import android.content.Context ; import android.content.Intent ; import android.os.Bundle ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; import android.widget.Button ; import android.widget.DatePicker ; ... Read More

Advertisements