Assignment #2 AP
Assignment #2 AP
Assignment #2 AP
FILE SUBMITTED TO
GIAN JYOTI INSTITUTE OF MANAGEMENT
&
TECHNOLOGY
PHASE-2, MOHALI
AFFILIATED TO
Here's a diagram that shows the different Android lifecycle events: onCreate()
|
onStart()
|
onResume()
|
User interacts
|
onPause()
|
onStop()
|
onDestroy()
Vector drawables: used to display vector graphics that can be scaled without losing quality.
android:id="@+id/spinner_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
Ans.Notifications are a way for Android apps to display important information to the user outside of the app itself.
Here's an example program that shows how to create a simple notification in Android:
1. Create a NotificationChannel:
This code creates a new notification channel with the ID "channel_id" and the name "Channel Name". This step is
required for Android 8.0 (API level 26) and higher.
2. Create a Notification
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "channel_id")
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle("My Notification Title")
.setContentText("This is my notification text.")
.setPriority(NotificationCompat.PRIORITY_DEFAULT);