Kivy crash course 12: Using Android APIs

preview_player
Показать описание
In this video I give a quick overview of three (related) ways to access android's apis from python, including the highly flexible pyjnius module for wrapping java classes and the plyer module providing a pythonic, platform-independent mechanism to access hardware and os apis.

Links:
Рекомендации по теме
Комментарии
Автор

Thanks a ton, great video! Please keep making them, this is one of the best tutorial series on programming that I have seen so far.

ogh
Автор

The final source code did not work for me. I had to change it to *from plyer import notification* and *notification.notify(...)*.

BlaXpirit
Автор

How should I handle Android runtime permissions in kivy app. Plz help, I am unable to find any guide regarding this.

netsmertia
Автор

Hello Alexandor. I have seen all your other videos but i have no idea what's going on in this one. Could you tell me the prerequisite knowledge I need to be able to understand this video?
Thank you.

abhijaybharathan
Автор

Hello Alexander, first of all thanks for the tutorial it's been of great help.
Now I have and issue with the mail API of plyer. When I try to enter an utf-8 string like 'ó', in the gmail application it writes a character like 'Â3' or similar. Do you know what's the error here?
Thank you

Pinaret
Автор

Thanks for the great tutorial. Please
How to import android? what should I install to be able to import it?
Thanks in advance

mohamedgabr
Автор

do you think I can create a program that records my screen and my audio using kivy and plyer?

regs
Автор

i cannot seem to stall pyler into pycharm.
it just says
'unresolved reference pyler'
i did:
pip install pyler
from pyler.notification import notify

ive tried everything i could find about this on stackoverflow.

does anyone know something i dont about this?

SummersSnowVideos
Автор

Thank You for sharing this, I also want to try this code with qpython which also has pyjnius lib. Hope it will also run

jalankoe
Автор

Hello, is possible call an Activity of an external class. java? 
for example, a class that performs AR(augmented Reality, ARToolKit) in Android?
I hope I can answer. Thanks

omarochoa
Автор

I successfully built and packaged your example. Once I try to run it on my device it crashes. Viewing debug output in the terminal on my pc (once I enabled dev mode on phone...), I see the following error:

V/Vibrator( 2437): vibrateImmVibe - PUID: 1000, PackageName: android, type: 14, magType: TouchMagnitude
D/StrictMode( 8754): StrictMode policy violation; ~duration=1649 ms: policy=31 violation=2
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at Method)
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at
D/StrictMode( 8754):     at Method)

Any idea what could be causing this?

UPDATE:
In deevloper options on phone, I disabled "Verify apps via USB" (Check installed apps from ADB.ADT for harmful behaviour) .  Now I no longer see this error it seems. 

Now a new one appears:

W/ContextImpl(23670): Calling a method in the system process without a qualified user:
W/ActivityThread(23761): ClassLoader.getResources: The class loader returned by may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example:
W/ContextImpl(23670): Calling a method in the system process without a qualified user:

dpelletier
Автор

Many thanks for your tutorials Alex.  I have a few questions:

1) I was wondering what emulators are people using with the kivy/buildozer stack?

2) Is there an easy way to run your project in the emulator from:
    A) the command line,
    B) from within python IDEs like WingWare IDE or PyCharm?

3) What happens if you want to add new packages to your python installation that buildozer is using (after you’ve already initially built)?  After seeing your video, I'd like to be able to use plyer. If you pip install plyer to your system’s default python installation, the next time you run “buildozer -v android debug”, does it dynamically include new python modules into your build?

Thanks in advance

dpelletier
Автор

Great ..make more videos ...on Android api & pyjinus

sksahil
Автор

org.renpy is not working instead i used org.kivy

speedfurious
Автор

This may have been better as two tutorials, one for pyjnius and one for pyler.

Just saying. . .

jamesdangelo
Автор

I think that you still need a little knowledge about native android development to use jnius (like activities, context, services, etc). Still, it was a great video.

universalmango