Open SigmaOrionis opened 5 years ago
hey , i have done all , with the same configurations but still couldn't figure out how to call the module.
func _ready():
if(Engine.has_singleton("GodotBluetooth")):
bluetooth = Engine.get_singleton("GodotBluetooth")
bluetooth.init(get_instance_id(), false)
print(Engine.has_singleton("GodotBluetooth"))
this does not work since has_singleton() returns false .
I also tried to go straight forward :
func _ready():
bluetooth = GodotBluetooth.new()
bluetooth.init(get_instance_id(), false)
but still it gives me a null erorr
I am sure i have done all right . Compiled with godot 3.1.1 - jdk 1.8.1 , configured the files, added module to project.godot properly , ran it on android , but i cannot call the bluetooth module .
Thanks SigmaOrionis Kind Regards
Make sure that on host device all security levels are open for application.
how can i assure this ?
Thanks , I got it working by enabling permissions on android export settings which are
Hi! I am trying to run the scons command, and it generates the following TypeError (in the config.py file): 'SConsEnvironment' object has no attribute 'android_add_to_permissions' I then edited the config.py exactly like what you have done above, but nothing has changed.
I am using Godot version 3.2.2 (since it has C# support for iOS which I will need for later). How can I compile this module for Godot version 3.2.2? (All other steps have been correctly performed, such as setting up the environment variables which works correctly as the Sconstruct file correct identified that Android is the targeted platform, but the error is generated at this module's config.py)
What should I do?
Thank you :)
firstly, sorry to inform you that it is not compatible with younger builds since android structure has changed a lot in 3.2 . and make sure that you are using a valid ndk
Thank you for your quick response!
So only the 3.1.1 version is supported, is that correct?
Yes that is correct , i can provide you my builds if you want . It's sheered 8MB .
That would be great! Thank you so much! Also does this library work with Bluetooth LE?
Yes, i assume . Will provide them as soon as i reach to my rig.
Yes, i assume . Will provide them as soon as i reach to my rig.
Thank you, but you don't need to do that, i just built them and will test them tomorrow, will let you know what happens! :D
Seriously thanks for your support, I really appreciate it!
Ok so I got this error when attaching the script:
Parse Error: Method 'get_instance_ID' is not declared in the current class
What did I mess up now? 😂
These code chunks were made in GODOT2 , you might expect those errors.
So now I got the apk up and running, but nothing is happening, not even errors are being generated. (I'm not being asked to connect to anything, not even permissions are being asked). My project is using a native mobile ArVr singleton and it has two simple scripts (which is where something is likely to have gone):
This script is the edited global script (For my project I am not using the connected and disconnected signals, so I removed them, will that cause any issue?) ` signal data_received
var bluetooth
func _ready(): if(Engine.has_singleton("GodotBluetooth")): bluetooth = Engine.get_singleton("GodotBluetooth") bluetooth.init(.get_instance_ID(), true) if bluetooth: bluetooth.getPairedDevices(true) pass
func _on_data_received(data_received): emit_signal("data_received", data_received) pass`
This script is attached to the ArVr Camera
` extends ARVRCamera onready var global = get_node("/root/global") var speed var x var y var pressed
func _ready(): set_signals() pass func _on_data_received(data_received): var data = int(data_received) pressed = (data / 1000)%10 var r = (data / 100) % 10 var yx = data % 10 var xx = (data / 10) % 10 x = xx -4 y = yx - 4
pass
func _fixed_process(delta): translate(Vector3(0,delta y,delta x)) pass func set_signals(): global.connect("data_received", self, "_on_data_received") pass `
Although its not showing here, all indentations are correctly implemented
edit config.py:
edit GodotBluetooth.java: comment this line: //import android.support.v7.app.AppCompatActivity;
there is no engine.cfg in godot 3.1.1, add it to project.godot
tested with JDK 1.8.1_181 and godot 3.1.1
thank you for lib, favarete Kind regards