Given that KaiOS is designed to run on budget, strictly low-powered hardware, with as little as 256MB of RAM, multitasking with two or more apps at once is somewhat extraordinary for KaiOS phones. Yet, apps can communicate well with each other and work together to ease you through tasks. How can they do that?
From the very first day you bought the phone and set up Google Maps, it asked you to open the Settings app and allow GPS permission to determine your location. When you pressed OK, the app forwarded you to exactly the App Permissions menu in the Settings app, where you could easily grant Maps access to your GPS.
This is where the magic of mozActivity
and webActivity
comes in. mozActivity on Firefox OS and KaiOS 2.5, and webActivity on KaiOS 3 and later, are APIs that let apps communicate, share, view and perform actions with each other.
let openURL = new MozActivity({
name: "view",
data: {
type: "url",
url: "https://kaios.dev"
}
});
openURL.onsuccess = () =>
console.log('Opened!');
openURL.onerror = () =>
console.warn('Error!');
const openSettings = function() {
let activity = new MozActivity({
name: "configure",
data: {
target: "device",
section: "connectivity-settings",
},
});
activity.onsuccess = function() {
// Do something here
};
activity.onerror = function() {
console.log("Error occurred: " + this.error);
};
};