User Tools

Site Tools


doc:appunti:prog:kivy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:prog:kivy [2019/03/01 13:00] – [A Real App With an ActionBar] niccolodoc:appunti:prog:kivy [2025/11/19 07:29] (current) – [Settings and Clipboard problem] niccolo
Line 132: Line 132:
 {{.:kivy:kivywindowexample.png?direct&320|Kivy ActionBar Example}} {{.:kivy:kivywindowexample.png?direct&320|Kivy ActionBar Example}}
  
-===== APK Packager ===== 
  
-  * **[[https://github.com/kivy/python-for-android|python-for-android]]**+===== Logging ===== 
 + 
 +Like a plain Python program, it is possible for a Kivy app to produce some logging using the Kivy logger. The output will go, by default, to a file created into the app home directory, into the **files/app/.kivy/logs/** directory. 
 + 
 +<code python> 
 +from kivy.logger import Logger, LOG_LEVELS 
 +# Set the loglevel. The Android log file will be create into 
 +[app_home]/files/app/.kivy/logs/ 
 +Logger.setLevel(LOG_LEVELS['debug']) 
 +Logger.info('Informative message'
 +</code> 
 + 
 +Without root privileges it is not possibile for another Android app (e.g. a file browser) to access the log directory. The Kivy **app home** will be into the adopted SD card, under something like this: 
 + 
 +<code> 
 +/mnt/expand/[UUID]/user/0/[fully.qualified.app.name] 
 +</code> 
 + 
 +In older Android versions (e.g. Android 8) the app home directory will be something like: 
 + 
 +<code> 
 +/data/data/[fully.qualified.app.name] 
 +</code> 
 + 
 +Every time that the Kivy environment is initializated, a new log file will be created; the filename will be something like **kivy_YY-MM-DD_N.txt**, where YY-MM-DD is the date and N is a progressive integer starting from zero. 
 + 
 + 
 +===== The Settings module and Clipboard problem ===== 
 + 
 +Importing **Settings** or **SettingsWithNoMenu** from the **kivy.uix.settings** module, you may get the following error when editing a string option: 
 + 
 +<code> 
 +[INFO    [ClipboardProvider: gtk3(['clipboard_xclip', 'clipboard_xsel', 
 +                       'clipboard_dbusklipper'] ignored) 
 +[CRITICAL] [Cutbuffer] Unable to find any valuable Cutbuffer provider. Please enable debug 
 +                       logging (e.g. add -d if running from the command line, or change the 
 +                       log level in the config) and re-run your app to identify potential 
 +                       causes 
 +</code> 
 + 
 +In Linux/X11 environment you have to install the **xclip** and **xsel** packages. In Android the error is displayed, but the program continues.
  
doc/appunti/prog/kivy.1551441606.txt.gz · Last modified: by niccolo