Posts

Showing posts with the label notification in Android

Code for implementing Notifications in Sketchware

Image
This tutorial shows a Sketchware android project example in which a Notification is displayed when a Button is clicked and when the Notification is clicked, it opens a new Activity. 1. Create a new project in Sketchware. In VIEW area add an EditText  edittext1 , and a Button button1 . 2. Using Image Manager add an images  mail_white . This will be used as the Notification icon. 3. In Library manager switch on  AppCompat and Design . 4. Create a new VIEW two.xml / TwoActivity.java . 5. Add a More Block:   createChannel . 6. In More Block  createChannel , use add source directly block and put following code: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { CharSequence name = "Channel name 1"; String description = "Notification channel"; int importance = NotificationManager.IMPORTANCE_DEFAULT; NotificationChannel channel = new NotificationChannel("id 1", name, importance); channel.setDescription(description); Notifi...