show alert at on a date given by user? - blackberry

i am making a application in which user enter a date when he want to see an alert,
i have taken the date and stores in database,and sorted date,what is the best way how we schedule them and how?
please send me Code as well
I am knew in Blackberry
Thanks a lot

Look to class java.util.Timer
method schedule(TimerTask task, Date time)

Related

Can grafana include the current timestamp in an alert notification's message?

I’ve a request to include the time when an alert was raised in the message body of the email for that alert.
I’ve checked out Create Alerts and Alert notification templating and it looks like it might be possible, but I can’t find any reference to any list of supported variables.
For reference, we're using Grafana v7.4.0 (c2203b9859) and creating an alarm off a cloudwatch metric query:
REMOVE_EMPTY(SEARCH('{"AWS/ApiGateway","ApiName","Method","Resource","Stage"} MetricName="5XXError"', 'Sum', 60))
So there's nothing in the results we can use for this, unless anyone knows of a way to pull the last timestamp out of one of the datatables ;)
What I’m trying to do is include something like this, in the email being sent out when this alert is triggered (although the actual date format doesn’t matter at all):
Alert raised at 2021-08-26T12:03
Thanks

How do I reward the user daily?

I want to reward the user daily in my app, but when the app closes the timer always stops
I've tried doing this...
Timer.scheduledTimer(withTimeInterval: 86400, repeats: true) { _ in
self.points += 100
}
Can you please tell me how to reward the user daily once?
Of course the timer stops; when you close Facebook, does the news feed keep scrolling? No, the answer is no. Especially as third party developers, we have to complete ALL our tasks prior to the data of the app closing. There are functions to keep working for up to ~5min but after that, any relevant data will close.
https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623111-applicationwillterminate
So, we need to consider how we can get around this. So, what we need to do is
Everytime the app opens, we check the date
If it is the FIRST time the user opens the app, we save the date LOCALLY (UserDefaults)
If not, we need to check if the date is the same day or a different day.
If it is the same day as the saved date, we do nothing
If it is a different day, we will provide the user our reward and then overwrite the date in our local save UserDefaults
I think you need to call the function in the User Defaults (Store info locally). Here it is useful for calling functions only once like display the onboarding.
or on your DB you could set the timer there eg lambda functions on AWS

How to use Dart's Difference Method and DateTime using a dynamic date?

The application I'm building uses a sort of "Days since" counter using Duration Difference and DateTime, but I want the counter to begin on the day they started using the app by default, and have the option to put in whichever date they desire.
My Question is, how do i dynamically generate the start date of the counter to be the day they start using the app, and would this be easiest achieved with a database?
Ok, so from my point of view a good way to do it seems to use shared_preferences. Shared preferences allow to store some key/value pair for the user, it's persistent and you can update it.
Here's the package: https://pub.dartlang.org/packages/shared_preferences
Here's a good article giving you details about it : https://www.didierboelens.com/2018/04/shared-preferences---how-to-save-flutter-application-settings-and-user-preferences-for-later-re-use/
The idea would be to create a function, checking if the key of first_use_date exists.
If it does do nothing (or you can actually update it)
If not you create it with the date of today.
Of course it's persistent since the app stays installed on the device.
For printing duration I let you check this class : https://docs.flutter.io/flutter/intl/DateFormat-class.html
And especially this method (which is not implemented yet) : https://docs.flutter.io/flutter/intl/DateFormat/formatDurationFrom.html
Hope it's helps !!

Is it possible to use time picker only in blackberry

I want the user to pick a time so that at that time, the system will stop sending messages to its clients. However it possible to enter in EditField but still i want to use the built in feature of black berry to use the time picker. I learned that DateTimePicker class will be useful for this. But i cant find the code for it anywhere. Please help me by providing some hints or code. Thank you
This code shows only Time Picker. Check this:
final DateTimePicker datePicker = DateTimePicker.createInstance( Calendar.getInstance(), null, "hh:mm:ss aa");
datePicker.doModal();
Further details check this link:
DateTimePicker.

iPad Dev: Turn a given Date or String from SQL into NSDate

I have an app that creates and stores a session with a given start date. The user would create a new work session and when they start it, the current time would get saved to the database. The app needs to count time between the start and end of a work session. However, I need to be able to pause, restart, and continue sessions, so I need to get the date from the database.
Say a user starts at 10:30am on a particular day and continues their work session until 12:30pm. Say they need to close the app for whatever reason and come back to the work session. The session needs to count and show the current elapsed time since the beginning. So, I wanted to make an NSDate object with the start time taken from the database...but I can't. At least, I can't find a way of initializing a Date object with a string or even a set of parameters. I'm sure there's a way to do it, but I can't find one.
Take a look at the dateFromString: method on NSDateFormatter
you can start with the Apple Doc here
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/DataFormatting/Articles/dfDateFormatting10_4.html#//apple_ref/doc/uid/TP40002369-SW1
could type up examples, but I think the documentation contains some

Resources