In Preview mode, clicked on the Play button. Then a lot of text scrolling through console. The screen flashed once and a popup showed:
“APDE Sketch Preview has stopped”
In App mode, clicked on the Play button. Then a lot of text scrolling through console. It showed:
“Do you want to install an update to this existing application? Your existing data will not be lost. It does not require any special access”
Clicked on Install and the progress bar is shown. At the end a popup showed:
“BluetoothCursors has stopped.”
Not sure what was updating. Play Store doesn’t show any update for ADPE is required.
HI, @bigboss97
I hope you have access to two phones. Below you have a send code and a receiver code for each individual phone. Give permission to Bluetooth on both phones by choosing Settings/Sketch permmissions/ BLUETOOTH and also BLUETOOTH_ADM
I copied the sender code to my phone.
Opened a new sketch and pasted the codein it. It asked me to install update when I ran it (as described before). Then it crashed
Did you give the Bluetooth permission?
What is your Android version?
Please comment out the lines of the else part in the if block in the draw() function, and try once more.
Do you have another device with other Android version?
I’m using Android v8.0.0 It’s the latest what I’ve got.
I’ll go through the code and identify where exactly it crashes. Then I’ll get back to you. Thank you for your time
I checked my app permission. There are following:
Body Sensors, Calendar, Camera, Contacts Location, Microphone, Phone, SMS, Storage
I can’t find bluetooth.
Tap on the three dots top right screen to open overflow menu. Choose “Sketch Properties”, and then Sketch Permissions. All the permissions should be there.
OK.
Let’s try it different.
But for this test yo need two phones and pair them. On one phone you load the code below and change the string MY_PHONE with the string that appears as paired device on the other phone you want to connect to. (You see them in your phone :Settings/Bluetooth).
On the other phone you install an app named “Serial Bluetooth Terminal”, that you can find on Google’s Play store. In that app you tap on the menu top left and choose “Devices”. There you must see the name of the other phone if it is paired. Tab on the name of that phone and the Terminal will open. Then you run the sketch’s code below on the other phone. Now tap on the icon in the bluetooth terminal app, that looks like two hearts left of the trash can (top right).If everything goes well you will see ,"Connecting to (paired phone’s name) ", and then “Connected”. Nothing more will happen, it’s just to verify the connection.
You can already try installing the code above on one phone. If it not crashes it will say in the console that the device could not be found. If it not crashes it’s already a big step forward.
I tried it with my bluetooth speaker. I know it’s paired because I’ve been using RFO-BASIC to send BT commands to the speaker.
Actually, the device does not matter because it already crashed in the first line while generating the object with “new”
So your device does work with Bluetooth using the RFO-BASIC app?
I tried that language before I found Processing.
I really liked it, because Basic is my background, but it is incredible slow with graphics.
The only thing the code above does is creating a Ketai Bluetooth object. There are two possibilities left; or the Ketai lib does not work with Android OREO, or the APDE does not write the permissions in the Android manifest file.
In the f irst case I could write the code in plain Android java but I would need your phone to test it. In the second case I can guide you to the build folder, but to acsess that, your phone needs to be rooted. Is it?
Another thing you could try, is to load your sketch with an usb cable on your PC using Processing for Android Mode.
Yes, tapping 7 times on the “About this device”, bar in “Settings”, will create a new, “Developer Options” bar, where you set the usb options, to be able to use the MTP mode (Media Transfer Protocol.). I had a look at the Basic’s forum. It’s pretty quiet now, and the app isn’t available on the GPlay store anymore. A pity.
Anyhow, I would give it a try on PC, and let us know the result.
java.lang.NoClassDefFoundError: android/content/BroadcastReceiver
at sketch_200104a.setup(sketch_200104a.java:24)
at processing.core.PApplet.handleDraw(PApplet.java:2425)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
Caused by: java.lang.ClassNotFoundException: android.content.BroadcastReceiver
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more