HC06 Bluetooth issue

Hello, i'm facing a problem with my bluetooth connection
when i use a "terminal" like application on my android phone the communication works well!

But when i want to connect it directly on my phone it dosn't connect and say "Apparing failed"

The goal of that sketch is to be a bluetooth keyboard that send 2 commands when i push buttons, so it would be a 2 characters keyboard

Help please i'm lost in this thanks

AnotherBeginner:
when i use a "terminal" like application on my android phone the communication works well!

This suggests that everything is fine, and bluetooth is doing what it is supposed to do

But when i want to connect it directly on my phone it dosn't connect and say "Apparing failed"

This is incoherent and suggests nothing. It is faintly possible that you are trying to do something that HC-05 is not supposed to do - like work under another protocol. HC-05 is SPP only.

You need to create an android app by yourself where you will allow it some bluetooth permissions etc ( you are creating a bluetooth terminal) and it will work fine. You have already tested it on third party apps and its working fine.

Once you have created the terminal then you can add your keyboard functionality in it.