diff --git a/.buildozer b/.buildozer new file mode 120000 index 0000000000000000000000000000000000000000..50ad1b4c8846dd0c4ab7ec34444fd35bfbab2448 --- /dev/null +++ b/.buildozer @@ -0,0 +1 @@ +/home/cse/.buildozer_share \ No newline at end of file diff --git a/.gitignore b/.gitignore index 992a27a3655d7bf345eb414cab412c0e3183ffb8..cd4671cc426262b4805a15c8dbc6ca97b9217b44 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ *.pyo .idea -.buildozer bin diff --git a/buildozer.spec b/buildozer.spec index 4b2cfe28e597f244aaa1905e6675e397b6bc072f..df1b89fec3599561af0a32c0b340431bff4720fb 100644 --- a/buildozer.spec +++ b/buildozer.spec @@ -36,7 +36,7 @@ version = 1.0 # (list) Application requirements # comma separated e.g. requirements = sqlite3,kivy -requirements = kivy +requirements = python3,kivy # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes @@ -88,16 +88,16 @@ fullscreen = 0 #android.permissions = INTERNET # (int) Android API to use -#android.api = 19 +android.api = 21 # (int) Minimum API required -#android.minapi = 9 +android.minapi = 21 # (int) Android SDK version to use #android.sdk = 20 # (str) Android NDK version to use -#android.ndk = 9c +android.ndk = 17c # (bool) Use --private data storage (True) or --dir public storage (False) #android.private_storage = True @@ -146,8 +146,11 @@ fullscreen = 0 # bootstrap) #android.gradle_dependencies = +# (list) Java classes to add as activities to the manifest. +#android.add_activites = com.example.ExampleActivity + # (str) python-for-android branch to use, defaults to stable -#p4a.branch = stable +p4a.branch = master # (str) OUYA Console category. Should be one of GAME or APP # If you leave this blank, OUYA support will not be enabled @@ -159,6 +162,9 @@ fullscreen = 0 # (str) XML file to include as an intent filters in <activity> tag #android.manifest.intent_filters = +# (str) launchMode to set for the main activity +#android.manifest.launch_mode = standard + # (list) Android additional libraries to copy into libs/armeabi #android.add_libs_armeabi = libs/android/*.so #android.add_libs_armeabi_v7a = libs/android-v7/*.so @@ -201,6 +207,9 @@ android.arch = armeabi-v7a # (str) Bootstrap to use for android builds # p4a.bootstrap = sdl2 +# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask) +#p4a.port = + # # iOS specific @@ -220,7 +229,7 @@ android.arch = armeabi-v7a [buildozer] # (int) Log level (0 = error only, 1 = info, 2 = debug (with command output)) -log_level = 2 +log_level = 1 # (int) Display warning if buildozer is run as root (0 = False, 1 = True) warn_on_root = 1 diff --git a/demo.kv b/demo.kv index d6b6a41c68dd1b2b5c1b666546bf05b0b8816764..5c6e9c75f867bbccd69be0534beda0bcd75d839c 100644 --- a/demo.kv +++ b/demo.kv @@ -3,7 +3,7 @@ BoxLayout: BoxLayout: id: fields orientation: 'vertical' - size_hint: (1, 6) + size_hint: (1.0, 6.0) BoxLayout: orientation: 'horizontal' Button: @@ -17,9 +17,9 @@ BoxLayout: on_press: app.print_total() <Field>: - orientation: 'horizontal' # Field is a kind of BoxLayout + orientation: 'horizontal' # Field is a kind of BoxLayout. Label: - text: root.label_text # Refers to a property declared in the Field class + text: root.label_text # In a subwidget's Kv, `root.…` refers to a property of the Field widget. TextInput: id: input multiline: False diff --git a/main.py b/main.py index 5c275528448e3d2982f6b0326c1f12a15d69b57f..558d3d5938409f64bd4de0b80bb508551897b6c5 100644 --- a/main.py +++ b/main.py @@ -10,23 +10,22 @@ class Field(BoxLayout): class DemoApp(App): def add_field(self): container = self.root.ids.fields - new_label_text = 'Field #{index}: '.format(index=len(container.children)) - container.add_widget(Field(label_text=new_label_text)) + container.add_widget(Field(label_text=f'Field #{len(container.children)}: ')) def remove_field(self): container = self.root.ids.fields if len(container.children) > 0: - container.remove_widget(container.children[0]) # children are indexed in reverse display order + container.remove_widget(container.children[0]) # Children are indexed in reverse display order. def print_total(self): container = self.root.ids.fields total = 0 for field in container.children: try: - total += float(field.ids.input.text) # refer to a subwidget by id + total += float(field.ids.input.text) # `widget.ids.…` can be used to refer to a subwidget by ID. except ValueError: - pass # ignore non-numeric values - print('Total of fields\' numeric values: {total}'.format(total=total)) + pass # Ignore non-numeric values. + print(f'Total of fields\' numeric values: {total}') if __name__ == '__main__':