Threadsthreads.start(action)threads.shutDownAll()threads.currentThread()threads.disposable()threads.atomic([initialValue])threads.lock()ThreadThread.interrupt()Thread.join([timeout])isAlive()waitFor()Thread.setTimeout(callback, delay[, ...args])Thread.setInterval(callback, delay[, ...a...
Storagesstorages.create(name)storages.remove(name)StoragesStorage.get(key[, defaultValue])Storage.put(key, value)Storage.remove(key)Storage.contains(key)Storage.clear()
Storages#
Stability: 2 - Stable
storages模块提供了保存简单数据、用户配置等的支持。保存的数据除非应用被卸载或...
shell函数shell(cmd[, root])Shellnew Shell(root)Shell.exec(cmd)Shell.exit()Shell.exitAndWaitFor()Shell.setCallback(callback)附录: shell命令简介am命令start [options] intentstartservice [options] intentforce-stop packagekill [options] packagekill-allbroadcast [options] intentinstrument [o...
Sensorssensors.register(sensorName[, delay])sensors.unregister(emitter)sensors.unregisterAll()sensors.ignoresUnsupportedSensor事件: 'unsupported_sensor'SensorEventEmitter事件: 'change'事件: 'accuracy_change'
Sensors#
Stability: 2 - Stable
sensors模块提供了获取手机上的传感器的...
module (模块)
module (模块)#
Stability: 2 - Stable
Auto.js 有一个简单的模块加载系统。 在 Auto.js 中,文件和模块是一一对应的(每个文件被视为一个独立的模块)。
例子,假设有一个名为 foo.js 的文件:
var circle = require('circle.js');
console.log("半径为 4 的圆的面积是 %d", c...
Mediamedia.scanFile(path)media.playMusic(path[, volume, looping])media.musicSeekTo(msec)media.pauseMusic()media.resumeMusic()media.stopMusic()media.isMusicPlaying()media.getMusicDuration()media.getMusicCurrentPosition()
Media#
Stability: 2 - Stable
media模块提供多媒体编程的支...
Keysback()home()powerDialog()notifications()quickSettings()recents()splitScreen()Home()Back()Power()Menu()VolumeUp()VolumeDown()Camera()Up()Down()Left()Right()OK()Text(text)KeyCode(code)附录: KeyCode对照表
Keys#
按键模拟部分提供了一些模拟物理按键的全局函数,包括Home、音量键、照相...
colorscolors.toString(color)colors.red(color)colors.green(color)colors.blue(color)colors.alpha(color)colors.rgb(red, green, blue)colors.argb(alpha, red, green, blue)colors.parseColor(colorStr)colors.isSimilar(color2, color2[, threshold, algorithm])colors.equals(color1, color2)colors.BL...
全局变量与函数sleep(n)currentPackage()currentActivity()setClip(text)getClip()toast(message)toastLog(message)waitForActivity(activity[, period = 200])waitForPackage(package[, period = 200])exit()random(min, max)random()requiresApi(api)requiresAutojsVersion(version)runtime.requestPermiss...
Filesfiles.isFile(path)files.isDir(path)files.isEmptyDir(path)files.join(parent, child)files.create(path)files.createWithDirs(path)files.exists(path)files.ensureDir(path)files.read(path[, encoding = "utf-8"])files.readBytes(path)files.write(path, text[, encoding = "utf-8"])files.writeB...