I’m trying to get better input on Android - using Unity 2021.3.2f1 if it matters.
I installed from the git url using package manager. I believe it’s installed properly and when I play I see plugins init in the console when it starts. I attached the MobileInputField script to my input fields - legacy ones not TMPro ones. When I do editing in the fields and stop I see MobileInput execute {“msg”:“REMOVE_EDIT”,“id”:2}
for any Inputs with the script attached.
So I think everything is installed right but it’s really no better, when on my phone, than it was before. I can’t long press to copy/paste and in a dialog with multiple input fields the keyboard closes/reopens whenever I leave one field and focus the next one. I tried the Manual Hide Control setting in the script but I don’t notice that it does anything. I’m not even sure what it’s for.
Anyone else using this to good effect? How can I tell if everything is working properly?
https://github.com/mopsicus/UnityMobileInput
Is nobody using the plugin? Is there a better way to do input fields on mobile? Anyway, I’ve made a little progress - I found out the AndroidManifest.xml file I was editing was the wrong one. So now making the changes as per the instructions and the app crashes on launch on the phone. If anyone has an idea here are the AndroidManifest files I am using / trying to use:
This is the Unity generated one I modified to change activity to Native and added Forward to Dalvik:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
xmlns:tools="http://schemas.android.com/tools">
<application>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:windowSoftInputMode="adjustNothing">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
</application>
</manifest>
This is the one Unity generates that works - but no input plugin
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
xmlns:tools="http://schemas.android.com/tools">
<application>
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
</application>
</manifest>
This is the Manifest file located in the package plugin folder for Android.
<?xml version="1.0" encoding="utf-8"?>
<manifest package="ru.mopsicus.UnityMobileInput" xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" android:hardwareAccelerated="true" android:versionCode="1" android:versionName="1.0.0">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:launchMode="singleTask" android:process=":unityplayer" android:windowSoftInputMode="adjustNothing">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true"/>
</activity>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>