File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ from distutils .core import setup
3+ from setuptools import find_packages
4+
5+ options = {'apk' : {'debug' : None ,
6+ 'requirements' : 'python2,genericndkbuild' ,
7+ 'android-api' : 27 ,
8+ 'ndk-api' : 21 ,
9+ 'ndk-dir' : '/home/asandy/android/crystax-ndk-10.3.2' ,
10+ 'dist-name' : 'testapp_service' ,
11+ 'ndk-version' : '10.3.2' ,
12+ 'bootstrap' : 'service_only' ,
13+ 'permissions' : ['INTERNET' , 'VIBRATE' ],
14+ 'arch' : 'armeabi-v7a' ,
15+ 'window' : None ,
16+ }}
17+
18+ package_data = {'' : ['*.py' ]}
19+
20+ packages = find_packages ()
21+ print ('packages are' , packages )
22+
23+ setup (
24+ name = 'testapp_service' ,
25+ version = '1.0' ,
26+ description = 'p4a service testapp' ,
27+ author = 'Alexander Taylor' ,
28+ 29+ packages = find_packages (),
30+ options = options ,
31+ package_data = {'testapp_service' : ['*.py' ]}
32+ )
Original file line number Diff line number Diff line change 1+ print ('main.py was successfully called' )
2+
3+ import sys
4+ print ('python version is: ' , sys .version )
5+ print ('python sys.path is: ' , sys .path )
6+
7+ from math import sqrt
8+ print ('import math worked' )
9+
10+ for i in range (45 , 50 ):
11+ print (i , sqrt (i ))
12+
13+ print ('Just printing stuff apparently worked, trying a simple service' )
14+ import datetime , threading , time
15+
16+ next_call = time .time ()
17+
18+
19+ def service_timer ():
20+ global next_call
21+ print ('P4a datetime service: {}' .format (datetime .datetime .now ()))
22+ next_call = next_call + 1
23+ threading .Timer (next_call - time .time (), service_timer ).start ()
24+
25+
26+ print ('Starting the service timer...' )
27+ service_timer ()
You can’t perform that action at this time.
0 commit comments