Good day. The question is the following: Why when I compile the code in python, I do not see the application on the android, but at the same time I found out that if I remove the import bluetooth and all of its components, will it work? Need to make bluetooth work on android? Here is the code itself:

from kivy.app import App from kivy.uix.label import Label from kivy.uix.widget import Widget from kivy.uix.button import Button import bluetooth class Widgets(Widget): def __init__(self): super(Widgets, self).__init__() def btn_clk1(self): a = self.lbl.text client=bluetooth.BluetoothSocket( bluetooth.RFCOMM ) ADDR = "00:68:58:00:6F:EA" client.connect((ADDR,1)) client.send(a) client.close() def btn_clk2(self): server_sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM ) port = 1 server_sock.bind(("",port)) server_sock.listen(1) client_sock,address = server_sock.accept() print ("Accepted connection from ",address) data = client_sock.recv(1024) self.lbl.text = data client_sock.close() server_sock.close() class SimpleKivy(App): def build(self): return Widgets() SimpleKivy().run() 

 #File name: kivyn.py #kivy 1.9.1 <Widgets>: lbl: my_label labe: my_labels Button: size: 100,75 pos: 0,0 text: "client" color: 0,1,0,1 font_size: 40 on_press: root.btn_clk1() Button: id: 1 size: 170,75 pos: 100,0 text: "server" color: 1,0,0,1 font_size: 40 on_press: root.btn_clk2() TextInput: id: my_label size: 300,300 pos: 300,0 text: "" color: 1,0,0,1 font_size: 40 TextInput: id: my_labels size: 300,300 pos: 300,300 text: "adr" color: 1,0,0,1 font_size: 40 

Thank you in advance!

    2 answers 2

    What does it mean, "I do not see the application on the android"? The bleutooth module, as far as I know, is not included in the standard Python delivery, which means that when building an Android package, you must tell all dependencies in android.requirements in the buildozer.spec file. And anyway, when will you learn to read the logs ?! In an application on Kivy, if it is more beautiful in the root directory of your program, in the .kivy folder there will be a log of the report.

    So that the directory with your application after installation was on the SD card, and you could see the logs, specify in the specification when building the package - android.private_storage = False

    Also, it would not be superfluous if you keep your log in the main.py file when importing the main application class:

     try: import program except: # запись лога 

    Then you will ask clear questions if you want an answer, and so, sorry, about anything!

      Sorry for not having written for so long. I had a problem related to compiling my code on a virtual machine. I hammered the name of the module into buildozer.spec, but at the same time there was a problem: this is an error that is displayed in the terminal

      Tell me how to fix it?