How to send a local repeating notification in certain days? - java

I have a reminders app, I made a UI that looks like this where the user can pick multiple days and the hour that he wants to be reminded on. For example, I can select Monday and Tuesday at 15:00 and I should be reminded those days at that given hour. But I canĀ“t figure out how to make this work (mainly, the mutiple days thing). Any ideas?

You can send a local repeating notification with the help of AlarmManager. setRepeating() function can be used to schedule notifications.
similar question, Check this link for better understanding.

Related

Android show information in a specific day on calendar

Not a problem per se but I am figuring out how to do something. In my app, I shall save some workout for every specific client. Any workout will be doing different from week to week; i.e: rep scheme in the week one shall be different from the week two, and so on.
So, how to show the user that in the calendar? Should I save in every workout the day it should be performed and then see if it's the same day and show it? Or how to implement this? The only way I thought to implement this is save in every workout the day that it should be performed and show it in a textview and all the info behind relationated with the workout without calendar use but don't know if this approach would be the best
I have searched on the web but found nothing. If you could give me a hint would be awesome.
Thanks in advance!

How to clear unwanted records in Kinvey Database

I am having an Android app and I am planning to use Kinvey Database to store some data.
One of the record in the entry would be having the last used time period.
The last used time period will be set by my app when ever the app is opened.
What basically I am trying to achieve is to run a code at the end of each month and clear all the record whos value of the last used period is more than 10 days.
Can any one please tell me whether it is possible to do this?
The reason for doing this is to use the least Server storage space as they provide only 1 GB/Monthly in the free plan.
What I understand from this...
What basically I am trying to achieve is to run a code at the end of each month and clear all the record whos value of the last used period is more than 10 days.
Can any one please tell me whether it is possible to do this?
... is that you would like to have scheduled code, which will be executed once a month. Please take a further look at the Scheduled Code feature of Kinvey.
https://devcenter.kinvey.com/html5/tutorials/scheduled-code-getting-started
Edit: more information on the topic...
Kinvey Scheduled code allows you to execute one of your custom endpoints on a specific date in the future. It is commonly used to
Aggregate, archive, and cleanup data.
Pull data from a third-party API into Kinvey.
Send out a batch of e-mails or push notifications.
I would not bother describing step-by-step initializing of Scheduled Code, since those steps may change in the future. Please follow the steps from the link above, those should be fine to get you further.

Android Alarm Scheduling with repeats

I am in need of creating an app with "reminding" facility. For an example, user can set a reminder for "Jogging" and he can do following when setting up this reminder. Below is the normal process.
User setup the reminder with "cause" to be reminded (ex: jogging )
User can set the reminder to fire at 10am Monday, and so on.
If required, user can set the alarm for multiple days (ex: Monday, Tuesday, Friday )
user can set the reminders to be repeated. (Ex: "Every Monday at 10am". Ie else "Every Monday, Tuesday, Sunday at 10am ")
User can set any number of reminders for various causes.
At the time of reminder, the user will get a notification in his phone.
After setting the reminder, entire process will run in background.
I was trying to find a better way to do this, this is basically like an alarm application. I looked into 'AlarmManager' , 'JobScheduler' and so on, nothing seems to match what I want to do, the correct alarm set-up and repeated reminders when set.
I looked into some alarm app examples too, seems too complicated when my core app is not an "alarm" app.
What is the exact library of doing this? I am not creating an alarm app, this is a process required for another app we build.

Internationalizing a duration via gwt Messages

I want to include a timeout duration, like "25 seconds" or "1 minute", in a user-facing message. Is there a way to do this in gwt?
From this resource, I know that I can do dates like this:
#DefaultMessage("Last update: {0,date,medium} {0,time,medium}")
String lastUpdate(Date timestamp);
but there doesn't seem to be anything like:
// hypothetical
#DefaultMessage("Requests time out after {0,duration}")
String timeout(Interval duration); // also Interval is a JodaTime concept...
Is there?
JodaTime still isn't really available for GWT (there are/were several projects, but unfortunately none ever really established itself). I hope someday we'll see JavaSE 8's new Date API in GWT!
Until then, I would use the following approach:
Storing the duration as a number of seconds (or milliseconds if required).
Creating one internationalized message for 0-59 seconds, one for 1-59 minutes, and one for 1-... hours.
Each of these messages can use Plural Forms.
Selecting the best message (seconds/minutes/hours) programmatically.

restfb: Facebook payment subscriptions

As far as I've heard this feature is brand new, and it's still under testing phase. Anyway, reading the docs in developers.facebook I was not able to find out if it was possible or not to make subscriptions on a year basis payment.
Well, you can state a period of a 12 months. I mean, the only time unit you have available are weeks or years. So, the answer to your question is "yes", but the way you have to do it is on a 12-monthly basis.

Categories