Mad Microproject
Mad Microproject
Mad Microproject
MICRO PROJECT
Certificate
This is to certify that Mr. /Ms Ritu Rajendra Kamble, Nilakshi Naresh Kudu,
Jagruti Mahesh Chavan, Jill Hitesh Machhi of FIFTH Semester of Diploma
in Computer Engineering.
SEAL OF
INSTITUTE
Part A: Micro Project Proposal
The aim of this microproject is to develop a functional alarm clock application for mobile
devices using Android platform. It covers fundamental concepts of Android app development
such as user interface design, event handling, notifications, and background services.
Additionally, it allows students to apply their knowledge of Java programming language within
the context of mobile application development.
1. Literature Review
2. Data Collection
3. Requirements Gathering
4. Implementation
5. Testing and Debugging
6. Documentation
7. Iteration and Feedback
4.0 Action Plan
(06) (04)
2. Literature Survey/Information
Collection
3. Project Proposal
6. Quality of Prototype/Model
7. Report Preparation
8. Presentation
9. Viva
Micro-Project Evaluation Sheet
Title: ALARM CLOCK
Institute Code: 0093 Academic year: 2023-24
Program: Computer Engineering Course & Code: MAD (22617)
Name of Candidate: Roll No: 1864,65,66,68
Semester: Sixth Name of Faculty: Prof. Rajesh Garud
5 Quality of Prototype/Model/Content
6 Report Preparation
7 Presentation .
8 Viva
1 Introduction 1
2 Technical Requirement 2
5 Output 8
6 Conclusion 9
7 References 10
1. Introduction
The ubiquity of smartphones has made them an indispensable part of our lives, serving as not
just communication devices but also as powerful tools for productivity and utility. Among the
myriad of functionalities, alarm clock applications stand out as one of the most essential and
frequently used features. These applications help users manage their schedules, ensure timely
wake-ups, and stay organized throughout the day.
In the realm of mobile application development, creating an alarm clock application offers a
rich learning experience. It delves into various aspects of software development, including user
interface design, event handling, background services, and notifications. Moreover, it provides
an opportunity to apply core programming concepts within the context of mobile platforms.
This microproject aims to guide students through the process of developing a functional alarm
clock application for Android devices. By undertaking this project, students will gain practical
insights into mobile app development while honing their skills in Java programming and
Android framework usage.
Throughout this microproject, we will explore the intricacies of designing an intuitive user
interface, implementing alarm functionalities, managing background services, and ensuring
seamless user experience. By the end, students will not only have a fully functional alarm clock
application but also a deeper understanding of mobile application development principles and
practices.
Join us on this journey as we embark on the exciting adventure of building an alarm clock
application that combines functionality with elegance, tailored for the modern mobile user.
1
2. Technical Requirement
Before diving into the development process of the alarm clock application, it's essential to
ensure that the necessary software and hardware requirements are met. Here's an overview of
the technical requirements for this microproject:
1. Development Environment:
- Android Studio: The official integrated development environment (IDE) for Android app
development. It provides tools for designing layouts, writing code, debugging, and more.
- Java Development Kit (JDK): Android apps are primarily written in Java, so the JDK is
required for compiling Java code.
- SDK Platforms: Android Studio requires specific SDK platforms and tools for compiling
and testing Android applications. Ensure that the necessary SDK components are installed
through the SDK Manager.
2. Hardware Requirements:
- Computer: A desktop or laptop computer capable of running Android Studio and
emulators.
- Android Device (Optional): While Android emulators can be used for testing, having a
physical Android device for testing real-world scenarios is beneficial. Ensure that the device
supports the minimum Android version targeted by the application.
4. Internet Connection:
- An internet connection is required for downloading necessary dependencies, SDK
components, and updates within Android Studio.
2
3. User Interface Design
The user interface (UI) design plays a crucial role in the success of any mobile application,
including alarm clock apps. A well-designed UI not only enhances the aesthetic appeal of the
app but also improves usability and user experience. Here's an overview of the user interface
design considerations for the alarm clock application:
xml files:
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AlarmClock"
tools:targetApi="31">
<activity
android:name=".NotificationActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<receiver android:name=".AlarmReceiver"/>
</application>
</manifest>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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"
android:orientation="vertical"
android:gravity="center_vertical"
android:background="@drawable/alarm"
3
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select\nTime"
android:id="@+id/selectTime"
android:textSize="40sp"
android:layout_marginTop="280dp"
android:layout_gravity="center_horizontal"
android:textColor="@color/white"
android:textAlignment="center"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="@+id/setAlarm"
android:text="Set \nAlarm"
android:textSize="20sp"
android:padding="8dp"
android:layout_marginStart="40dp"
android:layout_marginTop="250dp"/>
<Button
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="@+id/cancelAlarm"
android:text="Cancel \nAlarm"
android:textSize="20sp"
android:padding="8dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="250dp"
android:layout_marginEnd="40dp"/>
</RelativeLayout>
</LinearLayout>
activity_notifications.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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=".NotificationActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome to \nNotification Activity"
android:textSize="36sp"
android:textAlignment="center"
android:textColor="@color/lavender"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
4
4. Implementation: Code
To implement the user interface design for the alarm clock application in Android, you'll need
to work with XML layout files and possibly Java code for dynamic interactions. Below are
snippets demonstrating how to create some of the key UI components mentioned earlier. Note
that this is a simplified example, and you'll need to integrate it into your project according to
your specific requirements.
java files:
MainActivity.java
package com.example.microproject;
import android.app.AlarmManager;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.microproject.databinding.ActivityMainBinding;
import com.google.android.material.timepicker.MaterialTimePicker;
import com.google.android.material.timepicker.TimeFormat;
import java.util.Calendar;
createNotificationChannel();
binding.selectTime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
timePicker = new MaterialTimePicker.Builder()
.setTimeFormat(TimeFormat.CLOCK_12H)
.setHour(12)
.setMinute(0)
.setTitleText("Select Alarm Time")
.build();
timePicker.show(getSupportFragmentManager(), "microproject");
timePicker.addOnPositiveButtonClickListener(new
View.OnClickListener() {
@Override
public void onClick(View view) {
if (timePicker.getHour() > 12){
binding.selectTime.setText(
String.format("%02d",(timePicker.getHour()-12))
+":"+ String.format("%02d", timePicker.getMinute())+"PM"
5
);
} else {
binding.selectTime.setText(timePicker.getHour()+":" +
timePicker.getMinute()+ "AM");
}
calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, timePicker.getHour());
calendar.set(Calendar.MINUTE, timePicker.getMinute());
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
}
});
}
});
binding.setAlarm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
alarmManager = (AlarmManager)
getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(MainActivity.this,
NotificationActivity.class);
pendingIntent = PendingIntent.getBroadcast(MainActivity.this, 0,
intent, PendingIntent.FLAG_IMMUTABLE);
alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP,
calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);
Toast.makeText(MainActivity.this, "Alarm Set",
Toast.LENGTH_SHORT).show();
}
});
binding.cancelAlarm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this,
NotificationActivity.class);
// pendingIntent = PendingIntent.getBroadcast(MainActivity.this, 0,
intent, 0);
if (alarmManager == null){
alarmManager = (AlarmManager)
getSystemService(Context.ALARM_SERVICE);
}
alarmManager.cancel(pendingIntent);
Toast.makeText(MainActivity.this, "Alarm Canceled",
Toast.LENGTH_SHORT).show();
}
});
NotificationManager notificationManager =
getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
}
}
}
6
NotificationActivity.java
package com.example.microproject;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
NotificationManagerCompat notificationManagerCompat =
NotificationManagerCompat.from(context);
if (ActivityCompat.checkSelfPermission(context,
android.Manifest.permission.POST_NOTIFICATIONS) !=
PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[]
permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the
documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
notificationManagerCompat.notify(123, builder.build());
}
}
7
5. Output
8
6. Conclusion
In conclusion, the development of the alarm clock application has been a rewarding journey in
the field of mobile application development. This project has provided valuable insights into
the intricacies of designing and implementing user-centric solutions for everyday challenges.
Through careful planning and execution, the project has successfully delivered an intuitive and
functional alarm clock application for Android devices. By leveraging Android's rich set of
tools and libraries, we've created an application that simplifies the process of setting and
managing alarms, enhancing user productivity and convenience.
The project's focus on usability and reliability has been paramount. By incorporating features
such as a user-friendly interface and timely notifications, we've ensured that users can rely on
the application to fulfill their alarm needs consistently.
Looking ahead, there are numerous opportunities for further refinement and expansion of the
application. Future iterations could explore enhancements such as customizable alarm tones,
advanced scheduling options, and integration with other productivity tools to offer a
comprehensive alarm management experience.
Overall, the alarm clock project underscores the potential of mobile applications to address
real-world needs effectively. It serves as a testament to the power of innovation and
collaboration in creating solutions that improve the daily lives of users.
9
7. Reference
1. https://androidknowledge.com/
2. https://chat.openai.com/
3. https://www.google.com/
4. https://developer.android.com/
10