User Tools

Site Tools


Sidebar

Privacy Policy

News

Version 2.09 is out since May 6th 2021
After a brief pause DroidScript is now available again from the Google Play Store


Frequently Asked Questions


Namespaces

Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax

intents:alarm

To Add an Alarm

(skipUI doesn't seem to work, so it always shows the user the Alarm in the clock app).

function  butalarm_OnTouch() {
    app.AddAlarmToClock(17, 11, "Alarm!", true)
}
 
app.AddAlarmToClock = function(hours, minutes, message, skipUI) {
    const extras = [
        {name: "android.intent.extra.alarm.HOUR", type: "int", value: hours || 0},
        {name: "android.intent.extra.alarm.MINUTES", type: "int", value: minutes || 0}
    ]
 
    if(message)
        extras.push({name: "android.intent.extra.alarm.MESSAGE", type: "string", value: message})
 
    if(skipUI) // Maybe.
        extras.push({name: "android.intent.extra.alarm.SKIP_UI", type: "boolean", value: true})
 
    app.SendIntent(null, null, "android.intent.action.SET_ALARM", null, null, null, JSON.stringify(extras))
}
intents/alarm.txt · Last modified: 2021/04/21 12:28 by al4he6