1

I am trying to get commas as the decimal separator for the numeric keyboard on a Samsung Galaxy Note II. I've tested my app on other devices (Moto X, rooted Samsung GS4) and their numpads have the correct separator if I change the language from the device's system settings. Is this feature not possible on Samsung's software?

Edit/Clarification: Is there a way to have the correct decimal separator without telling my users to download a different keyboard or creating my own input UI?

Andrew Moore
  • 67
  • 2
  • 8
  • 2
    Sorry -- I completely misunderstood the question. Input method editors (a.k.a., soft keyboards) should be choosing the decimal separator based on the user's chosen locale. If that is not working on this device, it's probably a device bug, and you'd need to contact Samsung. – CommonsWare Nov 18 '14 at 14:54
  • My fix for this answer is here: [https://stackoverflow.com/a/63520135/11033601](https://stackoverflow.com/a/63520135/11033601) – Alex K Aug 21 '20 at 09:29

2 Answers2

0

I experience the same problem, even now 2 years after you asked the question. You better install the Google keyboard:

https://play.google.com/store/apps/details?id=com.google.android.inputmethod.latin&hl=no

If you need to distribute the APK using your internal device management system the APK can be downloaded from here:

https://www.apkmirror.com/apk/google-inc/google-keyboard/

Unfortunately (or not if you think security wise) there is no programmatic way for your app to decide which keyboard to use. Best option is to have a configuration page in your app telling the users how and why they should change their default keyboard.

You can use this code to open a keyboard settings dialog:

    public void showInputMethodPicker() {

    InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE);
    if (imeManager != null) {
        imeManager.showInputMethodPicker();
    }
}
Ove Stoerholt
  • 3,843
  • 4
  • 25
  • 33
0

I had a custom Entry, called LineEntry, this is my solution for the Samsumg devices to change the numeric keyboard.

[assembly: ExportRenderer(typeof(LineEntry), typeof(CustomEntryRenderer))]
namespace myApp.Droid.Services
{

    public class CustomEntryRenderer : EntryRenderer
    {

        public CustomEntryRenderer(Android.Content.Context context) : base(context)
        {
        }

        protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
        {
            base.OnElementChanged(e);
            if (e.OldElement != null || this.Element == null)
            {
                return;
            }

            //ClassNumber | NumberFlagDecimal | NumberFlagSigned
            if (this.Control.InputType == Keyboard.Numeric.ToInputType())
            {
                //  this.Control.KeyListener = Android.Text.Method.DigitsKeyListener.GetInstance(Resources.Configuration.Locale, true, true);
                this.Control.KeyListener = Android.Text.Method.DigitsKeyListener.GetInstance(string.Format("1234567890{0}", System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator));
                this.Control.InputType = Android.Text.InputTypes.ClassNumber | Android.Text.InputTypes.NumberFlagDecimal;
            }
        }
    }
}
El0din
  • 3,208
  • 3
  • 20
  • 31