Hello,
I want to add an alarm via ContentResolver in sleep as android.
The alarm is also added to the database, but will not run.
How can I get the app to perform the alarm?
Here is my code:
I want to add an alarm via ContentResolver in sleep as android.
The alarm is also added to the database, but will not run.
How can I get the app to perform the alarm?
Here is my code:
B4X:
Dim ticksalert As Long = DateUtils2.SetDateAndTime(DateTime.GetYear(DateTime.Now), DateTime.GetMonth(DateTime.Now), _
DateTime.GetDayOfMonth(DateTime.Now), DateTime.GetHour(alert), DateTime.GetMinute(alert), 0)
Dim con As ContentResolver:con.Initialize("sleep_as_android")
Dim convalue As ContentValues:convalue.Initialize
convalue.PutString("hour", DateTime.GetHour(alert))
convalue.PutString("minutes",DateTime.GetMinute(alert))
convalue.PutString("daysofweek","0")
convalue.PutString("alarmtime",ticksalert)
convalue.PutInteger("suspendtime",-1)
convalue.putinteger("ndswakeupwindow",30)
convalue.PutString("enabled","1")
convalue.PutString("vibrate","1")
convalue.PutString("message","TESTEINTRAG")
convalue.PutString("alert","android.resource://com.urbandroid.sleep/raw/default")
convalue.putinteger("captcha",1)
Dim u2 As Uri: u2.Parse("content://com.urbandroid.sleep.alarmclock/alarm")
Dim raw As Uri = con.Insert(u2, convalue)
Dim rawId As Long = raw.ParseId
Log("add id=" & raw )