Android Keyboard Tutorial [简体中文]

[制作插件的目的]

 Unity提供的安卓键盘是比本机代码提供的非常有限制组合型文字有 input.comopositionstring 不能正常的活动情况而且 hideinput 也不能正常的活我把这样的环境里改变可以脱离了加以可以活用adjustResize 选项。  

 

 

[要求规格]

 Unity 4.6.3 or higher

NGUI 3.5.0 or higher

Android Minimum API Level: 9 (Android 2.3.1 Gingerbread)

 

 

[AndroidMenifest.xml  生成与修改]

  1. 来有AndroidMenifest.xml 话加以下面的代号

<activity

           android:name=com.OhYeahDev.softInput.KeyboardActivity

           android:configChanges=orientation|fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen

           >

</activity>

 

  1. 来没有Main Activity 这代号里加上下面的代号

 <intent-filter>

          <action android:name=android.intent.action.MAIN />

          <category android:name=android.intent.category.LAUNCHER />

</intent-filter>

</activity>

 

  1. AndroidMenifest.xml 没有的话把Sample_AndroidMainfest.xml复制在Assets/Plugins/Android文件夹后 撤除‘SamPle_’

 

 

[动活化]

AndroidKeyboardManager.Install()”  条理把应用驱动时得要一定召唤 

 

 

[发键盘与设定法]

  1. 在脚本上固定命名空

  1. Unity 提供的 TouchScreen keyboard方式来使用就可以

 

 

[设定加以选项]

  1. fullScreen
  • Landscape画面上有效的选项
  • 键盘设定全屏        

Non-FullScreen

 

  1. No Suggestions
  • 撤除键盘上的“Suggestion WordsBar

This option doesn’t work on certain hardware.

* 只在Landscape 上可以

 


  1. SoftInputMode
  • InputAdjustType.SOFT_INPUT_ADJUST_RESIZE 

 键盘位置在画面

  • InputAdjustType.SOFT_INPUT_ADJUST_PAN 

 跟上面反过来固定画面后发键盘

   4. KeepKeyboardOn

  • AdditionalOptions.keepKeyboardOn = true;
  • Keyboard is not hidden when the “Done” button is clicked

 

 

[固定高级选项]

  1. 可以加衣许多的FlagMask。(参考InputType.cs)

 

 

 

[NGUI连动]         

  1. Assets/Plugins/Android/AndroidKeyboard/NGUI/UIIput.zip 文件压缩后把他覆盖到基本的文件上
  • 2015现在有NGUI 3.8.0, 3.9.0版本
  • 发键盘前得要固定完成选项设定。(hideinput,搜房日内普通M哦的,No suggestion,fullScreen
  • hideinput 得要注意下面的代

 

  1. 设置InputTest_NGUI.apk 后可以试验NGUI连动

     

 

[Example Scenes]

Test_Landscape, Test_Portrait 是把使用 UnityEngine.UI来有试验键盘的技能的目的

  • 为试验,hide input没有光不可以选择(Drag)

     

     


 

Posted in Tutorials

Android Keyboard Tutorial [日本語]

[プラグイン制作の目的]

ユニティが提供するアンドロイドキーボードはネイティブコードが提供するものに比べて、とても制限的です。組立型文字の場合 Input.compositionStringが正常的な機能をしていなく、 hideInput フラッグもまた正常作動していません。私はこのような制約をなくし、そこに adjustResize オプションを追加し、活用できるようにしました。 

 


[要求仕様]

 Unity 4.6.3 以上

NGUI 3.5.0 以上

Android Mininim API Level : 9 (Android 2.3.1 ‘Gingerbread’)

 


[AndroidMenifest.xml 生成または修正]

  1. 既存 AndroidMenifest.xmlがあるなら、下記のコードを追加します。

<activity

           android:name=com.OhYeahDev.softInput.KeyboardActivity

           android:configChanges=orientation|fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen

           >

</activity>

 


  1. 既存 Main Activityがないなら、上記のコードに下記のコードを挿入します

 <intent-filter>

          <action android:name=android.intent.action.MAIN />

          <category android:name=android.intent.category.LAUNCHER />

        </intent-filter>

      </activity>

 

  1. 既存 AndroidMenifest.xmlがないなら、Sample_AndroidManifest.xml Assets/Plugins/Android フォルダーにコピーした後、ファイル名の ‘SamePle_’を削除してください。

 

 

[アクティビティ活性化]

AndroidKeyboardManager.Install() メソッドをアプリケーション駆動時に必ず呼び出してください。  

 

[キーボード出し及び設定法]

  1. スクリプトにネームスペースを定義します。

  1. ユニティが提供する TouchScreenKeyboard 方式で使用してください。

 


[追加オプション設定]

  1. fullScreen
  • Landscape画面で有効なオプション
  • キーボードを全体画面モードにする


Half Screen

 



  1. No Suggestions
  • キーボード上の ‘Suggestion Words’ Barを除去します。
    • 一部のハードウェア機種から、該当オプションが適用されない場合があります
    • Landscape 画面だけで可能

 



  1. SoftInputMode
  • InputAdjustType.SOFT_INPUT_ADJUST_RESIZE 

 画面をキーボード上に位置するように上げます。

  • InputAdjustType.SOFT_INPUT_ADJUST_PAN 

 上とは反対に、画面が固定された状態でキーボードを出します。

   4. KeepKeyboardOn

  • AdditionalOptions.keepKeyboardOn = true;
  • Keyboard is not hidden when the “Done” button is clicked

 

 

[高級オプション設定]

  1. 色んな Flag Maskなどを追加できます。(InputType.cs 参考)

 

 


[NGUIと連動] 

  1. Assets/Plugins/Android/AndroidKeyboard/NGUI Ver/UIInput.zip ファイルを圧縮を解凍させ、既存の物に被せます。
  • 2015年現在 NGUI 3.8.0, 3.9.0 バージョン用ファイルがあります。
  • キーボードを出す前に、オプション設定を完了されてください。(hideInput, softInputMode, Nosuggestion, fullScreen など)
  • hideInputの場合、下記のコードに注意してください。 

  1. InputTest_NGUI.apk を設置して NGUI 連動テストが出来ます。

 

[Example Scenes]

* Test_Landscape, Test_Portrait シーンは UnityEngine.UIを利用してキーボード機能をテストする目的で作りました。

* テスト用度で制作されたので、hideInputの場合にカーソルがなく、Selectionができません

 


Posted in Tutorials

Android Keyboard Tutorial [한국어]

[플러그인 제작 목적]

유니티가 제공하는 안드로이드 키보드는 네이티브 코드가 제공하는 그것에 비해 매우 제한적입니다. 조합형 문자의 경우 Input.compositionString이 정상적인 기능을 하지 않고 있으며, hideInput 플래그 또한 정상 작동 하고 있지 않습니다.  이 플러그인은 이런 제약을 벗어 날 수 있게끔 하며, 거기에 더해서 adjustResize  옵션을 활용 할 수 있도록 해줍니다.

  

[요구 사양]

 Unity 4.6.3 이상

NGUI 3.5.0 이상

Android Mininim API Level : 9 (Android 2.3.1 ‘Gingerbread’)

 

 [AndroidMenifest.xml 생성 혹은 수정]

  1. 기존 AndroidMenifest.xml이 있다면 아래 코드를 추가합니다.

<activity

           android:name=com.OhYeahDev.softInput.KeyboardActivity

           android:configChanges=orientation|fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen

           >

</activity>

  1. 기존 Main Activity가 없다면 위 코드에 아래 코드를 삽입합니다.

 <intent-filter>

          <action android:name=android.intent.action.MAIN />

          <category android:name=android.intent.category.LAUNCHER />

        </intent-filter>

      </activity>

 

  1. 기존 AndroidMenifest.xml이 없으면 Sample_AndroidManifest.xml를 Assets/Plugins/Android 폴더에 복사한 후, 이름에 ‘SamePle_’을 삭제하여 주십시오.

 

 

[액티비티 활성화] 

AndroidKeyboardManager.Install() 메서드를 어플리케이션 구동 시 반드시 호출 해주어야 합니다.

 

 

[키보드 띄우기 및 설정법] 

  1. 스크립트에 네임스페이스를 정의합니다.

  1. 유니티가 제공하는 TouchScreenKeyboard 방식으로 사용하면 됩니다.


 

[추가 옵션 설정]

  1. fullScreen
  • Landscape화면에서 유효한 옵션
  • 키보드를 전체 화면 모드로 나오게 합니다.

Non-FullScreen

 

  1. NoSuggestion
  • 키보드 위의 ‘Suggestion Words’ Bar를 제거합니다.
    • 일부 하드웨어 기종에서 해당 옵션이 적용되지 않습니다.
    • Landscape 화면에서만 가능

 


  1. SoftInputMode
  • InputAdjustType. SOFT_INPUT_ADJUST_RESIZE 

 화면을 키보드 위에 위치하도록 올립니다.

  • InputAdjustType.SOFT_INPUT_ADJUST_PAN 

 위와는 반대로 화면이 고정된 상태로 키보드를 띄웁니다.

  4. KeepKeyboardOn

  • AdditionalOptions.keepKeyboardOn = true;
  • ‘완료’ 혹은 ‘확인’ 버튼을 눌러도 키보드를 비활성화 시키지 않습니다.

 

 

[고급 옵션 설정]

  1. 여러가지 Flag와 Mask들을 추가할 수 있습니다. (InputType.cs 참고)

 

 

 

[NGUI와 연동] 

  1. Assets/Plugins/Android/AndroidKeyboard/NGUI/UIInput.zip 파일을 압축을 풀어 기존의 것에 덮어 씌웁니다.
  • 2015년 현재 NGUI 3.8.0, 3.9.0 버전용 파일이 있습니다.
  • 키보드를 띄우기 전에 옵션 설정을 완료해야 합니다. (hideInput, softInputMode, Nosuggestion, fullScreen 등)
  • hideInput의 경우 아래 코드를 유의해 주십시오. 

  1. InputTest_NGUI.apk 를 설치하여 NGUI 연동 테스트를 해 볼 수 있습니다.

 

[Example Scenes]

* Test_Landscape, Test_Portrait 씬은 UnityEngine.UI를 이용하여 키보드 기능을 테스트 해보는 목적으로 만들었습니다.

* 테스트 용도로 제작 하였으므로, hideInput의 경우, 커서와 문자 드래그 선택 기능이 없습니다.

 

 

Posted in Tutorials

Android Keyboard Tutorial [English]

[Objectives of Producing the plugin]

TouchScreenKeyboard provided by Unity is more limited than Android Native SoftKeyboard. When composing characters, ‘Input.compositionString’ does not work well, , as does ‘TouchScreenKeyboard.hideInput’.

I have written this plugin so we can be free from those constraints. In addition, option “adjustResize” is included.

 

[Requirements]

 Unity 4.6.3 or higher

NGUI 3.5.0 or higher

Android Minimum API Level: 9 (Android 2.3.1 Gingerbread)

 

[Create or modify AndroidMenifest.xml ]

  1. If you have AndroidMenifest.xml, add the code below

<activity

           android:name=com.OhYeahDev.softInput.KeyboardActivity

           android:configChanges=orientation|fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen

           >

</activity>

 

  1. If you don’t have “Main Activity”, insert the code below inside the code upper.

 <intent-filter>

          <action android:name=android.intent.action.MAIN />

          <category android:name=android.intent.category.LAUNCHER />

        </intent-filter>

      </activity>

  

  1. If you don’t have AndroidMenifest.xml, copy Sample_AndroidManifest.xml to “Assets/Plugins/Android” and remove “Sample_” on the file name.

 

 

[Activate the activity]

Right after your application has run, you must call

AndroidKeyboardManager.Install()” method.  

 

 

[Open the keyboard and setting options]

  1. Use the namespaces on the script

  1. Use the way of TouchScreenKeyboard that Unity provides

 

[Additional options]

  1. fullScreen
  • Only works in landscape mode
  • Show keyboard in full-screen mode

half screen

 

  1. No Suggestions
  • Removes “Suggestion Words” Bar up on the keyboard

* This option doesn’t work on certain hardware.

* Only works in landscape mode

 


  1. SoftInputMode
  • InputAdjustType.SOFT_INPUT_ADJUST_RESIZE 

 Raises the screen up on the keyboard

  • InputAdjustType.SOFT_INPUT_ADJUST_PAN 

 Contrary to the above, this raises the keyboard with the screen fixed

 

  4. KeepKeyboardOn

  • AdditionalOptions.keepKeyboardOn = true;
  • Keyboard is not hidden when the “Done” button is clicked

 

 

[Advanced options]

  1. Add flags and masks (Please refer to InputType.cs)

 

 

[Compatibility for NGUI]         

  1. Unzip “Assets/Plugins/Android/AndroidKeyboard/NGUI Ver/UIInput.zip” and overwrite it on the existing one
  • We have the files for NGUI 3.8.0, 3.9.0 (now in summer 2015)
  • All options must be completed before opening the keyboard (hideInput, softInputMode, Nosuggestion and fullScreen)
  • In case of hideInput, please take notice of the code below.

 

  1. Try testing compatibility for NGUI by installing InputTest_NGUI.apk

 

[Example Scenes]

Test_Landscape, Test_Portrait scenes have been created to try testing the functions of the keyboard

  • hideInput has no cursor and “Selection” is not possible because we created this for test.

     

     


 

Posted in Tutorials