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!
