Skip to content

Commit 6782c70

Browse files
authored
Merge pull request kivy#1475 from KeyWeeUsr/fix_android
Fix android module JAVA_NAMESPACE and JNI_NAMESPACE with unicode
2 parents 891b286 + df6e5bc commit 6782c70

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pythonforandroid/recipes/android/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ def prebuild_arch(self, arch):
3030
th = '#define {} {}\n'
3131
tpy = '{} = {}\n'
3232

33-
bootstrap = bootstrap_name = self.ctx.bootstrap.name
33+
bootstrap = bootstrap_name = self.ctx.bootstrap.name.decode('utf-8')
3434
is_sdl2 = bootstrap_name in ('sdl2', 'sdl2python3', 'sdl2_gradle')
3535
is_pygame = bootstrap_name in ('pygame',)
3636
is_webview = bootstrap_name in ('webview',)
3737

3838
if is_sdl2 or is_webview:
3939
if is_sdl2:
4040
bootstrap = 'sdl2'
41-
java_ns = 'org.kivy.android'
42-
jni_ns = 'org/kivy/android'
41+
java_ns = u'org.kivy.android'
42+
jni_ns = u'org/kivy/android'
4343
elif is_pygame:
4444
java_ns = 'org.renpy.android'
4545
jni_ns = 'org/renpy/android'

pythonforandroid/recipes/android/src/android/_android.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ api_version = autoclass('android.os.Build$VERSION').SDK_INT
175175
version_codes = autoclass('android.os.Build$VERSION_CODES')
176176

177177

178-
python_act = autoclass(JAVA_NAMESPACE + '.PythonActivity')
179-
Rect = autoclass('android.graphics.Rect')
178+
python_act = autoclass(JAVA_NAMESPACE + u'.PythonActivity')
179+
Rect = autoclass(u'android.graphics.Rect')
180180
mActivity = python_act.mActivity
181181
if mActivity:
182182
# PyGame backend already has the listener so adding
183183
# one here leads to a crash/too much cpu usage.
184-
# SDL2 now does noe need the listener so there is
184+
# SDL2 now does not need the listener so there is
185185
# no point adding a processor intensive layout listenere here.
186186
height = 0
187187
def get_keyboard_height():

0 commit comments

Comments
 (0)