Posts

Showing posts with the label android notification channel

Notification with expandable custom layout

Image
Android Notification using custom layout with Text & Image In this tutorial we will do the followings: 1) Make/Show Notification (expandable) 2) Custom layout xml for notification 3) Image and Text in custom layout Video Step 1:  Create a new project   OR   Open your project Step 2: In res folder create two resource layout files named custom_normal.xml and custom_expanded.xml Step 3: Place an image in drawable folder to show in notification Step 4: Code: custom_normal.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:layout_width= "match_parent" android:layout_height= "match_parent" android:orientation= "horizontal" > <ImageView android:layout_width= "40dp" android:layout_height= "40dp" android:src= "@drawable/logo_atif" /> ...

Notification with action buttons - Java

Image
Show Notification, Add action button, handle button clicks In this tutorial we will learn the followings: ✓How to show notifications ✓How to add action buttons in notification ✓Handle action button clicks Video: Step 1:  Create a new project   OR   Open your project Step 2: Create two activities 1) LikeActivity 2) DislikeActivity Step 3: Code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" tools:context= ".MainActivity" > <Button android:id= "@+id/showNotificationBtn" android:layout_width= "wrap_content" and...

Show Notifications on any device - Java

Image
Working with android notifications using Android Studio and Java In this video we will simply show notification on clicking of button. The notification will work on any Android OS. Video Step 1:  Create a new project   OR   Open your project Step 2: Code: activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" tools:context= ".MainActivity" > <Button android:id= "@+id/showNotificationBtn" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:text= "Show Notification...