Found 2040 Articles for Mobile Development

Start an Activity from a Notification in Android?

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

1K+ Views

This example demonstrate about Start an Activity from a 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.javapackage app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.app.PendingIntent ; import android.content.Context ; import android.content.Intent ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; import android.view.View ; import android.widget.Button ; public class MainActivity extends AppCompatActivity {    public static final String ... Read More

How to group android notifications like whatsapp?

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

864 Views

This example demonstrate about How to group android notifications like whatsappStep 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.javapackage app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.content.Context ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; import android.view.View ; import android.widget.Button ; public class MainActivity extends AppCompatActivity {    public static final String NOTIFICATION_CHANNEL_ID = "10001" ;    private final ... Read More

Custom Notification Sounds for Android Oreo and Beyond?

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

2K+ Views

This example demonstrate about Custom Notification Sounds for Android Oreo and BeyondStep 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 a sound into raw folderStep 4 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.content.ContentResolver ; import android.content.Context ; import android.graphics.Color ; import android.media.AudioAttributes ; import android.net.Uri ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; import android.view.View ; ... Read More

Create and Manage Notification Channels in Android

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

3K+ Views

This example demonstrate about Create and Manage Notification Channels 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 a sound into raw folderStep 4 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.content.ContentResolver ; import android.content.Context ; import android.graphics.Color ; import android.media.AudioAttributes ; import android.net.Uri ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; import android.view.View ; import ... Read More

Android Notification Example with Vibration, Sound, Action and Big View Styles

Chandu yadav
Updated on 30-Jul-2019 22:30:26

480 Views

This example demonstrate about Android Notification Example with Vibration, Sound, Action and Big View StylesStep 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.javapackage app.tutorialspoint.com.notifyme; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.support.v4.app.NotificationCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity {    private final static String default_notification_channel_id = "default";    @Override    protected void onCreate (Bundle ... Read More

How to play an android notification sound?

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

545 Views

This example demonstrate about How to play ringtone/alarm/notification sound 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.javapackage app.tutorialspoint.com.notifyme; import android.app.NotificationManager; import android.content.Context; import android.media.MediaPlayer; import android.media.RingtoneManager; import android.net.Uri; import android.support.v4.app.NotificationCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import java.util.Objects; public class MainActivity extends AppCompatActivity {    private final static String default_notification_channel_id = "default";    @Override    protected void onCreate (Bundle ... Read More

How to play ringtone/alarm/notification sound in Android?

George John
Updated on 03-Jul-2020 08:02:25

3K+ Views

This example demonstrate about How to play ringtone/alarm/notification sound 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.javapackage app.tutorialspoint.com.notifyme; import android.app.NotificationManager; import android.content.Context; import android.media.MediaPlayer; import android.media.RingtoneManager; import android.net.Uri; import android.support.v4.app.NotificationCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import java.util.Objects; public class MainActivity extends AppCompatActivity {    private final static String default_notification_channel_id = "default";    @Override    protected void onCreate (Bundle ... Read More

How do I add Vibrate and sound for Notification in Android?

Chandu yadav
Updated on 03-Jul-2020 08:01:46

2K+ Views

This example demonstrate about How do I add Vibrate and sound for 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.javapackage app.tutorialspoint.com.notifyme; import android.app.NotificationManager; import android.content.Context; import android.media.RingtoneManager; import android.net.Uri; import android.support.v4.app.NotificationCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import java.util.Objects; public class MainActivity extends AppCompatActivity {    private final static String default_notification_channel_id = "default" ;    @Override    protected ... Read More

How to set android notification icon?

Arjun Thakur
Updated on 03-Jul-2020 08:00:31

2K+ Views

This example demonstrate about How to set android notification iconStep 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.javapackage app.tutorialspoint.com.notifyme; import android.app.NotificationManager; import android.content.Context; import android.support.v4.app.NotificationCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import java.util.Objects; public class MainActivity extends AppCompatActivity {    private final static String default_notification_channel_id = "default";    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState); ... Read More

How to lock & unlock the iOS device programmatically

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

674 Views

Locking of iOS device cannot be done programmatically without the use of Private API’s. One such private API’s GSEventLockDevice() (private API) from GraphicsServices.framework which might help you achieve your persona but the application would result in rejection from Apple’s App Store.More over there’s no documentation provided by apple for the same.On a final note you cannot achieve this functionality without using the Private API’s and if you are using your application will be rejected by Apple.

Advertisements