GSoC/2019/StatusReports/sh zam

From KDE Community Wiki
< GSoC‎ | 2019‎ | StatusReports
Revision as of 13:03, 25 August 2019 by Sharaf Zaman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Port Krita to Android

Krita is only available for desktop OSes, my proposal is to add the support to mobile devices, android to be specific.

The proposal intends to build a reliable and maintainable method for android builds, improve look and feel of the android app, handle permissions, file system access and work on core usability of app.

Progress and Goals

Overall status: Almost done

  • Done
    • Build system
    • Auto save when app is paused
    • Added touch painting support
    • Added touch-rotation
    • Fixed startup crash
    • Fixed `libqtforandroid` crash
    • aarch64 version of app works perfectly now
  • Goals
    • Build Krita against Android NDK toolchain
    • Build android APK.
    • Integrate the android build with binary factory and document it.
    • Make the android app suitable for different screens sizes and layouts.
    • Make the app usable and less buggy.
    • User documentation for this new platform.
    • Add support for Pen i.e stylus(extra).


Status

Build System

Build system was completed during the community bonding period. It has been stable since and the instructions to build Krita for android can be found on my branch: README.android.md. This was the most complicated and uncertain part. I had to look into other projects, to see how they manage it.

Black Canvas

This was the next major problem, after build system. Enabling hardware acceleration for canvas turned the canvas black. So, painting anything was impossible. I am not an OpenGL expert so, it took me time, had to do some reading and write some wrappers to find what caused the error. Only to find out that format and internalFormat chosen were incompatible for OpenGL ES.

Features

Near first evaluation, I implemented auto-save feature, which saves the documents when the app goes into background. The little problem we faced here was, that Krita saved document asynchronously but when app was sent to background, Qt main event loop was freezed which stopped the signal and slot connection, so async saving wasn't possible.

After first evaluation, I focused on adding touch support to painting. This wasn't hard and everything worked well. Now that I was working with this part, my mentor requested me to work on adding finger-rotation gesture as well. So, I worked on adding it as well, it was simple too.

Pen/Stylus? It works!

Crashes

We also had two reproducible crashes one was trivial and other was in Qt libraries. I started out to fix the crash in libraries, but my mentor suggested me to not bother with it as it is out of the scope of this project. So, I just wrote a simple workaround to fix it.

After second evaluation

Now the only part left out is user interface and dialogs. Dialogs are not usable on small screen devices. They work fine on tablets, but look ugly for such device. I am not really great with managing user-interface so, I started out with a simple research about how to make dialogs full screen, so it scales itself. Didn't go well.

I focused on handling file system, import dialog in Krita exposed internal directories. Which apps usually don't expose and looked way too much desktopy. It was hard to use. So, just recently I replaced it with a proper native file picker. (Commit can be found here: 0336c55). It went well!

Unfortunately, I couldn't do much during the last two weeks, because of the internet blockade in my place.

State of Krita

In short. Is Krita usable on Android devices?

Yes, if it is a tablet. No, if it is small screen'd device.

Conclusions

I think GSoC was a great way to get introduced to an open-source code base, but it probably is just the first step into open-source. Now that I am more comfortable with the source, community and I know a little more about where and what to ask. I think I can contribute more to the Krita and KDE code base.

There are still tiny things which have to be fixed and will be fixed sooner. So, we can start to have Android releases as well.

Commits and Branches

Blogs

Debug Krita on Android

Updates on Krita on Android