Android Digital Clock time change using TimePicker - android

How to change the time in Digital clock view by picking the time from TimePicker Dialog??

The DigitalClock widget only shows the system time. You cannot use it to display other times. Hence, there is no way to have it display a time chosen by a user through a TimePicker.

I think this question has somehow related to Set alarm activity in previous android releases.
I see that set Alarm in android 2.3.3 is what you ask? there is a digital clock above the entered alarm time by user, so when user set the alarm time, the digital clock changed identically to alarm, the digital time has not related to system time as showed.
I think this done by coding, not by digital clock.

Related

Get local time zone on Android without SIM

For my app functionality, I need to have a correct time set on a device. For example, I use AlarmManager to do some action at 7:00 AM. It's a tablet with Wi-Fi connection. Network-provided time works well, time & date can be set automatically over Wi-Fi, but time zone not. The device may appear in different time zones. How to solve this problem? Do I need to ask the user to set the proper time zone on the first launch of the app or it can be synced another way?

How to set up reliable alarms while developing an application for Android Marshmallow or upper?

In the last year I have bought 4 different Android phones and all of them had got failures with the calendar notifications. Sometimes the notification for an event was shown and sometimes wasn't shown at all. I investigated a lot and found a problem in the "Calendar Storage" app, a Content Provider that is in the application framework layer. Notifications stop to be always shown as of the version 6.0.1. That's the reason why I want to develop my own calendar app that is not based on the Calendar Provider so that I can have reliable notifications again.
In the past, when we developed a reminder based app we used AlarmManager class and the method setExact() for make the application able to show a notification or anything else at a given date and time in the future. But in Marshmallow and upper it mustn't work because of the annoying doze mode.
They invented the method setExactAndAllowWhileIdle() in Marshmallow supposedly for setting alarms that can bypass the doze mode. But it says that it doesn't let you to put more than one alarm within 15 minutes. In a reminder based app that is a foolishness as the user MUST be able to put as many reminders as he wants and as close in the time line as he wants.
So my question is, how can I make my app to show reminder notifications at a given time in a way that always works regardless of the doze mode and so that I can have as many notifications as I want and as close in time as I want?
Thank you.
There's always the option of white listing your app so doze will still let it run the old way.
Another official way of making it work is sending an fcm notification, but you'd need a server to do the job.
Short from that I'm afraid the next official answer involves exact alarms.
If it's an option for you there is a chance you can start a service with STICKY. I'd expect the phone to never go into doze properly even if the service thread is blocked forever (it may help to assign it to a different process in the manifest so your ui never freezes). Putting a periodic old style Java timer to fire a callback at the right time may accomplish what you need.

How do I start an Android alarm if the user is never going to open the app?

I'm trying to write an app that checks a database for certain times, and sets an alarm for that day's time every day. I can't just start every alarm at once; that'd kill the phone in no time. For ease of access, I don't want the user to have to open up the app every morning and press a big red button to start the alarm up. So ideally, upon installing the app, the app should start up a procedure that activates an alarm for each day according to the database. I can figure out how to set an alarm from the database, but - unfortunately - only if they open up the app and press a button. What I need is a way for the app to set an alarm triggering it to set an alarm, and to do that without ever being opened. Any suggestions?
When the user first opens the app , set an alarm to start a service on next day morning , which will check your database and set the alarm .And the service will also set a new alarm to start itself next day morning and repeat the work .
Certainly you can't do this, it's terrible to user's experience. after android 4.0, your app must be opened at least once, you broadcast receiver can work normally.In other words, you can do noting before user open it once.

Android notifications on defined time and date

I want my application to remind user to watch a tv-show weekly... Is it possible to make notification to popup every week in desired time?
Thanks in advance!
Yes. Setup your calender for a reminder on the day/time in questions, and then just set it up to remind weekly. its an option on there. it might be easier for you to set it up from the web version of google calender, but it is just as easy on your phone.

Android - How to set system Alarm Clock from my own app

I would like to set a normal, Android alarm clock in my app - the one in the default Android Clock application. I simply want to schedule a an alarm that will ring let's say tomorrow at 8 a.m. I've read about the Alarm Manager, but it seems to trigger an event, and I just want it to ring. I'm pretty sure there's an easy solution for that, but I couldn't find it. I'll apprecaite any help!
It appears that there is no documented Intent for launching the alarm clock in the Android SDK. Having said that, here are a few resources you can try that should get you around that:
Intent to launch the clock application on android
Android AlarmClock ACTION_SET_ALARM intent produces exception
How does one launch android version dependent alarm clock?
I ended up building my own ringer in the BroadcastReceiver, as zapl suggested (thanks!). Problem was, I couldn't create a dialog that would allow user to dismiss the alarm, however I was able to create a notification that does that, as the class documentation suggested.

Categories

Resources