Build app with android studio

I build my keyboard app with android studio used KMsample1 project successfully. but output app apk was with out of chose for add keyboard as default, so i want to add 2 chose view in first bage like

1- Open input method settings

2- Open the input method menu
How I can do it?

1 Like

Hello @ralfareh

Good progress in building the KMSample1 project successfully!

I think if you want controls for input method settings, you should try to build the KMSample2 project. KMSample2 starts with this page which has links to add your keyboard as default:

Once you’ve added your keyboard as default, you can exit KMSample2 and use your keyboard in other apps like this

kmsample2 - 2

1 Like

Thanks for your advice I will try it

Another Inquiry can I change project name to show as my keyboard name

Can you tell me what name you mean by “project name”?

Are you asking about the text on the spacebar that can be customized? (Default is language name - keyboard name)

I mean when I build my app apk name was KMsample1 I think I can change it to be my keyboard name

Iam going KMsample2 to add custom keyboard information.
But when test app there was Error massage in keyboard language?


    // Add a custom keyboard
    Keyboard kbInfo = new Keyboard(
            "himyarit_musnad", // Package ID - filename of the .kmp file
            "himyarit_musnad", // Keyboard ID
            "Himyarit Musnad", // Keyboard Name
            "xsa",             // Language ID
            "old south arabic",          // Language Name
            "1.0",            // Keyboard Version
            "https://help.keyman.com/keyboard/himyarit_musnad/1.0/himyarit_musnad",             // URL to help documentation if available
            "",               // URL to latest .kmp file
            true,             // Boolean to show this is a new keyboard in the keyboard picker

            // Font information of the .ttf font to use in KMSample2("family": "SultanMusnad","source":"SultanMusnad-Normal.ttf")
            // himyarit_musnad  doesn't include a font. Can set blank "" or KMManager.KMDefault_KeyboardFont
            KMManager.KMDefault_KeyboardFont,  // Font for KMSample1 text field
            KMManager.KMDefault_KeyboardFont); // Font for OSK
    KMManager.addKeyboard(this, kbInfo);

     }

type or paste code here
    // Add a custom keyboard
    Keyboard kbInfo = new Keyboard(
            "himyarit_musnad", // Package ID - filename of the .kmp file
            "himyarit_musnad", // Keyboard ID
            "Himyarit Musnad", // Keyboard Name
            "xsa",             // Language ID
            "old south arabic",          // Language Name
            "1.0",            // Keyboard Version
            "https://help.keyman.com/keyboard/himyarit_musnad/1.0/himyarit_musnad",             // URL to help documentation if available
            "",               // URL to latest .kmp file
            true,             // Boolean to show this is a new keyboard in the keyboard picker

            // Font information of the .ttf font to use in KMSample2("family": "SultanMusnad","source":"SultanMusnad-Normal.ttf")
            // himyarit_musnad  doesn't include a font. Can set blank "" or KMManager.KMDefault_KeyboardFont
            KMManager.KMDefault_KeyboardFont,  // Font for KMSample1 text field
            KMManager.KMDefault_KeyboardFont); // Font for OSK
    KMManager.addKeyboard(this, kbInfo);

     }

Hmm, it’s a little hard to tell.
Did you copy the himyarit_musnad.kmp file into your project’s asset folder?

Yes first step I copy it

@darcy finally I solve problem there was different name of Language at kmp. After correct name it’s working
My new question can I add background image in blank to show like attach?

First, you’ll need to have your image saved in the resource folder for different screen resolutions. See the Android Studio reference on Resource Manager

Then, you’ll want to edit the MainActivity layout file which is located at
KMSample2/app/src/main/res/layout/activity_main.xml. The code for the layout already contains the text view and two buttons. You’ll add your image as an <ImageView>

Thanks agin it’s done

في الاثنين، 31 أكتوبر 2022 5:48 ص Darcy Wong via SIL Software <software_community@sil.org> كتب: