0.3.0 • Published 1 year ago

android-web-launcher v0.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
1 year ago

web-launcher

launcher.js for WebLauncher (A special made android launcher application)

Install

npm install android-web-launcher

Usage

import { launcher, PERMISSION_LAUNCHER, convertToCachedImageURL } from "android-web-launcher";
// or if you want a isolated instance, import class
// import { Launcher } from "android-web-launcher";
// const launcher = new Launcher();

// You can enable debug mode, this will allow you debug on your computer.
if (!launcher.isRunningInLauncher()) {
    launcher.startDebugSession();
}

// request permission first
await launcher.requestPermission(PERMISSION_LAUNCHER); // if user denied, it will throw an error
// get application list, apps: Array<{name:string, package:string, activity:string}>
let apps = await launcher.getApplicationList();
let app = apps[0]
// get application icon, (packageName, activity, size_in_px)
let src = launcher.getApplicationIconSrc(app.package, app.activity, 128);
// get cached dataurl for an icon
let dataurl = await convertToCachedImageURL(src);
// launch application
await launcher.launchApplication(packageName, activity);
// open webpage in the default browser
await launcher.openWebpage("https://www.bing.com");
0.3.0

1 year ago

0.2.0

1 year ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago