farooqkz

Farooq's KaiOS related experiences started with a hackable banana

If you have checked recent messages(around 11-01, 3 o'clock UTC. I think it wouldn't be so “recent” at the time you are reading my post), you could see yet another guy or girl interested in developing apps(in this case games) for KaiOS. Since it wasn't the first time someone newcomer in the BananaHackers community interested in app development had shown up, and since they were asking almost the same set of questions every now and then, I thought writing a blog post regarding that would be a good idea.

Here you go with a list of titles and a sentence about what's inside the said section:

  • A wild Mozilla reappears after about 5 years: Some historical words on the origin of KaiOS, Mozilla's late FirefoxOS, and the difference between FirefoxOS and KaiOS.

  • Hardware properties of KaiOS devices: In this section, I've written about what hardware KaiOS devices usually have, including physical keys, the display, connectivity, and other hardware features or properties.

  • Software properties: I've written what type of apps does KaiOS support, where to start developing for KaiOS, what language and technologies you can choose from, and such these.

  • The reasons why you might not want to develop for KaiOS: Here I have mostly linked to another blog post regarding the reasons why you might not want to develop for KaiOS at all.

  • Hardware requirements for the app development: This section is about the main coding device you need to develop for KaiOS as well as the KaiOS development device you can choose.

  • Links collection: I've linked to resources you probably will need while developing for KaiOS.

  • Last words: Last words of the post...

A wild Mozilla reappears after about 5 years

Before going through anything else let me write a few words regarding this Operating System calling itself “Open”. KaiOS is just FirefoxOS or B2G which appeared years ago from Mozilla, by some called the web Robin Hood. I remember at that time it was a trend for almost every company to have their own mobile operating system. You could see Ubuntu Touch from Canonical, Tizen from Samsung if I remember correctly, FirefoxOS from Mozilla, and I suppose a few others which I don't remember right now.

The late FirefoxOS was a web-based operating system for (low-end?) touch devices. This means the operating system was a big browser having web apps running in. And B2G stands for Boot2Gecko. Gecko, according to Cambridge dictionary, is a small lizard with wide feet, found especially in warm countries. You can pet one but I don't guarantee it does not bite! I never had one to pet but geckoes seem pretty cute. Don't they?

A picture of Gecko

However, in the context of front-end development, especially Firefox browser, is the name of an engine:

Gecko is the layout engine developed by the Mozilla Project and used in many apps/devices, including Firefox and Firefox OS. Gecko interprets JS, HTML and CSS plus embedded content like images and draws everything on the screen of the user's device. Gecko among other things includes a networking stack, graphics stack, a JS VM, and many other stuff.

Gecko, MDN glossary

So now that you kinda know what FirefoxOS is, you also know what KaiOS is. KaiOS is a version of FirefoxOS launched in 2018 for “smart feature phones” with no touch support(at least devices launched till now, which are running KaiOS v2.x or v1.0 never had touch support as far as I know). Most of these devices have got an ABC keypad. To read about the hardware properties of KaiOS devices, go ahead to the next section.

Kai means open in Chinese. So KaiOS means open operating system.

— From somewhere on KaiOSTech


Hardware properties of KaiOS devices

Physical keys

All KaiOS devices have got an ABC keyboard, with JioPhone 2 as an exception which has got a nice and soft QWERTY keyboard(see the photo below from tbrrss. This photo was originally used on this wiki page dedicated to JioPhone).

A photo of JioPhone 2 running Luxferre's Wallace toolbox by tbrrss

Other than that all KaiOS devices include D-pad navigation keys(up/down/right/left), Okay or Enter key to confirm things usually(or shoot at enemies in some games), Soft left and Soft right keys, Call key and Power or Back(space) key. Many devices have got one or two more keys like my Nokia 800 Tough which has got a shortcut key above the Call key and Back(space) key above the Power key.

So to sum up you've got these keys on all devices(excluding JioPhone 2):

  • 0 to 9
  • ArrowUp, ArrowDown, ArrowLeft, ArrowRight
  • Enter
  • Call
  • Backspace
  • SoftRight
  • SoftLeft

And these two as optional because you won't find them on all devices:

  • Power
  • Shortcut key

There are also other physical keys on some devices. Like the side power key on the BananaPhone(the other name for Nokia 8110 4G) which you can use to turn the display on/off and power the device on or off. Or 2720 Flip has got that of 8110 and two keys on the side for volume up and down. Not sure if you can capture even of these keys in your app.

Display/Screen

Regarding the display all devices have got a 240x320 one(height is 320 pixels and width is 240). JioPhone 2 is however an exception having 320x240 instead. Note that the size of the screen of devices is not the same for all devices but the screen resolution is. That's all that you've got to draw your content on.

Many devices like Nokia 2720 Flip have got another display, usually black and white. According to the website of Nokia, the Flip has got a secondary 1.3-inch front display which displays incoming text messages or caller ID of some incoming call as well as time and date. But I don't think you could use this screen in your apps to display stuff on them officially. And even if you could, it doesn't worth it to add such a functionality to your app which only a few users, comparing to the whole, could use it. Nevertheless, it would be a fun hack but in my humble opinion, not practical.

Connectivity

Now let me write a few words about the connectivity features of KaiOS phones. These “smart feature phones” usually support 3G or 4G mobile data and Bluetooth v4.x. Most of them also have got WiFi support so you won't have to waste your data plan if you are near your work or home router/access point. The other feature they usually have is Internet sharing with USB or WiFi tethering(supporting WPA 2-AES, WPA-TKIP, or no security). There is also (A)GPS but at least for me it doesn't work well every now and then and everywhere I try it. Some suggest it's not as good as some of an Android phone.

Both my KaiOS phones, the late Bananaphone and the Tough support 4G mobile data on the primary SIM card and I suppose 3G or H on the other SIM card. Of course, you probably could have 4G on both cards using this trick from the BananaHackers wiki(the origin of it is the BananaHacker website, however, added there, by Ivan Alex HC).

4G or 3.9G?

The 4G connectivity of some KaiOS device is not like a real 4G. According to my experience and reports from a friend of mine named Ivan Pasev, KaiOS limits(or has the limitation on) the maximum bandwidth you can use. It's still faster than 3G but probably slower than the typical 4G you would have on most Android phones.

Other hardware features

Physical ports

KaiOS devices in general have got a microUSB port supporting USB 2.0 only which can be used for debugging, sideloading apps, Internet sharing, charging, and EDL if your device has got a Qualcomm chipset. They also come with a 3.5mm audio jack for audio input and output. Nothing new compared to other phones. Huh?

Camera

Compared to Android or iOS phones, the Camera(s) of a KaiOS device hasn't got anything to say. Nokia 8110 4G(aka the BananaPhone), 8000 4G, 2720 Flip, and 800 Tough have got only a single 2 Megapixels rear camera with no front one. 6300 4G has got only a rear VGA camera with no flash.

However, according to KaiOSTech's device list, there are many other devices with both rear and a pretty weak front or selfie camera. I would like to just name a few:

  • Akeza 4G, front: VGA, rear: VGA
  • KaiOS ONE, front: VGA, rear: VGA
  • Digit 4G Bold, front: VGA, rear: VGA
  • myPhone Up Smart LTE, front: VGA, rear: 5MP
  • ...

Processor, Memory and Graphical processor

I am lucky to have a Nokia which uses a Qualcomm Snapdragon processor with 512MB of RAM. Many devices have got only 256MB. Newer Nokia phone models like 8000 4G use a higher version or model quad-core Snapdragon instead of dual-core like my 800 Tough.

On the other hand, not all are lucky like I am. According to the BananaHackers wiki(which its content mostly comes from bananahackers.net written by the founders of this community including Ivan Alex HC), there are devices with Mediatek based or Spreadtrum based chipsets. Which in some people's opinion are not as good as Qualcomm's. I cannot comment on this since I'm not much of a mobile hardware geek. Also, there are devices whose chipset was never specified anywhere as far as we know.

Regarding GPU, the KaiOS devices of Nokia which have got 512MB of RAM and Adreno as graphical processor unit, can run Christian Waadt's AirshipCombat 3D single and multiplayer game very well. It's an action shooter 3D game for KaiOS and a few community members, especially one, were addicted to it, at least for a while! I'm not sure if Christian has the game's server still up so that you could still test the multiplayer part of the game. But you always can test its mission-based single-player mode. You can read or see more about this game through this link on BananaHackers' webstore and perhaps download it and sideload it to your device. There is another 3D game for KaiOS, named Marble3D or something a lot like Neverball, which I was playing on my late Bananaphone and was very fun, fast and smooth.

But that's not the end of the story! While these two 3D games were running smoothly on my device with Snapdragon and 512MB of memory, I remember Christian had reported that he had problems running his game on devices with 256MB instead of 512. I don't remember if he finally solved the problems or not. But if you are going to write a 3D game for these devices, I would recommend you get in touch with Christian. He is(or at least used to be) available on BananaHackers chatrooms available through Discord and Matrix(here's a link only to app development room, in the case your client does not support Matrix spaces)

Farooq's dream KaiOS device

I always wished there was some non-Jio KaiOS device available in my country. With a soft keypad like you see in that photo of the lovely JioPhone. Perhaps with 8GiB or 12GiB of internal memory instead of 4, a quad-core processor, and at least 1GB of memory(RAM). But not always things go according to our wishes and not always everything's in our hands.


Software properties

As you have read earlier in this post of mine, KaiOS has come from the ashes of Mozilla's late FirefoxOS which is basically a big browser with multiple tabs(called web apps). FirefoxOS was for a variety of Android touch devices. KaiOS, however, excluding KaiOS 3.0, doesn't support touch at all. And for KaiOS 3.0 which is still not out at the time of writing this post, there are whispers that it would support touch devices. But we can't be certain till a while later we see KaiOS 3.0 devices.

So where to start?

Obviously, you need to know programming and coding if you want to write apps for KaiOS. So I'm not writing here about how to get started in this Computer Science area. If you don't know to program, you should already learn that. Like you cannot go to the third level before you haven't passed the second one. And there's no lift! It doesn't matter what language or technology you start in my opinion. It just does matter that you start. If your goal is writing apps for KaiOS or Front-end development, you could start with Javascript but there might be other options as well which I have written a little bit about them in the later sub-sections.

What language(s) should I learn?

First of all, English and I am serious! You'll need English to read the stuff on the Internet and learn from there as well as being in touch with other community members. CS is not the only area of science that requires people to learn English before anything. Nowadays, English is the language of science and scientists and if you want to access sources of knowledge you must learn it. Just like one had to learn Persian and Arabic languages in the Islamic Golden Age, in the past pre-modern days if he or she wanted to gather knowledge from the others.

As you now know, KaiOS apps are web applications. This means most likely you want to go with Javascript, CSS, and HTML. There is another option, too: Write in like C, C++, or Rust and compile them to some sort of Assembly! In theory, you can do so for a variety of languages. But in reality, there might be no good toolchain or compiler or possibly nothing at all for your favorite language.

But what is this “Assembly”? I'm referring to asm.js and WebAssembly or WASM which you could compile your apps to one of them. asm.js is a subset of Javascript. Note that just KaiOS 3.0 and later support WebAssembly. On KaiOS 2.5 or so you could use just asm.js which is slower than WASM. You can read this post on Mozilla Hacks if you want to ask why.

Does it mean you could abandon the sloppy Javascript? I'm unaware since I've never entered this area. But I am certain about a few things:

  • You probably can use a language like Rust to write almost all parts of your app and abandon HTML, CSS, and JS. For example, see egui project on Github which doesn't use HTML at all. Everything in pure Rust using WebGL compiled to WebAssembly. See their demo here with a browser supporting WASM.

  • You surely can have certain parts of your web app in, for example, C++. By using a C++ library compiled to asm.js(or WASM for KaiOS 3.0).

I'm going with the sloppy Javascript. So any frameworks I could use?

This section is for those who want to go with Javascript for whatever reason. Perhaps they are starting programming and Javascript is way easier than a language like Rust. Or perhaps just because they want to write a simple app and don't want to bother with compiled languages.

You can write your dream web app for KaiOS using vanilla Javascript and not using any framework. This brings a great performance compared to using most frameworks. Also, you won't have a build or compile process before you could test your app in the browser. But not using any framework ruins maintainability overtime when the code size grows. In my opinion and experience, if your web app is going to get bigger than small or trivial, it would be much better if you had used some framework.

However, you may not go with any framework out there. Compared to normal web app development, there are a few things you'd better consider including these:

  • There is no mouse or touch on KaiOS devices. This means the navigation and control are completely done by keys. Nevertheless, there is an exception: you could enable “emulated cursor” in your app's manifest. After that user will have a cursor that could move it using D-pad and click anywhere using the Enter or Okay key. But that is not convenient for users at all and also you won't be able to use the full capacity of the device inputs. Not to mention that it is impossible for something like Christian's AC3D which I've named in the “Processor, Memory and Graphical processor” sub-section.

  • As I said in the “Display/Screen”, the screen resolution is pretty low. About 10 pixels shorter in height if you have enabled the status bar in the manifest. Most likely about 10 pixels less for Softkey labels.

  • The most important thing: Performance, performance, and performance! Firstly you've got only 256-512MB of RAM some of which the operating system itself uses. Secondly, the processor used by KaiOS devices is not so powerful. 2 or 4 cores running at 1.0 to 1.4 GHz usually. And the third concern is that you are developing for mobile with small batteries with a capacity of about 1500-2500mAh. You absolutely don't want to drain all the power saved in the device's battery by using some nasty and heavy framework doing hundreds or thousands of unnecessary or avoidable operations in a second.

So after all these, especially the last one which is performance, you have to chicken out many frameworks, probably including ReactJS. And with any other framework, you would want to optimize it enough especially for memory consumption unless you want the OOM killer to commit an unforgiving crime(from your point of view as the developer of the app and not as a user) and murder your app!

I personally use InfernoJS after some experiences with pure JS(no framework) in many of my apps like https://notabug.org/bananaphone/vm-irc, Fooplot, SimpleQuran or toys like TalkingBot. Inferno is a fork of the famous ReactJS optimized for mobile and high performance. According to benchmarks on Inferno website, it is just a bit worse than Javascript with no framework while it brings good features of ReactJS(it is unclear, at least for me, that such a performance is gained by disabling normalization or not). This framework is also has been suggested in KaiOSTech's developer FAQ here. And I've heard by some, Inferno is what KaiOSTech itself uses for stock apps of its operating system. However, I can't confirm or deny that.

After all these, InfernoJS is not the only option you've got. I've seen many using other frameworks. I will name a few in brief:

According to the benchmark on Inferno website and many other benchmarks which you can easily find using your favorite search engine, for example this one on Medium, all these frameworks provide better performance compared to ReactJS.

Let me end this part with a few words regarding other concerns you should have:

  • The CSS you use is important too. You'd better not forget that! KaiOS, excluding v3.0, hasn't got Quantum engine

  • The library and modules you use are just as important as the framework you use. They must be optimized for performance especially memory. Remember the OOM killer? However, sometimes you have not got many choices. For example for Chooj it seems the only option I've got so far is matrix-js-sdk. Also, you might need to modify the library you want to use, a little or more than a little, to suit your requirements. Again for Chooj, I have to somehow make mozSystem property enabled in XMLHttpRequest or CORS will block the requests I make.

The reasons why you might not want to develop for KaiOS

I've written a separate blog post about reasons one(mostly a user) would not want to use a KaiOS device. Writing apps is useless if there are no users to use them. Right? However, there is no absolute good or bad operating system. I highly recommend reading that post or at least the titles inside if you are thinking to spend time and effort developing apps for KaiOS, especially as a real job and not only a fun thing.


Hardware requirements for the app development

So you are sure you want to develop for KaiOS? Firstly you need a PC or laptop or something with a comfortable and fast keyboard to code on. The good news is that you do not need 8GB of RAM only for Android Studio or 4GB for Flutter! You only need enough for these:

  • A Firefox tab which you test your app there in most cases.

  • 2 or 3 more browser tabs to search stuff on the Internet and read them.

  • WebIDE to deploy your app to your KaiOS device and also to debug it. You probably could use command-line tools like Luxferre's gdeploy or Fabrice's b2gclitool which eat less of your valuable RAM.

  • A Matrix client to join BananaHackers Matrix rooms so that you could get in touch with the community and perhaps ask questions from them. Fortunately, there are a variety of Matrix clients for many operating systems including but not limited to KaiOS, Windows, Android, GNU/Linux, and OS X. From Terminal-based Weechat to graphical and memory hungry Element. The choice is yours. See a list of clients here

  • At last the Operating System you use also will consume memory. If you don't have much memory available, you could go for a pretty light-on-memory but yet well-supported Linux distro. For example those with XFCE or LXDE as graphical shells. You could alternatively use just a window manager like Openbox or my favorite tiling WM, i3 which eat much less memory compared to something even like XFCE.

Another device you need for KaiOS app development is obviously a KaiOS device. But not any device. Of course, you should be able to install your app on your KaiOS device through your other device, say your laptop. This process is called sideloading and you need to enable debugging mode on your device to sideload apps. The process of getting debug mode enabled is not the same for all devices. On some nearly impossible or really hard and on some is easy like prey. You can read stuff on the wiki or the website.

If you need quick advice, most community members, including myself, will suggest Nokia phones for development. The reason behind this, other than the fact that a Nokia device is unlikely to be unavailable in your region, is that enabling debug mode on Nokia devices is as easy as dialing *#*#33284#*#* and voila! A bug icon will appear in the status bar meaning now you can sideload apps to your device through your computer! There are, however, at least two confirmed exceptions: Nokia 2720 Flip and 800 Tough if you upgrade their firmware to v30(do not confuse with KaiOS v3.0 that's a different thing). Fortunately, before the OTA update become available in my region, a friend told me not to upgrade to firmware v30. And thanks to him, I did not.


While I tried to put as many links as possible in the content to give you clues for further reading, there are many links which either did not fit in the content, or I think I would better repeat them here.

  • BananaHackers wiki and website: Contains handy resources on rooting different KaiOS devices, developing on them, code snippets, device APIs, and much more. You can contribute and add content too! Just ask for a wiki account and permission to edit and add pages. Any good contribution to the wiki shall be appreciated!

  • BananaHackers chatrooms on Matrix and Discord: You can keep in touch with the community, ask from them or answer their questions and share the progress on your work with them. As always don't ask to ask just ask!

  • Unofficial KaiOS development wiki by alego4710: Contains useful resources regarding app development for KaiOS.

  • B2G docs on Wayback machine: These pages are super helpful. At least the APIs part has been so helpful for all of us. It is so unfortunate that Mozilla removed these from MDN. If the Wayback machine link did not work for you, there is an alternative link from the University of Chicago. And finally you might want to check out this Github repository to self-host these or for offline use.

  • Adrian's KaiUI: It has got UI components for creating KaiOS apps. It is in ReactJS but you could easily use the (S)CSS files and port to other React-like frameworks. For example in my project, Chooj, I have ported many of those which I needed to InfernoJS. See this directory on Chooj's repository

  • nadim's KaiUI: It has got fewer components compared to Adrian's. It still seems nice.

  • KaiUI topic on Github: You can see other KaiUIs.

Got any other useful resources? Feel free to tell me about them by commenting on this post and I will add them to the collection.


Last words

I am not a professional developer and my knowledge is limited. Feel free to contact me, either by commenting under this post or emailing me or pinging me on Matrix, if you think something was written not right by me or perhaps some of my writings were not clear enough.

While I would be happy to answer your questions regarding app development for KaiOS if you contact me somehow, I highly recommend that you ask in the chatrooms and if you want my attention, you could ping or mention me there. This way others could enter the discussion. Perhaps their answers are faster or more correct than mine. Also, others could use your answered question and benefit from it. Of course, this does not mean I will not answer your questions in private whenever I can.

After my recent so long messages in the BananaHackers community chat rooms regarding why KaiOS sucks, I thought it would be much better if I write a blog post in the BH blog to let more people hear my voice and read my reasons regarding why one should not use KaiOS.

In the beginning, I chose Nokia 8110 4G instead of an Android phone for the following reasons:

  • Avoiding social media and carrying them everywhere with myself. You know it is harder to chat using an ABC keypad!
  • I needed a cheap phone capable of the basics of every mobile phone(Calls and SMS) plus 3G or 4G internet sharing with WiFi hotspot so that I could feed the internet to my Onyx Boox Poke Pro which is an Android ebook reader with an E-Ink display(which doesn't hurt eyes).

KaiOS is still capable of those for me including a few other stuff which I didn't need in the beginning but not everyone's use case just like mine.

Here I go through many reasons one might want to avoid using KaiOS and go for an Android phone instead. Many of the reasons I have listed here may only apply to app developers.

Note that all these reasons mostly apply to current versions of KaiOS excluding KaiOS 3.0

Poor support from manufacturers

How many OTA updates have your device got? one? two? perhaps zero? It seems that manufactures aren't much interested in giving away firmware updates for their KaiOS devices. As far as I remember my late bananaphone(aka Nokia 8110 4G) had got just 2 OTA updates. And it never got an update to KaiOS 2.5.2!

But for Android phones, the story is so different as most manufacturers bump Android version once or twice. And for KaiOS, Nokia didn't even go up by 0.0.1 which really sucks. This means the customer or user probably needs to buy a new phone to get every new minor software update.

So at least most current KaiOS devices, if not all, will never get to KaiOS 3.0, unfortunately.

Recent Let's Encrypt certificates problem and OTA updates

As far as I know, due to a recent problem, KaiOS recognizes websites with Let's Encrypt certificates as insecure. And since there are no OTA updates for most phones, at least not so soon, this ruins a lot of functionalities of a KaiOS device. The problem's not with browsing website's with the poor browser of KaiOS. You can hardly browse a website with that browser. And if you ever wanted to, you could add websites using LE certificates as exceptions which is kinda annoying but at least works.

The real problem arises when an app tries to access some API of itself. However, I've read in the BH App development chat room from tbrrss(if I remember correctly) that there is a workaround:

Visit API of your Application in KaiOS's browser and add it as an exception.

I haven't tested it myself so I can't confirm it but let's be optimistic and suppose it does work. Imagine two API servers for each KaiOS app and a total of 5 apps on your device using APIs. I guess you'll need to adb pull all 5 apps off your device, find the API servers in the source code of those 5 apps and type in KaiOS's browser with ABC keyboard. Typing API endpoints even using Android's QWERTY keyboard is not an easy job...

And it's not the end of the certificates story: Not all apps work like this, using one or more API endpoints and retrieving data from them. For example for my friend's RSS reader app, John David's feedolin, you'd have to do this for all the websites you want to read feeds from and are using LE certificates.

And yet for John's app, it is the good part. What about some Podcast app? I guess the developer has to get a server with a database(or a list) of podcast websites using LE certificates and tell the user to do the process for every website, including the API endpoint of the app itself if any. The developer should also add Dear Users, I know this really sucks but it is OEM's fault and you've got no other choice

Regarding my Matrix client for KaiOS, Chooj, I've got to tell users to visit their homeserver address with browser to make Chooj work.

As a final word in this sub-section, it seems to be no workaround for other protocols using LE certificates like the ones used by Email app.

KaiStore takes a big share of the income of your KaiOS app

This section and the next one apply only if you are a KaiOS app developer. If you are a user, you might want to skip this section.

According to Christian, developer of AirshipCombat3D and SpaceWalk3D, and many other developers also, Kai takes about 70% of the income your app makes through ads. I remember Christian had said:

App Development for KaiOS is burning time and money. my game(AirshipCombat3D) has hardly made the costs of the server.

Surprise: KaiStore has stupid rules for you dear developers!

One stupid rule Kai has made for dear developers is that you must add KaiAds to your app!

So this means one of these:

  • You must integrate your app with KaiAds but you can simply disable it. However, it will make your app about 4KiB larger. Possibly with useless API calls to Kai.

  • You must add KaiAds to your recipe and you must use it!

Both suck, the latter sucks more. That's why many developers and I have never submitted our apps to KaiStore, yet. Besides, I will probably make my free/open source app, non-free by letting KaiAds in.

There's however this quote from KaiOS developers FAQ which I'm unaware how much is it real:

If for the specific reason you can’t monetize your content or would not like to monetize, kindly reach out to developersupport@kaiostech.com

Another stupid rule is the one regarding VoIP apps when they want to use Mobile data for voice or video calls. I don't know if it is still there. Luxferre had pointed to it somewhere(on the forum?) and I had seen it myself on Kai's website. This means I probably cannot submit Chooj to KaiStore even if I wanted to use KaiAds!

Weak hardware and crappy devices

As far as I know, all KaiOS devices come either with 512MiB or 256MiB of RAM. I know KaiOS can run on 256MiB of RAM and that's great but what about the apps?

And their processor is usually pretty weak dual/quad-core ones. I was lucky to have Qualcomm's processor on my Nokia phones but what about the other users?

Another problem is with the shape of devices: The Bananaphone is curved and the Flip of Nokia is... Flip. Both are subject to be easily breakable...

And as the last set of problems I'll specify here, I would like to mention that there are hardware or software bugs in many devices which never got fixed. Hey, Nokia! Don't you hear the voice of probably thousands of users of 8110 including me complaining about its keypad? Or the problem of 6300's GPS perhaps?

You may install apps from KaiStore or... KaiStore!

Unlike in Android which you can simply download APKs from the Internet and install them on your device or use third party stores like the cool and free(as in freedom) F-droid, on KaiOS the only source of apps is KaiStore.

Some users might mention sideloading with WebIDE but firstly, it requires a computer of some sort and secondly, it is not available on all devices easily.

Even on those which you can easily sideload stuff, there is a code which you should dial which nowhere(as far as I've seen) in the official documentation of KaiOS(not FirefoxOS), it has been written! And to enable the developer menu you need to sideload something like Luxferre's Wallace Toolbox after you enabled debug mode with that code.

Also on the newer firmware build for the Flip and the Tough of Nokia which is v30, sideloading seems to be disabled and you have to patch the /boot partition with EDL to be able to sideload apps again. Fortunately, I didn't upgrade to the v30 build for my 800 Tough.

Other reasons in brief why KaiOS sucks...

  • Except for Jiophone which is only available in India and working with their carriers only, KaiOS phones are not so cheap. And yet Kai advertises about devices as cheap as 10 USD...

  • KaiOS phones officially got no task manager of some sort for managing open apps

What am I going to do?

I will wait till KaiOS 3.0 and only if it satisfied me, I would continue being on this platform and develop for it. Otherwise, I would leave it and perhaps go for an Android phone. Nevertheless, I shall continue developing Chooj if possible.

I might be wrong in some cases. So I love to hear from you, readers! Consider commenting at the bottom of this post.

#chooj #matrixclient #matrix

I would like to go LIVE on BigBlueButton for the development of Chooj, a Matrix chat and call client for KaiOS. But first I would like to know if anyone's interested in attending such a meeting or LIVE and if anyone's interested, when would they attend?

The meeting is going to happen on a BigBlueButton instance so you will need just your modern web browser to attend. Also, it would take less than an hour of time. And I will try to record the meeting and upload it to BananaHacker's PeerTube channel.

So if you are interested, comment on this post with the date and time you will be able to attend.

#chooj #matrixclient #matrix

I have renamed the repository, package and app name to Chooj and from now on this is the name of the project.

I have also added a few numbers of badges to the project's README.

Project's repository

What does Chooj mean?

In my local language, Bandari, which is a version of Persian mixed with Arabic, English and many other languages, Chooj is name of a plant.

What works so far?

Currently, only login process with only password works on a real device. Even through much more works in a recent browser and I'm looking for workarounds to fix this problem.

These stuff has been implemented so far and should work(in browser and not on KaiOS, yet):

  • Login with password
  • Seeing a list of DMs(1 to 1 rooms)
  • Contacting project author(me) via Email in About tab by pressing Call key
  • Seeing a list of messages in each DM. A text-box exists too but does not do anything, yet.

#infernojs #inferno #matrix #matrixclient #voip #voicecall

It has been a few days which I have started the development of the app. Just like the prototype I had coded before, InfernoJS is used as framework to create the app.

You can see the Github repository here.

Why InfernoJS?

InfernoJS is a fork of ReactJS but with a performance comparable to Vanilla JS which is Javascript without any framework. You can see benchmarks here. Let me explain the reasons Inferno has been chosen. If you are already familiar with React-like frameworks, you can skip this section and jump to Why Github?

Just like React, an Inferno app is made of components and each component is parent of some other component or components. Of course there are “low level” components which are home to real CSS and HTML. But you code those low level ones once and them everywhere without a need to waste your time to think about HTML or CSS again. As an example, for Login component this is the tree:

Login
  - Header
  - ListView
     - TextInput(for homeserver address)
     - TextInput(for username)
  - SoftKey

As you see when writing Login component, I only need to know about usage of Header, ListView, TextInput and SoftKey components. I don't need to know about their details and I can focus on important things. Regarding these child components I only need to write them once and use them everywhere which makes more free space in my mind to care about stuff I should really care about like the logic of my app and other things.

This makes my code highly readable and components which I write are reusable. I could also distribute the components which are common so that someone else or I, would only need to use them afterwards. Just like how you use a library or module without caring about their details.

You can check code for Login here

Why Github?

If you were already following me and my projects, you could see that I was always using notabug.org for projects but for this app I've switched to Github a service by Microsoft running a propriety software. But I have reasons to choose it over NotABug and Gitlab as well which I'll explain them in two parts.

The main reason I've chosen Github over NotABug is to use Github Actions to improve the development of the project and automate stuff. Of course I could combine NotABug with an external CI/CD provider but I haven't got any machine to run CI/CD jobs on it and also I wanted to focus on the project rather than other stuff.

However I could use Gitlab which provides a similar service to Github Actions(actually Gitlab had this before Github as far as I remember) for free of charge but I live in Iran in which because of sanctions I can't use Gitlab even for public free/open source software projects directly. An alternative way would be using some kind of VPN or proxy to change my IP address to one which is not from Iran but that reduces the quality of my internet connection which being in Iran is already very low. To realize what do I mean by “very low”, I should tell you that my wired home connection is 2Mbps ADSL which in reality is a bit lower than 2Mbps...

Nokia 800 Tough image

#matrix #voip #voicecall

As of now, enough money has been raised for the project to get a Nokia 800 Tough but not enough to even start the first stage of the project. Thanks to all of you who donated and also those who wanted to donate but they couldn't due to any reason(including an empty pocket!).

If you wanna still donate, you can send some Bitcoin Cash to the address I shall write in the project's page but please DO NOT send anything to the addresses specified in the previous post.

Because of what was not raised, I don't promise working 15 hours a week on the project but due to what was raised I cannot leave the project so I plan to work on the project about 7 hours a week starting from 1-2 weeks later.

In the next post I will write about status of the project and also address of project's page on Github.

Matrix logo

As of 2021-06-19 72 USD out of 200 USD has been reached.

#matrix #voip #voicecall

The story

It had been a very long time which I wanted to start developing a Matrix client with voice call support for KaiOS. Before that I had tried developing a Jitsi Meet app for KaiOS letting KaiOS users have group voice chat with their feature smartphones, which failed due to their ToS.

What is Matrix?

Matrix is an open and federated protocol for chatting which supports End to End Encryption, 1 to 1 voice and video calls(support for group calls is experimental). Is it also possible to integrate other chat applications like XMPP, Telegram, Discord, IRC, etc into Matrix using bridges.

What am I going to do?

I want to create a Matrix call only app for KaiOS letting users of this platform to use 1 to 1 calls, especially voice call. I need at least 350 US dollars to work on it as a job about 15 hours a week and to get a Nokia 800 Tough which costs me about 120 dollars 90 dollars in my country.

Note that I've got a 8110(aka the bananaphone) but its keypad is almost dead.

Donators' name as well as the amount they've donated shall be written in Credits/About tab of the app visible to everyone who uses the app. If you want your name to be written you MUST email me your crypto public key before making the transaction

hapu [at] riseup [dot] net

I already have written a prototype of a Matrix app which let's you login and see a list of your “DMs” and start a voice call as well. However this prototype needs to be rewritten, most parts at least if not everything.

prototype screenshot

License of the software

The Matrix app source code will be available to all for free on some site like Github under GPLv3. It will be available on BananaHackers store as well.

Stages

So I split the development in the following stages:

Stage 1 -once 200 dollars is reached, summer vacation has started and I have bought a Nokia 800 Tough- will be an app with the following features:

  • Login with username and password is possible only.
  • You could see a list of DMs
  • Invites are auto-accepted
  • Possible to start a voice call with someone or receive voice call as long as the app's running
  • The app will be extensible letting us add other Matrix features later easily

Stage 2 -once 300 dollars is reached and stage 1 has been done, includes push notification for incoming calls enabling users to receive calls even if the Matrix app is not running. This requires some server software as well as some modification in the KaiOS app. Also invites are no longer auto-accepted.

Finally Stage 3 adds video call functionality once 350 dollars is reached and also tries to improve the UI as well as performance.

Limitations

Due to memory hungry design of matrix-js-sdk, users might not be able to use the app with their account if they have joined large rooms.

Another thing is that I won't be sending the app to KaiStore due to their foolish rules for Voice over IP apps.

Tech stack

Tech stack for the KaiOS app, most likely, will be either ReactJS or InfernoJS as well as Adrian's KaiUI. And for the push notification server software it would be either Python or Rust which is preferred.

Entering the campaign

So if you want to enter the campaign, send cryptocurrency to one of the addresses below and remember even small amounts would help: EDIT: The campaign has ended, check the same blog for status of the project.

BTC: 1Lv3FRzqcG7GhLcAMrHDwXAN6dMbfLu78g
BCH: 1AGk1t3oCxeTqYX9kAUJHFULdP32D4d6d6

Check how much was raised here for Bitcoin and here for Bitcoin cash.

You don't have crypto? No problem you could buy some from places like Coinbase or Kraken or other exchanges.

According to commits on kaiscr NotABug Git repository about 9 months after I had done my first commit in the repository, I started another serious research for finding a better and high performance way for mirroring the screen of a KaiOS device. Current kailive.py script works by taking multiple screenshots from the screen using kaiscr.py and can go up to 10-12 FPS. However most of times, the FPS rate is under 10 and forces high resource usage to the device making many heavy apps slow if you want to run the app and mirror the screen at the same time.

My guess was that, the problem is with encoding raw image to PNG on the device for each frame because screenshot file type is PNG. According to what fabrice said in #b2g:mozilla.org(A Matrix room), it should also be able to give JPG instead of PNG but that doesn't solve the problem.

If I was correct, I should be able to achieve good performance by somehow taking raw screenshots. My early researches, shortly after I had done with kailive.py, was more focused on finding a low level way using Android libraries or even the Linux kernel to read raw pixels from GPU or some buffer somewhere. But I had no such a low level experience so I failed finding a way. I tried reading from /dev/graphics/fb0, the Framebuffer, using fbcat, too. But the result was a blank image(all black) with the resolution equal to screen's resolution. And I had other evidences leading me to conclude the fact that Framebuffer is not used for displaying stuff on these devices, like Framebuffer is slow and my bananaphone is capable of running high FPS games(even 30 is high for FPS as far as I know).

I had left this for a long time without any further research, till one week ago(or two). This time my approach was researching a higher level of the system, Gecko. Fortunately after “grepping” and tracing the source code of Gecko for 8110(available on Nokia website at the time of writing this post) I had found how does the System app take screenshots and output them as PNG.

It draws the whole window on a canvas, saves the content of that canvas to PNG and sends it through debugger-socket. Soon after that I found a way to export raw RGB data rather than PNG and sent it to a TCP server listening on my laptop. But did I succeed? The answer is No!

First I tried 30 fps but neither the device was fast nor I got the wanted FPS rate. The same goes for 20 fps... This means that my guess was simply wrong. The only thing which I have not tried is captureStream() but I have no hope it will work as expected.

I have written a short report with code snippet in the wiki which you can read here: https://wiki.bananahackers.net/en/development/screen-mirroring#taking-screenshots-without-encoding-and-decoding-to-or-from-png