Keyboard app with bluetooth

Hello, i am from holland so sorry for my bad english.

I am making an app that connects with a raspberry pi by bluetooth (windows 10 iot core, uwp app). I read al the samples that i clould find and with succes. i have now ia connection with bluetooth.

And now the thing i am struggling with. When i have the bluetooth connection i whant to show up the softkeyboard (in the futere i want to make my own with custom buttons) and then when i type something nothing happen on my raspberry pi, is there something extra i need to do?

This is the code to connect to my pi and then open keyboard.

    private async void List_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
    {
        BluetoothDevice dev = bonded[e.Position];

        UUID DEVICE_UUID = dev.GetUuids()[0].Uuid;

        MySocket = dev.CreateRfcommSocketToServiceRecord(DEVICE_UUID);
        if (MySocket != null)
        {
            Task<string> SubmitTask = new Task<string>(ConnectBluetooth);
            SubmitTask.Start();

            string Result = await SubmitTask;

            if (Result == "0")
            {
                Android.Widget.Toast.MakeText(Activity, "Connection Successful!", Android.Widget.ToastLength.Short).Show();
                ShowKeyboard();
            }
            else
            {
                Android.Widget.Toast.MakeText(Activity, "Connection Failed.", Android.Widget.ToastLength.Short).Show();
            }
        }

    }

    private string ConnectBluetooth()
    {
        Task.Run(() => { MySocket.Connect(); });
        return "0";
    }

    public void ShowKeyboard()
    {
            InputMethodManager imm = (InputMethodManager)Activity.GetSystemService(Context.InputMethodService);
            imm.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.ImplicitOnly);
    }
Sign In or Register to comment.