From 7831d559802f3995e26369811c4d90ad4e4763f9 Mon Sep 17 00:00:00 2001 From: himpat202 <67184411+himpat202@users.noreply.github.com> Date: Mon, 30 Aug 2021 14:52:40 +0530 Subject: [PATCH 1/2] Update README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 63d7bd1..cde3f69 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ -# Nullvoid_Subscription-Manager \ No newline at end of file +# Nullvoid_Subscription-Manager +This is a subscription manager project. +Today there are lots of subscription provider like Amazon Prime, Netflix, LinkedIn etc where new users take their subscription and forgot to cancel it before ending of subscription. +The main purpose for making this project is to help user to get rid out of tedious task of remembering the dates of renewals and auto-renewals. +User has to just install this app from this repo in your smartphone and just add the starting date of subscription and duration of subscription . Just leave rest on this app and it will save your money from getting it auto-renenwed. + + + ----------HOW TO INSTALL---------- + 1) On the rightmost side of repo there you can see 'Releases' section . + 2) Click on "Subscription Manager" + 3) Finally click on "SM.v1.1.apk" and install it , now you are ready to use it. From a6b99f16e7c5df4f3788a0df084e0794eb91e77a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 Aug 2021 18:18:57 +0530 Subject: [PATCH 2/2] calender --- .idea/.gitignore | 3 -- .idea/compiler.xml | 6 --- .idea/gradle.xml | 20 ---------- .idea/jarRepositories.xml | 30 --------------- .idea/misc.xml | 9 ----- .idea/runConfigurations.xml | 10 ----- README.md | 11 ------ .../subscriptionmanager/EditorActivity.java | 37 +++++++++++++++++++ 8 files changed, 37 insertions(+), 89 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/jarRepositories.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/runConfigurations.xml delete mode 100644 README.md diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 61a9130..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 5cd135a..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index 0380d8d..0000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index d5d35ec..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index cde3f69..0000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Nullvoid_Subscription-Manager -This is a subscription manager project. -Today there are lots of subscription provider like Amazon Prime, Netflix, LinkedIn etc where new users take their subscription and forgot to cancel it before ending of subscription. -The main purpose for making this project is to help user to get rid out of tedious task of remembering the dates of renewals and auto-renewals. -User has to just install this app from this repo in your smartphone and just add the starting date of subscription and duration of subscription . Just leave rest on this app and it will save your money from getting it auto-renenwed. - - - ----------HOW TO INSTALL---------- - 1) On the rightmost side of repo there you can see 'Releases' section . - 2) Click on "Subscription Manager" - 3) Finally click on "SM.v1.1.apk" and install it , now you are ready to use it. diff --git a/app/src/main/java/com/polymath/subscriptionmanager/EditorActivity.java b/app/src/main/java/com/polymath/subscriptionmanager/EditorActivity.java index 0d62c7e..5794df9 100644 --- a/app/src/main/java/com/polymath/subscriptionmanager/EditorActivity.java +++ b/app/src/main/java/com/polymath/subscriptionmanager/EditorActivity.java @@ -1,8 +1,15 @@ package com.polymath.subscriptionmanager; import android.content.ContentValues; + +import android.database.sqlite.SQLiteDatabase; +import android.os.Bundle; + +import android.content.Intent; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; +import android.provider.CalendarContract; + import android.view.Menu; import android.view.MenuItem; import android.widget.EditText; @@ -16,6 +23,12 @@ import com.polymath.subscriptionmanager.data.SubscriptionContract.*; import com.polymath.subscriptionmanager.data.SubscriptionDbHelper; + + +import java.util.Calendar; +import java.util.GregorianCalendar; + + public class EditorActivity extends AppCompatActivity { private EditText mNameEditText; @@ -85,6 +98,30 @@ private void insertCalendarIntent() //TODO:Throw Calendar Intent + + //Extracting the End Date from the StartDate + GregorianCalendar endDate = new GregorianCalendar(year, month, date); + endDate.add(Calendar.DAY_OF_MONTH, days-1); + + //Making a calendar Intent + Intent calIntent = new Intent(Intent.ACTION_INSERT); + calIntent.setType("vnd.android.cursor.item/event"); + calIntent.putExtra(CalendarContract.Events.TITLE, "Subscription Reminder for "+nameString); + calIntent.putExtra(CalendarContract.Events.DESCRIPTION, "This is the reminder by the Subscription Reminder app to cancel " + + "your subscription for the service "+nameString+". Your subscription will auto-renew tomorrow. Please " + + "cancel your subscription now to avoid being charged for the next session period :)"); + + + calIntent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, false); + calIntent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, + endDate.getTimeInMillis()+32400000); + calIntent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, + endDate.getTimeInMillis()+32700000); + + //Throw Calendar Intent + startActivity(calIntent); + + //TODO:Display }