Some Pyjnius tools for Kivy-Android developments
Project description
Kvdroid
Some Android tools for Kivy developments
Dependencies
Android min-api21
Requirements
kivy, android, jnius
Installation
pip install kvdroid
Usage
To detect keyboard height
from kvdroid import keyboard_height
print(keyboard_height())
To detect if app is installed from Play Store or not
from kvdroid.appsource import app_source
print(app_source)
To get absolute screen size in dp-pixel and detect current orientation
from kvdroid.metrics import screen
print(screen.orientation())
print(screen.width_dp())
print(screen.height_px())
To check if device has a data connection both for wifi and cellular
from kvdroid.network import network_state
print(network_state)
To check if device is in dark mode or not
from kvdroid.darkmode import dark_mode
print(dark_mode)
To get device informations.
Available options are 'model','brand','manufacturer','version','sdk','product','base','rom','security','hardware','tags','sdk_int'
from kvdroid import device_info
print(device_info("model"))
To enable immersive mode
from kvdroid import immersive_mode
immersive_mode(True) # default is False
To launch a specific app
from kvdroid import launch_app
launch_app(<app_package>,<app_activity>)
To open target app's details page
from kvdroid import app_details
app_details(<app_package>)
To detect current device's language
from kvdroid.lang import device_lang
print(device_lang)
To set statusbar color
from kvdroid import statusbar_color
statusbar_color("#FFFFFF","black")
To set navigationbar color
from kvdroid import navbar_color
navbar_color("#FFFFFF")
To display a toast message
from kvdroid import toast
toast("hello world")
To get absolute sdcard path
from kvdroid.path import sdcard
print(sdcard)
To get path of working app folder
from kvdroid.path import app_folder
print(app_folder)
To change default wallpaper
from kvdroid import set_wallpaper
set_wallpaper("/sdcard/test.jpg")
To use text-to-speech
from kvdroid import speech
speech("hello world", "en")
To use default Download Manager
from kvdroid import download_manager
download_manager(<title>,<description>,<URL>,<path>,<file>)
To restart the app
from kvdroid import restart_app
restart_app(True) # default is false
To share text via Android Share menu
from kvdroid import share_text
share_text("hello world", title="Share")
To share any file via Android Share menu
from kvdroid import share_file
share_file(<path-to-file>, <title>, <chooser>, <app-package: open-with-default-app>)
share_file("/sdcard/test.pdf", title='Share', chooser=False, app_package=None)
To play suported music format or radio stream through Android Media Player
player.mPLayer = Android Media PLayer
from kvdroid.audio import player
player.play(<path-to-music-file>)
player.stream(Url) # radio
player.pause()
player.resume()
player.seek(value)
player.do_loop(True) # default is False
player.is_playing()
player.get_duration()
player.current_position()
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file kvdroid-0.2.0.tar.gz
.
File metadata
- Download URL: kvdroid-0.2.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae0016fda0d89f97d41e931206adae817a7c8c93bd3baa2b57ef703920d51ebb |
|
MD5 | 3df1fe11d1a08a5a0b15638cce46a003 |
|
BLAKE2b-256 | 524fbf350c74d13f38f75ca10c586ef9dbd4fb4c71cc961c68bb43398cc063d4 |