GSoC/2019/StatusReports/sh zam: Difference between revisions

From KDE Community Wiki
< GSoC‎ | 2019‎ | StatusReports
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
== Progress and Goals ==
== Progress and Goals ==


'''Overall status:''' Almost done
* Done
* Done
** Build system
** Build system
** Auto save when app is paused
** 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
*Goals
**Build Krita against Android NDK toolchain
**Build Krita against Android NDK toolchain
Line 18: Line 26:
**User documentation for this new platform.
**User documentation for this new platform.
**Add support for Pen i.e stylus(extra).
**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: [https://invent.kde.org/kde/krita/blob/sh-zam/T10784-android-port/README.android.md README.android.md]. This was the most complicated
and uncertain part. I had to look into other projects, to see how
they manage it.
* Related links:
** [https://github.com/KDE/krita/commit/d6a19ad75237391092d3bbfb584c6c32607edfb6 Setup for android(arm) build]
** [https://github.com/KDE/extra-cmake-modules/commits?author=sh-zam Minor changes to ECM for Krita's Android build]
** [https://github.com/KDE/krita/commit/cca96b3ae832177b559edebf4d4d223c2c997d40 Adding create-apk target]
** [https://invent.kde.org/kde/krita/commit/4467ad27435fab50be46dad788193252e156acd5 Final refactor of build]
== 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 <code>format</code> and <code>internalFormat</code> 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: [https://github.com/KDE/krita/commit/1e651edfb42000be70d177051b1418fe71762b62 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 ==
== Commits and Branches ==
* [https://phabricator.kde.org/T10784 Phabricator Task]
* [https://phabricator.kde.org/T10784 Phabricator Task]
* [https://phabricator.kde.org/T11355 Feedback task]
* [https://invent.kde.org/kde/krita/tree/sh-zam/T10784-android-port Branch]
* [https://invent.kde.org/kde/krita/tree/sh-zam/T10784-android-port Branch]
* [https://cgit.kde.org/krita.git/log/?h=sh-zam/T10784-android-port&qt=author&q=Sharaf My commits to Krita]
== Blogs ==
== Blogs ==
[https://www.sh-zam.com/2019/05/debugging-krita-on-android.html Debug Krita on Android]
[https://www.sh-zam.com/2019/05/debugging-krita-on-android.html Debug Krita on Android]


[https://www.sh-zam.com/2019/07/updates-on-krita-on-android.html Updates on Krita on Android]
[https://www.sh-zam.com/2019/07/updates-on-krita-on-android.html Updates on Krita on Android]

Latest revision as of 13:03, 25 August 2019

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