Skip to content

The Calendar app is built using Kotlin and Jetpack Compose, designed to help users manage their tasks efficiently. It provides a calendar view, task management features, and seamless navigation between months.

Notifications You must be signed in to change notification settings

vharsoor/MyCalender

 
 

Repository files navigation

Android Calendar App – Custom Fork Overview

This Android calendar app is built on top of the vanilla MyCalendar app (https://github.com/sudhanshuGt/MyCalender).
The original folder structure is preserved to ensure compatibility and smooth integration.

Edge Calendar Project Structure – File Purposes


1. presentation → view

Path: Edge_Calendar/Main/app/src/main/java/dev/sudhanshu/calender/presentation/view

File Purpose
AddShoppingDialog.kt Composable/Dialog that lets the user add a new shopping‑list item.
AddTaskDialog.kt Dialog UI for creating a calendar task with title, date and reminder.
AlarmReceiver.kt BroadcastReceiver triggered by AlarmManager to fire scheduled task/meeting notifications.
AppLauncher.kt Utility that dispatches the correct first screen (Splash → Main) when the app starts.
CalendarModels.kt Data classes representing calendar entities such as Task, Event, Reminder.
CalendarWidget.kt App‑widget provider that renders upcoming events on the device home screen.
CalenderTaskScreen.kt Jetpack‑Compose screen for viewing a single day’s task list.
CalenderTasks.kt Helper component that aggregates and formats tasks for UI presentation.
DeviceAdminReceiver.kt Enables device‑admin features (e.g., setting lock‑screen PIN for reminders).
EventServer.kt Local HTTP/WebSocket server used for syncing events with external calendar services.
FetchEvents.kt Coroutine job that fetches and caches events from Google Calendar / event server.
GoogleSignIn.kt Handles Google OAuth flow and returns a signed‑in Google account token.
InsertTask.kt Repository helper that writes a new Task entity to the Room database.
LockScreenManager.kt Grants/revokes device‑admin rights and shows custom lock‑screen reminders.
MainActivity.kt Single‑activity entry point that hosts the Compose Navigation graph.
Meeting.kt Data model (plus small helpers) for meeting objects, incl. duration & participants.
NotificationReceiver.kt BroadcastReceiver that displays high‑priority notifications for due tasks/meetings.
OpenCalendarAction.kt Convenience intent builder to deep‑link into the system calendar app.
ShoppingListActivity.kt Legacy XML‑based activity that shows and edits the shopping list.
Splash.kt Splash‑screen composable that loads preferences and navigates to MainActivity.
TaskListScreen.kt Compose screen showing all tasks grouped by day and status.
contact.kt Simple helper that opens a “contact developer” email intent.
eventDB.kt DAO façade that exposes high‑level DB operations for Event entities.
setupEventDB.kt One‑time Room pre‑population script that seeds sample events.

Sub‑directories

Directory Purpose
dao/ Room DAO interfaces used by repositories.
database/ Room database implementation and migrations.
model/ Shared plain‑model data classes (used outside view).
ui/ Shared Compose UI components (buttons, cards, theme).

2. AndroidManifest.xml

Path: Edge_Calendar/Main/app/src/main/AndroidManifest.xml

Declares application package, activities, receivers, services, required permissions (INTERNET, RECEIVE_BOOT_COMPLETED, etc.) and widget provider meta‑data.


3. Gradle Scripts (root)

Path: Edge_Calendar/Main

File Purpose
build.gradle.kts Root Gradle script: sets Kotlin/Compose versions and configures allmodules plugin blocks.
settings.gradle.kts Defines project name Edge_Calendar and includes :app module.
gradle.properties JVM and Compose compiler flags, plus API keys read at build time.
gradlew / gradlew.bat OS‑specific Gradle wrappers ensuring a fixed Gradle version is used.
local.properties Local Android‑SDK path (ignored in VCS).
README.md High‑level setup & contribution instructions for developers.
.gitignore Git‑ignore patterns for build outputs, IDE folders, and secrets.

Directories

Directory Purpose
gradle/ Wrapper JARs & helper scripts used by Gradle wrapper.
.gradle/ Local Gradle build cache (generated).
.idea/ IntelliJ/Android‑Studio project settings.
.git/ Git repository metadata.
secret/ Placeholder directory for API keys placed outside VCS.

4. res/layout

Path: Edge_Calendar/Main/app/src/main/res/layout

File Purpose
activity_pin_verification.xml XML layout for the PIN entry screen shown when unlocking protected features.
dialog_schedule_meeting.xml Custom dialog layout for picking meeting date/time and participants.
managed_web_view.xml Layout that hosts a WebView configured for authenticated calendar pages.
widget_placeholder.xml Simple RemoteViews layout displayed when the calendar widget has no data.

5. res/values

Path: Edge_Calendar/Main/app/src/main/res/values

File Purpose
colors.xml Central palette of brand and semantic colors used across the app UI.
dimens.xml Dimension constants (margins, text sizes) to ensure consistent spacing.
font_certs.xml Font provider certificate set for downloading Google Fonts at runtime.
ic_launcher_background.xml Vector drawable defining the solid background behind the launcher icon.
strings.xml Holds localisable UI text and OAuth credentials such as <string name="web_client_id"> and <string name="client_secret">.
themes.xml Material3 theme definitions for light and dark modes, referencing colors.xml.

Running & Testing the Calendar App

Prerequisites

  • Android Studio Hedgehog (or newer) with JDK 17.
  • Android SDK Platform 34 (Android 14) + latest Google Play services.
  • A Google account with access to Google Cloud Console.

Step‑by‑Step Guide

  1. Open the project in Android Studio
    • Launch Android Studio ➜ Open and select the Edge_Calendar/Main directory that is already on your machine.
    • Wait for Gradle to sync and download dependencies.

  2. Generate a debug SHA‑1
    In Android Studio, run Gradle > Tasks > android > signingReport. Copy the Debug SHA‑1 fingerprint that appears in the Run window.

  3. Create Google API credentials & obtain Web Client ID
    Follow Google’s guide: https://developer.android.com/identity/sign-in/credential-manager-siwg#set-google.
    • Choose Android as the application type.
    • Enter the package name dev.sudhanshu.calender.
    • Paste your debug SHA‑1 fingerprint.
    After saving, copy the Web client ID displayed in the OAuth credential details (it ends with .apps.googleusercontent.com).

  4. Enable required APIs
    In APIs & Services → Library, search and enable:
    Google Calendar API
    Gmail API (if you plan to access Gmail data)

  5. Configure OAuth consent screen
    Add scopes:
    https://www.googleapis.com/auth/calendar (and any additional Calendar scopes)
    https://www.googleapis.com/auth/gmail.* (all Gmail scopes you require)

  6. Insert credentials into the app
    Edit Edge_Calendar/Main/app/src/main/res/values/strings.xml and update the existing keys:

    <string name="web_client_id">YOUR_WEB_CLIENT_ID.apps.googleusercontent.com</string>
    <string name="client_secret">YOUR_CLIENT_SECRET</string>

    Replace YOUR_WEB_CLIENT_ID with the value copied in step 3.

  7. Build & run
    Select an Android 14 (API 34) emulator or a physical device with Google Play services, then click Run ▶.


Branching Strategy

Features are developed on separate branches and merged into the main branch only after full implementation and testing.

Branch: feature/googlemeet (latest branch in development)

This branch includes:

  • In‑progress App Widget code (CalendarWidget.kt)
  • Completed implementation of:
    • Google Sign‑In
    • FCM token generation
    • Receiving notifications
    • Alarm scheduling
    • Local notifications via snackbar
  • Commented code related to Device Admin / App Pinning (kept for potential future use).

Debug Log Tags

Use the following log tags to trace feature‑specific workflows:

Tag Purpose
DayViewWidget Logs related to the in‑progress App Widget.
CalendarIntegration Tracks Google Sign‑In flow and access‑token retrieval.
Reminder Follows the reminder pipeline: fetch → alarm → broadcast → snackbar.
GoogleContacts Logs pulling Google Contacts using the access token.
FCM Token Logs generation and server sync of the FCM token during first‑time install.

About

The Calendar app is built using Kotlin and Jetpack Compose, designed to help users manage their tasks efficiently. It provides a calendar view, task management features, and seamless navigation between months.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%