Go Down

Topic: Bluetooth Android - Arduino App Error - java.lang.IllegalArgumentException: null (Read 647 times) previous topic - next topic

Semixi

-3
down vote
favorite
I need your help!

First: I am from austria , so my english is not so good. So I apologize for the mistakes I will make!

This is my first project I try with Android Studio. I am a newbie in programming. I have not much skill in Arduino and Android program language, but I need it for my bachelor project, so I have to learn it!

I worked with a tutorial video, which was in spanish, so I have no clue what that guy was talking about, but I understood the code all in all.

My problem is, when I start the app on my phone, the first screen (paired devices) works fine. But when I press on the paired device...

This following error occurs :

Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. D/OpenGLRenderer: ProgramCache.generateProgram: 103079215104 D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: bachelor_projekt.bluetoothcontroller, PID: 11061 java.lang.RuntimeException: Unable to resume activity {bachelor_projekt.bluetoothcontroller/bachelor_projekt.bluetoothcontroller.UserInterface}: java.lang.IllegalArgumentException: null is not a valid Bluetooth address at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3506) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3546) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2795) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6247) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924) Caused by: java.lang.IllegalArgumentException: null is not a valid Bluetooth address at android.bluetooth.BluetoothDevice.(BluetoothDevice.java:668) at android.bluetooth.BluetoothAdapter.getRemoteDevice(BluetoothAdapter.java:553) at bachelor_projekt.bluetoothcontroller.UserInterface.onResume(UserInterface.java:122) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1272) at android.app.Activity.performResume(Activity.java:6917) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3477) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3546)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2795)  at android.app.ActivityThread.-wrap12(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)  at android.os.Handler.dispatchMessage(Handler.java:110)  at android.os.Looper.loop(Looper.java:203)  at android.app.ActivityThread.main(ActivityThread.java:6247)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)  I/Process: Sending signal. PID: 11061 SIG: 9 Application terminated.



I need your help!

First: I am from austria , so my english is not so good. So I apologize for the mistakes I will make!

This is my first project I try with Android Studio. I am a newbie in programming. I have not much skill in Arduino and Android program language, but I need it for my bachelor project, so I have to learn it!

I worked with a tutorial video, which was in spanish, so I have no clue what that guy was talking about, but I understood the code all in all.

My problem is, when I start the app on my phone, the first screen (paired devices) works fine. But when I press on the paired device...

This following error occurs :

Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. D/OpenGLRenderer: ProgramCache.generateProgram: 103079215104 D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: bachelor_projekt.bluetoothcontroller, PID: 11061 java.lang.RuntimeException: Unable to resume activity {bachelor_projekt.bluetoothcontroller/bachelor_projekt.bluetoothcontroller.UserInterface}: java.lang.IllegalArgumentException: null is not a valid Bluetooth address at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3506) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3546) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2795) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6247) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924) Caused by: java.lang.IllegalArgumentException: null is not a valid Bluetooth address at android.bluetooth.BluetoothDevice.(BluetoothDevice.java:668) at android.bluetooth.BluetoothAdapter.getRemoteDevice(BluetoothAdapter.java:553) at bachelor_projekt.bluetoothcontroller.UserInterface.onResume(UserInterface.java:122) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1272) at android.app.Activity.performResume(Activity.java:6917) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3477) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3546)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2795)  at android.app.ActivityThread.-wrap12(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)  at android.os.Handler.dispatchMessage(Handler.java:110)  at android.os.Looper.loop(Looper.java:203)  at android.app.ActivityThread.main(ActivityThread.java:6247)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)  I/Process: Sending signal. PID: 11061 SIG: 9 Application terminated.
After that message, the app shuts down :

I divided my app in:

Bluetooth - for the bluetooth connection

Interface - The second part is the user interface - Here should be the actual project which is just for start (3 Buttons, 1 for LED on, 1 for LED off, 1 for disconnect).


So if you need for information, just tell me. Hopefully someone of you understands my problem and can help me :)

Best wishes Semi

Go Up