0

I am creating an App for Dual Screen by using Presentation API for showing a separate view for Customer, in which there is an input field (EditText), which asks the customer to input depending on type of fields. Now, the issue is that the softkeyboard only appears on the main screen & not the secondary screen, due to which only the person facing main screen will be able to input values in EditText. But I want to open softkeyboard on both sides, not both at the same time and atleast they should be able to open it one at a time.

If I try to forcibly open the keyboard it still opens on the other side (main screen) only.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242

1 Answers1

1

If you were using Android 10:

From: https://developer.android.com/guide/topics/ui/foldables#software_keyboard

Software keyboard

A keyboard can be shown on a secondary screen if the display is configured to support system decorations. The input method editor will automatically show up if a text field requests input on that display.

While leads to:

Android Open Source Project - Input Method Editor Support

https://source.android.com/devices/tech/display/multi_display/ime-support

and that page has a lot of detail on the various implementation & security issues on having a multiple display IME.

As you mentioned a custom device running Android 7.1 unless the manufacturer has modified for system decorations:

From that AOSP page on IME support:

In Android 9 (and lower), the IME was only available on the default screen...

So from stock AOSP you can't have the native IME appear outside of the default display.

I can only suggest reaching out to the manufacturer to see if they have a custom SDK for that feature, else you will have to create your own IME-like view, assuming you can get touch events from the secondary display.

Morrison Chang
  • 11,691
  • 3
  • 41
  • 77
  • any reference for creating custom view similar to keyboard? – Lalit Poptani Dec 09 '19 at 08:16
  • Old overview of custom keyboard see: http://www.fampennings.nl/maarten/android/09keyboard/index.htm and https://developer.android.com/reference/android/inputmethodservice/KeyboardView which recommends copying the AOSP version as `KeyboardView` is deprecated in API 29. I would confirm touch events on secondary/vice screen as Sunmi appear to have some documentation/SDK. – Morrison Chang Dec 09 '19 at 08:23
  • Yes, touch is working fine on these devices, the only thing that is the keyboard! – Lalit Poptani Dec 09 '19 at 08:26
  • finally got it working with creating a custom keyboard! – Lalit Poptani Dec 23 '19 at 06:31
  • @c-an I created custom keyboard. – Lalit Poptani Nov 18 '20 at 05:55
  • @LalitPoptani How can it be shown to the secondary screen? Why are normal keyboards(such as google keyboard) not shown? Is there anything you need to set for the custom keyboard? – c-an Nov 18 '20 at 07:25
  • @c-an As you've posted a [few](https://stackoverflow.com/q/64725412/295004) [similar](https://stackoverflow.com/q/64798662/295004) [questions](https://stackoverflow.com/q/64801450/295004) if you want assistance you should link to one where you clearly define where you are stuck. I would always mention the hardware device/make/model as well as OS used in all questions since you are using custom hardware. Please don't use comments for your own full questions. – Morrison Chang Nov 18 '20 at 08:15
  • @MorrisonChang It's Sunmi T2. Thank you for the advice. – c-an Nov 18 '20 at 09:58