44from kivy .properties import StringProperty
55
66from kivy .uix .popup import Popup
7+ from kivy .clock import Clock
8+
9+ print ('Imported kivy' )
10+ from kivy .utils import platform
11+ print ('platform is' , platform )
712
813
914kv = '''
2025 FixedSizeButton:
2126 text: 'test pyjnius'
2227 on_press: app.test_pyjnius()
28+ Widget:
29+ size_hint_y: None
30+ height: 1000
31+ on_touch_down: print 'touched at', args[-1].pos
2332
2433<ErrorPopup>:
2534 title: 'Error'
@@ -39,21 +48,28 @@ def raise_error(error):
3948class TestApp (App ):
4049 def build (self ):
4150 root = Builder .load_string (kv )
51+ Clock .schedule_interval (self .print_something , 2 )
52+ Clock .schedule_interval (self .test_pyjnius , 5 )
4253 return root
4354
55+ def print_something (self , * args ):
56+ print ('App print tick' , Clock .get_boottime ())
57+
4458 def on_pause (self ):
4559 return True
4660
47- def test_pyjnius (self ):
61+ def test_pyjnius (self , * args ):
4862 try :
4963 from jnius import autoclass
5064 except ImportError :
5165 raise_error ('Could not import pyjnius' )
5266 return
5367
5468 print ('Attempting to vibrate with pyjnius' )
55- PythonActivity = autoclass ('org.renpy.android.PythonActivity' )
56- activity = PythonActivity .mActivity
69+ # PythonActivity = autoclass('org.renpy.android.PythonActivity')
70+ # activity = PythonActivity.mActivity
71+ NewPythonActivity = autoclass ('net.inclem.android.NewPythonActivity' )
72+ activity = NewPythonActivity .mActivity
5773 Intent = autoclass ('android.content.Intent' )
5874 Context = autoclass ('android.content.Context' )
5975 vibrator = activity .getSystemService (Context .VIBRATOR_SERVICE )
0 commit comments