Code Monkey home page Code Monkey logo

kolibri-installer-android's Introduction

Kolibri Android Installer

Wraps Kolibri in an android-compatibility layer. Relies on Python-For-Android to build the APK and for compatibility on the Android platform.

Development Flow

  1. Setup a Python virtual environment in which to do development. The Kolibri developer documentation has a How To guide for doing this with pyenv but any Python virtualenv should work.

  2. Ensure you have all necessary packages for Python for Android. Ensure you install java version 1.11, sudo apt install openjdk-11-jdk , and set it as the default java version: sudo update-alternatives --auto javac and sudo update-alternatives --auto java.

  3. The make setup command will install the Android SDK and Android NDK.

N.B. if you would like these to be installed to a different location then you can set an environment variable, e.g.: By default it is set to export ANDROID_SDK_ROOT=./android_root

Run make setup.

  1. Install the Python dependencies:

pip install -r requirements.txt

  1. Build or download a Kolibri tar file, and place it in the tar/ directory.

To download a Kolibri WHL file, you can use make get-tar tar=<URL> from the command line. It will download it and put it in the correct directory.

  1. By default the APK/AAB will be built for most architectures supported by Python for Android. To build for a smaller set of architectures, set the ARCHES environment variable. Run p4a archs to see the available targets.

  2. Run make p4a_android_project this will do all of the Python for Android setup up. After, you can run make kolibri.apk or make kolibri.apk.unsigned if you want to build the apk in the console.

N.B. You will need to rerun this step any time you update the Kolibri WHL file you are using, or any time you update the Python code in this repository.

  1. You can now run Android Studio and open the folder python-for-android/dists/kolibri as the project folder to work from. You should be able to make updates to Java code, resource files, etc. using Android Studio, and build and run the project using Android Studio, including launching into emulators and real physical devices.

N.B. When you rerun step 7, it will complain loudly and exit early if you have uncommitted changes in the python-for-android folder. Any changes should be committed (even if in a temporary commit) before rerunning this step, as we use git stash to undo any changes in the Android project caused by the Python for Android project bootstrapping process. Also, when rerunning step 5, the Android version will not have incremented, meaning that any emulator or physical device will need to have Kolibri explicitly uninstalled for any changes to Python code to be updated on install.

Debugging the app

  1. When running the app from Android Studio, if you are using an emulator, it is possible that there will be many warning messages due to GPU emulation. In the logcat tab, update the filter to this package:mine & -tag:eglCodecCommon to hide those errors from the logcat output.

Building from the commandline

  1. Run make kolibri.apk.unsigned to build the development apk. Watch for success at the end, or errors, which might indicate missing build dependencies or build errors. If successful, there should be an APK in the dist/ directory.

Installing the apk

  1. Connect your Android device over USB, with USB Debugging enabled.

  2. Ensure that adb devices brings up your device. Afterward, run make install to install onto the device.

Running the apk from the terminal

  1. Run adb shell am start -n org.learningequality.Kolibri/org.kivy.android.PythonActivity

Server Side

Run adb logcat -v brief python:D *:F to get all debug logs from the Kolibri server

Client side

  1. Start the Kolibri server via Android app
  2. Open a browser and see debug logs
  • If your device doesn't aggressively kill the server, you can open Chrome and use remote debugging tools to see the logs on your desktop.
  • You can also leave the app open and port forward the Android device's Kolibri port using adb:
adb forward tcp:8080 tcp:8081

then going into your desktop's browser and accessing localhost:8081. Note that you can map to any port on the host machine, the second argument.

Alternatively, you can debug the webview directly. Modern Android versions should let you do so from the developer settings.

You could also do so using Weinre. Visit the site to learn how to install and setup. You will have to build a custom Kolibri .whl file that contains the weinre script tag in the base.html file.

Helpful commands

  • adb is pretty helpful. Here are some useful uses:
    • adb logcat -b all -c will clear out the device's log. (Docs)
      • Logcat also has a large variety of filtering options. Check out the docs for those.
    • Uninstall from terminal using adb shell pm uninstall org.learningequality.Kolibri. (Docs)
  • Docker shouldn't be rebuilding very often, so it shouldn't be using that much storage. But if it does, you can run docker system prune to clear out all "dangling" images, containers, and layers. If you've been constantly rebuilding, it will likely get you several gigabytes of storage.

Build on Docker

This project was previously developed on Docker, but this method has not recently been tested.

  1. Install docker

  2. Build or download a Kolibri WHL file, and place in the whl/ directory.

  3. Run make run_docker.

  4. The generated APK will end up in the bin/ folder.

Docker Implementation Notes

The image was optimized to limit rebuilding and to be run in a developer-centric way. scripts/rundocker.sh describes the options needed to get the build running properly.

Unless you need to make edits to the build method or are debugging one of the build dependencies and would like to continue using docker, you shouldn't need to modify that script.

Getting a Python shell within the running app context

We implemented code for an SSH server that allows connecting into a running Kolibri Android app and running code in an interactive Python shell. You can use this for developing, testing, and debugging Python code running inside the Android and Kolibri environments, which is handy especially for testing out Pyjnius code, checking environment variables, etc. This will soon be implemented as an Android service that can be turned on over ADB, but in the meantime you can use it a bit like you might use import ipdb; ipdb.set_trace() to get an interactive shell at a particular context in your code, as follows:

  • Drop import remoteshell at the spot you want to have the shell get dropped in, and build/run the app.
  • Connect the device over ADB, e.g. via USB.
  • Run adb forward tcp:4242 tcp:4242 (needs to be re-run if you disconnect and reconnect the device)
  • Run ssh -p 4242 localhost
  • If the device isn’t provisioned, any username/password will be accepted. Otherwise, use the admin credentials.
  • If you get an error about “ssh-rsa”, you can put the following SSH config in:
Host kolibri-android
    HostName localhost
    Port 4242
    PubkeyAcceptedAlgorithms +ssh-rsa
    HostkeyAlgorithms +ssh-rsa

Then, you should be able to just do “ssh kolibri-android”

Updating Python for Android

We maintain a fork of Python for Android that includes various changes we have made to the source code to support our specific needs. As P4A make new releases, we make a branch from the latest release tag, and then replay the commits on top of this tag using an interactive rebase. Sometimes, this allows us to drop commits as new features are merged into P4A. Our naming convention for the branch on our fork is from_upstream_<tag_name>. Any time we push new commits to this branch, we must also update the pinned commit in requirements.txt, so that we are always building with a completely predictable version of Python for Android.

By default we stash any updates to our bootstrap coming from Python for Android, because mostly we have overwritten their bootstrap code to make the relevant changes for us. If there are upstream changes to code we have committed in this repo from the bootstraps, then if the diff is small, it is probably simplest to manually copy in these changes to our committed code. If the diff is larger, or the developer fancies exercising some git-fu, then the make command make update_project_from_p4a will update the bootstrap from Python for Android, and not stash any changes that introduces. Through judicious change reversion and diffing, the appropriate changes can then be applied. Here be dragons.

kolibri-installer-android's People

Contributors

bjester avatar christianmemije avatar danigm avatar dbnicholson avatar dependabot[bot] avatar dxcanas avatar dylanmccall avatar jamalex avatar kollivier avatar manuq avatar marcellamaki avatar nucleogenesis avatar ozer550 avatar rtibbles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kolibri-installer-android's Issues

Build failed: Could not find `android` or `sdkmanager` binaries in Android SDK [kolibri 15, sdk 30]

In the lastest branch master or develop, for kolibri 15

--- Assigning Build Number
Buildkite build # not found, using dev alternative
2201261007
pew init android
Verbose output set.
PATH = /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-8-openjdk-amd64:/home/kivy/.pyeverywhere/native/android/android-ndk-r21:/.local/bin:/home/kivy/.pyeverywhere/native/android/android-sdk-linux/platform-tools:/home/kivy/.pyeverywhere/native/android/android-sdk-linux/tools:/home/kivy/.pyeverywhere/native/android/apache-ant-1.9.9/bin
Copying latest dependencies into project...
Running command ['/bin/bash', '/src/pyeverywhere/native/android/init.sh']
Dir is /home/kivy/.pyeverywhere/native/android
Script Dir is /src/pyeverywhere/native/android
Android SDK is /home/kivy/.pyeverywhere/native/android/android-sdk-linux
Android NDK is /home/kivy/.pyeverywhere/native/android/android-ndk-r21
Platform is linux
NDK version is r21
Downloading https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.tar.gz
Running command: p4a create --arch armeabi-v7a --dist_name Madrassati_dist --bootstrap webview --requirements python3,android,pyjnius,genericndkbuild,sqlite3,cryptography,twisted,attrs,bcrypt,service_identity,pyasn1,pyasn1_modules,pyopenssl,openssl,six,flask
PATH = /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-8-openjdk-amd64:/home/kivy/.pyeverywhere/native/android/android-ndk-r21:
/.local/bin:/home/kivy/.pyeverywhere/native/android/android-sdk-linux/platform-tools:/home/kivy/.pyeverywhere/native/android/android-sdk-linux/tools:/home/kivy/.pyeverywhere/native/android/apache-ant-1.9.9/bin
[WARNING]: $ANDROIDNDKVER is deprecated and no longer necessary, the value you set is ignored
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI: 30
[ERROR]: Build failed: Could not find android or sdkmanager binaries in Android SDK
[INFO]: Instructions: Make sure the path to the Android SDK is correct

=== > without upgrade sdk to 30 and with old git source for pyeverywhere and kolibri 15 i ahve adifferente error :

   A problem occurred evaluating root project 'Kolibri_dist__armeabi-v7a'.

Could not find method versionCode() for arguments [2201261156] on DefaultConfig_Decorated{name=main, dimension=null, minSdkVersion=DefaultApiVersion{mApiLevel=21, mCodename='null'}, targetSdkVersion=DefaultApiVersion{mApiLevel=29, mCodename='null'}, renderscriptTargetApi=null, renderscriptSupportModeEnabled=null, renderscriptSupportModeBlasEnabled=null, renderscriptNdkModeEnabled=null, versionCode=null, versionName=null, applicationId=null, testApplicationId=null, testInstrumentationRunner=null, testInstrumentationRunnerArguments={}, testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}, mWearAppUnbundled=null} of type com.android.build.gradle.internal.dsl.DefaultConfig.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org
    BUILD FAILED in 1m 46s
    [INFO]: STDERR:
    [INFO]: COMMAND:
    cd /home/kivy/.local/share/python-for-android/dists/Kolibri_dist__armeabi-v7a && /home/kivy/.local/share/python-for-android/dists/Kolibri_dist__armeabi-v7a/gradlew assembleDebug
    [WARNING]: ERROR: /home/kivy/.local/share/python-for-android/dists/Kolibri_dist__armeabi-v7a/gradlew failed!
    Makefile:43: recipe for target 'kolibri.apk' failed

Some ui-icons do not render

Some ui-icons do not render, or incorrectly render in some webviews. This issue was noted on the $10 phone.

<!--DOES NOT RENDER-->
<i class="material-icons">view_module</i>
<ui-icon icon="view_module"/>    

<!--DOES RENDER-->
<i class="material-icons">&#xE8F0;</i>  
<mat-svg category="action" name="view_module"/>
<ui-icon><mat-svg category="action" name="view_module"/></ui-icon>

Seems like this is due to the webview not supporting ligatures.

A solution would be to use the following markup

<ui-icon ariaLabel="Label">
  <mat-svg category="action" name="view_module"/>
</ui-icon>

This would allow us to benefit from the styling and accessibility of the ui-icon. We could also simplify this, by creating a k-icon component.

<k-icon ariaLabel="lit">
  <mat-svg name="lit" category="life">
</k-icon>
<k-icon ariaLabel="label">
  <file-svg src="./customicon.svg"/>
</k-icon>

Query Kolibri service state on startup

We need to be able to check if the Kolibri service is already running, and possibly also have ways to check if the service is somehow running but not functioning properly, so we can know when to start or restart the service.

make run_docker fails

tried to build using docker. go the following error

Copying /home/kivy/src/kolibri/dist/libpasteurize/fixes
Traceback (most recent call last):
File "/usr/local/bin/pew", line 11, in
load_entry_point('pyeverywhere', 'console_scripts', 'pew')()
File "/src/pyeverywhere/src/pew/cli/tool.py", line 344, in main
sys.exit(args.func(args))
File "/src/pyeverywhere/src/pew/cli/tool.py", line 232, in build
return controller.build(settings)
File "/src/pyeverywhere/src/pew/controllers/android.py", line 191, in build
return self.run_command(cmd)
AttributeError: AndroidBuildController instance has no attribute 'run_command'
Makefile:28: recipe for target 'Kolibri%.apk' failed
make: *** [Kolibri%.apk] Error 1
Coping APK
From android_container:/home/kivy/dist/ to /home/jhorel/kolibri-installer-android
Error: No such container:path: android_container:/home/kivy/dist/

Kolibri app crashed on Android 5.0.1

Kolibri app crashed after I install and launch it on physical Android version 5.0.1 device. I'm using the installer built in this PR with this installer file name Kolibri_dist__armeabi-v7a-release-0.13.4a0.dev0+git.101.g01d7cf71-3d07473-dev-.apk.

Starting of Kolibri server needs updated

In 0.13, Kolibri switched to using the click library for the CLI interface, which changed some initialization steps for Kolibri along with how we call the CLI functions programmatically. The Android app will need to be updated similar to the Mac app to reflect these changes in order to properly start the server.

P2P Import has an empty channels and resources

Observed behavior

Using local networks or Peer to Peer (P2P), Super admin cannot see the channels and resources to import even if the other devices have the channels available.

SVID_20200519_113003_1

Expected behavior

User-facing consequences

Errors and logs

Steps to reproduce

Context

  • Kolibri version : 0.13.3a0.dev0+git.18.g5c58205f download in google play store
  • Operating system: Android 9.0 (Pie) Huawei Y6s
  • Browser n/a

Kolibri version issue

Attempting to build using a whl file from Develop or 0.5.

Traceback (most recent call last):
--
  | File "/usr/local/bin/buildozer", line 11, in <module>
  | sys.exit(main())
  | File "/usr/local/lib/python2.7/dist-packages/buildozer/scripts/client.py", line 13, in main
  | Buildozer().run_command(sys.argv[1:])
  | File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 1058, in run_command
  | self.target.run_commands(args)
  | File "/usr/local/lib/python2.7/dist-packages/buildozer/target.py", line 91, in run_commands
  | func(args)
  | File "/usr/local/lib/python2.7/dist-packages/buildozer/target.py", line 103, in cmd_debug
  | self.buildozer.build()
  | File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 212, in build
  | self.target.build_package()
  | File "/usr/local/lib/python2.7/dist-packages/buildozer/targets/android.py", line 642, in build_package
  | version = self.buildozer.get_version()
  | File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 717, in get_version
  | ' (looking for `{1}`)'.format(fn, regex))
  | Exception: Unable to find capture version in ./code/kolibri/VERSION
  | (looking for `v(\d+\.\d+\.\d+)`)
08-17 11:04:30.954 31390 31451 I python  : Traceback (most recent call last):
08-17 11:04:30.954 31390 31451 I python  :   File "main.py", line 11, in <module>
08-17 11:04:30.954 31390 31451 I python  :     django.setup()
08-17 11:04:30.954 31390 31451 I python  :   File "kolibri/dist/django/__init__.py", line 17, in setup
08-17 11:04:30.954 31390 31451 I python  :     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
08-17 11:04:30.954 31390 31451 I python  :   File "kolibri/dist/django/conf/__init__.py", line 55, in __getattr__
08-17 11:04:30.954 31390 31451 I python  :     self._setup(name)
08-17 11:04:30.954 31390 31451 I python  :   File "kolibri/dist/django/conf/__init__.py", line 43, in _setup
08-17 11:04:30.954 31390 31451 I python  :     self._wrapped = Settings(settings_module)
08-17 11:04:30.954 31390 31451 I python  :   File "kolibri/dist/django/conf/__init__.py", line 99, in __init__
08-17 11:04:30.954 31390 31451 I python  :     mod = importlib.import_module(self.SETTINGS_MODULE)
08-17 11:04:30.954 31390 31451 I python  :   File "/data/user/0/org.le.kolibri/files/lib/python27.zip/importlib/__init__.py", line 37, in import_module
08-17 11:04:30.954 31390 31451 I python  :     
08-17 11:04:30.954 31390 31451 I python  :   File "/data/user/0/org.le.kolibri/files/kolibri/__init__.py", line 13, in <module>
08-17 11:04:30.954 31390 31451 I python  :     __version__ = str(get_version(VERSION))
08-17 11:04:30.954 31390 31451 I python  :   File "/data/user/0/org.le.kolibri/files/kolibri/utils/lru_cache.py", line 137, in wrapper
08-17 11:04:30.954 31390 31451 I python  :     result = user_function(*args, **kwds)
08-17 11:04:30.954 31390 31451 I python  :   File "/data/user/0/org.le.kolibri/files/kolibri/utils/version.py", line 404, in get_version
08-17 11:04:30.955 31390 31451 I python  :     return get_prerelease_version(version)
08-17 11:04:30.955 31390 31451 I python  :   File "/data/user/0/org.le.kolibri/files/kolibri/utils/version.py", line 332, in get_prerelease_version
08-17 11:04:30.955 31390 31451 I python  :     tag_describe = get_git_describe()
08-17 11:04:30.955 31390 31451 I python  :   File "/data/user/0/org.le.kolibri/files/kolibri/utils/version.py", line 237, in get_git_describe
08-17 11:04:30.955 31390 31451 I python  :     universal_newlines=True
08-17 11:04:30.955 31390 31451 I python  :   File "/home/christian/repos/kolibri-kivy/.buildozer/android/platform/build/build/other_builds/python2-openssl-sqlite3/armeabi-v7a/python2/python-install/lib/python2.7/subprocess.py", line 679, in __init__
08-17 11:04:30.955 31390 31451 I python  :   File "/home/christian/repos/kolibri-kivy/.buildozer/android/platform/build/build/other_builds/python2-openssl-sqlite3/armeabi-v7a/python2/python-install/lib/python2.7/subprocess.py", line 1228, in _execute_child
08-17 11:04:30.955 31390 31451 I python  : OSError: [Errno 2] No such file or directory
08-17 11:04:30.996 31390 31451 I python  : Python for android ended.

Kolibri Android App - 'Webpage not available' message is displayed after launching the app

Observed behavior

I'm seeing a 'Webpage not available' message after launching the Android app which disappears after 15-20 seconds and then I can interact normally with the app.

Steps to reproduce the issue

  1. Install the following Android build: https://buildkite.com/learningequality/kolibri-android-installer/builds/3613
  2. Launch the app
  3. Observe that an error screen is displayed and only after waiting about 15-20 seconds I can actually see the app fully loaded

Additional information

Screenshot_20211214-165753_Kolibri

Logs and DB files:

AndroidLogsAndDB.zip

Usage Details

  • OS: Android 7, Samsung S7

make run_docker fails while trying to download pip

ERROR: This script does not work on Python 3.6 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/3.6/get-pip.py instead.

The command '/bin/sh -c curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py' returned a non-zero code: 1

I noticed you have a ticket for upgrading python. As a short time fix, changing the URL as suggested by the error message works, but I'm not sure if hardcoding 3.6 is desirable.

Possible to use back button to return to loading HTML page

In general, having a working back button is a good thing, but we need a way to 'pop' the loading page from the history, so that hitting back from the Kolibri home will switch to another app as it does with other apps.

With PyEverywhere, we have full access to the browser from Python, so I'm pretty sure we can just write some small code that alters the browser's page history to remove the loading page from it. (Or perhaps we can just clear the history once page load completes.)

Upgrade Python for Android to a version that supports the WorkManager API

There is currently a WIP PR on the Python for Android repository which allows Python for Android apps to define their own WorkManager compatible scripts. Essentially, this would allow us to define a Python script that can then be run in a WorkManager context.

We need to upgrade our Python for Android version to a version that includes these updates - either by getting this merged into mainline, or merging to our fork and updating the code to finalize it (it's not entirely clear to me whether it is working or not at this stage).

AccessDenied error from pskolibri module

Check into why we're receiving this error, and why it only appears to trigger on some devices. Traceback:

11-08 13:27:20.720 20897 30263 W AbstractXMPPConnection: java.security.cert.CertificateException: Hostname verification of certificate failed. Certificate does not authenticate learningequality.org
11-08 13:27:21.609 30166 30234 I python : INFO:root:Starting server...
11-08 13:27:21.706 30166 30234 I python : ERROR:root:Traceback (most recent call last):
11-08 13:27:21.706 30166 30234 I python : File "/data/user/0/org.learningequality.Kolibri/files/pew/kivy_pew/webview.py", line 49, in run
11-08 13:27:21.706 30166 30234 I python : super(PEWThread, self).run()
11-08 13:27:21.706 30166 30234 I python : File "/data/user/0/org.learningequality.Kolibri/files/lib/python2.7/site-packages/jnius/init.py", line 53, in jnius_thread_hook
11-08 13:27:21.706 30166 30234 I python : return orig_thread_run(*args, **kwargs)
11-08 13:27:21.706 30166 30234 I python : File "/home/kivy/.local/share/python-for-android/build/other_builds/python2-openssl-sqlite3/armeabi/python2/python-install/lib/python2.7/threading.py", line 505, in run
11-08 13:27:21.706 30166 30234 I python : File "main.py", line 67, in start_django
11-08 13:27:21.706 30166 30234 I python : run_server(5000)
11-08 13:27:21.706 30166 30234 I python : File "/data/user/0/org.learningequality.Kolibri/files/kolibri/utils/server.py", line 158, in run_server
11-08 13:27:21.706 30166 30234 I python : from kolibri.deployment.default.wsgi import application
11-08 13:27:21.706 30166 30234 I python : File "/data/user/0/org.learningequality.Kolibri/files/kolibri/deployment/default/wsgi.py", line 15, in
11-08 13:27:21.706 30166 30234 I python : application = get_wsgi_application()
11-08 13:27:21.706 30166 30234 I python : File "/data/data/org.learningequality.Kolibri/files/kolibri/dist/django/core/wsgi.py", line 14, in get_wsgi_application
11-08 13:27:21.706 30166 30234 I python : return WSGIHandler()
11-08 13:27:21.707 30166 30234 I python : File "/data/data/org.learningequality.Kolibri/files/kolibri/dist/django/core/handlers/wsgi.py", line 151, in init
11-08 13:27:21.707 30166 30234 I python : self.load_middleware()
11-08 13:27:21.707 30166 30234 I python : File "/data/data/org.learningequality.Kolibri/files/kolibri/dist/django/core/handlers/base.py", line 80, in load_middleware
11-08 13:27:21.707 30166 30234 I python : middleware = import_string(middleware_path)
11-08 13:27:21.707 30166 30234 I python : File "/data/data/org.learningequality.Kolibri/files/kolibri/dist/django/utils/module_loading.py", line 20, in import_string
11-08 13:27:21.707 30166 30234 I python : module = import_module(module_path)
11-08 13:27:21.707 30166 30234 I python : File "/home/kivy/.local/share/python-for-android/build/other_builds/python2-openssl-sqlite3/armeabi/python2/python-install/lib/python2.7/importlib/init.py", line 37, in import_module
11-08 13:27:21.707 30166 30234 I python : import(name)
11-08 13:27:21.707 30166 30234 I python : File "/data/user/0/org.learningequality.Kolibri/files/kolibri/core/analytics/middleware.py", line 24, in
11-08 13:27:21.707 30166 30234 I python : kolibri_process = psutil.Process()
11-08 13:27:21.707 30166 30234 I python : File "/data/user/0/org.learningequality.Kolibri/files/kolibri/core/analytics/pskolibri/init.py", line 225, in init
11-08 13:27:21.707 30166 30234 I python : self._init(pid)
11-08 13:27:21.707 30166 30234 I python : File "/data/user/0/org.learningequality.Kolibri/files/kolibri/core/analytics/pskolibri/init.py", line 246, in _init
11-08 13:27:21.707 30166 30234 I python : self.create_time()
11-08 13:27:21.707 30166 30234 I python : File "/data/user/0/org.learningequality.Kolibri/files/kolibri/core/analytics/pskolibri/init.py", line 273, in create_time
11-08 13:27:21.707 30166 30234 I python : self._create_time = self._proc.create_time()
11-08 13:27:21.707 30166 30234 I python : File "/data/user/0/org.learningequality.Kolibri/files/kolibri/core/analytics/pskolibri/_pslinux.py", line 170, in wrapper
11-08 13:27:21.707 30166 30234 I python : raise AccessDenied()
11-08 13:27:21.707 30166 30234 I python : AccessDenied
11-08 13:27:21.707 30166 30234 I python :
11-08 13:27:22.388 30166 30237 I python : INFO:root:Kolibri server not yet started, checking again in one second...
11-08 13:27:24.412 30166 30237 I python : INFO:root:Kolibri server not yet started, checking again in one second...
11-08 13:27:26.430 30166 30237 I python : INFO:root:Kolibri server not yet started, checking again in one second...

Update Documentation

Documentation is going to be really out of date after merging the pew branch, which is currently where active development is happening.

Loading app when already running shows a crash message

If you load the app, then open the applications list and start the app again from it, you will receive an error message. The new instance of Kolibri will load fine, so it seems it is the old, running Kolibri instance that throws the error. We should determine the cause of the error and see about fixing it. (It might be that the p4a backend needs to be handling some lifecycle event that it currently isn't.)

App crashes if user tries to launch while running

If the user starts the app, then later tries to re-open it by selecting it from the app list while it's running, the app will crash. We should investigate ways of having the existing app just come into focus rather than having it try to start a new instance.

Login textbox is very laggy and misses keys pressed.

Observed behavior

Login textbox is very laggy and misses keys pressed.

Solution was to click outside the textbox then click on the textbox again. Notice on the .gif below that the "virtual keyboard" icon appeared at the upper left portion of the screen as I did this. The textbox worked after this.

I'm not sure if this is because I'm using BlueStacks emulator or not. I will try this on Android Studio emulator (still downloading) or another emulator.

2020-05-07-thu--android testing - login typing issue

Expected behavior

Login textbox should work properly.

User-facing consequences

User gets frustrated by the laggy and missing keys pressed behavior.

Errors and logs

Took this from the Android VM at sdcard/Android/data/org.learningequality.Kolibri/files/KOLIBRI_DATA/logs/ folder. The debug.txt file has no content.

kolibri.txt

Steps to reproduce

  1. Install and setup Kolibri Android .apk build 144 linked below.
  2. Create users and attempt to login them.

Context

Tell us about your environment, including:

build_docker and run_docker fail on master branch

on master branch make run_docker fails with the following error:

[INFO]:    -> running gcc -dumpmachine
[INFO]:    -> running cp /src/python-for-android/pythonforandroid/recipes/python2/Setup.local-ssl Modules/Setup.local                    
[INFO]:    -> running sed -i.backup s#^SSL=.*#SSL=/home/kivy/.local/share/python-for-android/build/other_build...(and 46 more)
[INFO]:    -> running configure --host=arm-eabi --build=x86_64-linux-gnu --prefix=/home/kivy/.local/share/pyth...(and 147 more)
Traceback (most recent call last):
  File "/usr/local/bin/p4a", line 11, in <module>
    load_entry_point('python-for-android', 'console_scripts', 'p4a')()
  File "/src/python-for-android/pythonforandroid/toolchain.py", line 872, in main
    ToolchainCL()
  File "/src/python-for-android/pythonforandroid/toolchain.py", line 498, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/src/python-for-android/pythonforandroid/toolchain.py", line 150, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/src/python-for-android/pythonforandroid/toolchain.py", line 194, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/src/python-for-android/pythonforandroid/build.py", line 564, in build_recipes
    recipe.build_arch(arch)
  File "/src/python-for-android/pythonforandroid/recipes/python2/__init__.py", line 44, in build_arch
    self.do_python_build(arch)
  File "/src/python-for-android/pythonforandroid/recipes/python2/__init__.py", line 124, in do_python_build
    _env=env)
  File "/src/python-for-android/pythonforandroid/logger.py", line 174, in shprint
    output = command(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1474, in __call__
    extracted_call_args, kwargs = self._extract_call_args(kwargs)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1377, in _extract_call_args
    raise TypeError("Invalid special arguments:\n\n%s\n" % exc_msg)
TypeError: Invalid special arguments:

  'env': value u'x86_64-linux-gnu' of env key 'BUILDARCH' must be a str

error first appears during docker build at Step 10/14 : RUN python ./scripts/create_dummy_project_info.py && pew init android

Channel import does not work.

Attempting to import a channel results in a Internal server error.

Tested using:
Kolibri Develop branch
$10 phone

Sign releases with a production key (currently unclear how to 'upgrade' or re-install)

Reported during 0.5.x hack session on Android 7:

Unable to install the .apk file if an existing installation of Kolibri is on the device. It doesn't re-install over it like the .pex or .exe file

Install Kolibri on Android device using .apk

  1. Try installing a newer version of Kolibri on Android device using .apk
  2. An error is shown by the android OS
  3. The user had to uninstall the previous version to proceed

Sounds like part of the issue might have to do with signing certificates changing between builds. (cc @jamalex )

Investigate changing p4a to store and load python in apk

Initially, p4a was going to simply copy the entire Python distro into the apk, and run it from there. However, this failed due to the Android toolchain deleting some files during build. The only details I could find on this issue were in a comment here:

kivy/python-for-android#202 (comment)

Given how long ago the comment was, and how little is known about the severity of the problem, it may be worth investigating whether or not we can make this process work now. This should probably be after the current milestone, but this would massively speed up initial load on old devices, and even newer ones, so I think it's worth at least a little time to investigate.

Continual spewing of "WebViewLoader: Could not ping localhost:5000" in Android app long after it has loaded and is being used.

@jamalex notes from bug bash:
per logcat — it seems it continues to try to check the server even when not available — and actually, it's not even running on port 5000, it's on 8080 — seems like it's a pew thing

https://www.notion.so/learningequality/BUG-ish-Continual-spewing-of-WebViewLoader-Could-not-ping-localhost-5000-in-Android-app-long-aft-282e4478d4c94f699edb773ea582a29a

Learner cannot see class video or topic - just a blank page with title on top.

Observed behavior

Learner cannot see the class topic or video - just sees a blank page with the topic title on top. The quiz section worked though.

2020-05-07-thu--android testing - add by 10 issue

The coach and admin however can see the class topic or video.
2020-05-07-thu--android testing - add by 10 issue 2

Expected behavior

Learner should see the class topic.

User-facing consequences

Learner is confused whether to wait for the page

Errors and logs

Took this from the Android VM at sdcard/Android/data/org.learningequality.Kolibri/files/KOLIBRI_DATA/logs/ folder. The debug.txt file has no content.

kolibri.txt

Steps to reproduce

  1. Use the "Radina test channel" and TESSA for sample channels.
  2. Create a coach, plan a class, then assign contents.
  3. Create a learner, assign to a class, then access the class content.

Context

Tell us about your environment, including:

Create a job execution script to execute Kolibri tasks in a WorkManager context

In order to allow our asynchronous tasks to be effectively run in the Android context, we will need to make a wrapper script that handles managing display of notifications in the case of a long running task, and of executing the job execution function with the appropriate job id passed in.

This script should access Android APIs via pyjnius in order to get the job_id information that needs to be passed as part of the WorkManager data: https://developer.android.com/topic/libraries/architecture/workmanager

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.