Simple Notification in Android

Image
Notifications are a way to provide information to your customer which displays as a pop up on the device. It helps you to keep in touch with your customer. I am going to create a simple notification without going deep because everything is available on Google. We must understand a few concepts before going further. Notification channel:  Assume you have developed an app for an online learning center where they teach Maths and English. Students can either learn Maths, English, or Both. we must send notification related to Maths to only students who have taken Maths. In this case, we can create channels for Maths, English, and both so triggered notification will be delivered to students who have taken that subject. Each Notification channel can have a different Notification sound and different behavior that you can change from the Notification setting page. I forgot to tell you that Google has introduced the Notification channel from Android 8.0 i.e API level 26. Now yo...

Custom font in android

if u want to apply custom font to your textview text or button follow the below steps..
1. go to google n download the font and keep them inside ur assets folder.
2.suppose u want to apply custom font to ur textview text:

 TextView t1 = (TextView)findViewById(R.id.txtAmount);

Typeface face1 = Typeface.createFromAsset(activity.getAssets(),"Arvo-Regular.ttf");
//where Arvo-Regular.ttf referes to your font which is placed inside ur assets folder.

 t1.setTypeface(face1);
//it will set the font of ur textview

same way u have to do it for buttons etc..

ex..


                Typeface face1 = Typeface.createFromAsset(ctx.getAssets(),"Arvo-Regular.ttf");
       TextView t1 = (TextView)findViewById(R.id.txtAmount);
                  t1.setTypeface(face1);

Comments

Popular posts from this blog

Webview data directory for Android 9 (Pie)

Tabs in Android

DatePicker in Android