Native Android Receive Text from Other Apps in Unity

This post was originally posted at https://agrawalsuneet.github.io/blogs/native-android-receive-text-from-other-apps-in-unity/ and reposted on Medium on 03rd Dec 2021.
  1. Register Intent Filter in Manifest file.
  2. Extract text from the Intent object shared by the other app.

Register Intent Filter in Manifest file

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.agrawalsuneet.unitysharingclient" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal">  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />  <application android:theme="@style/UnityThemeSelector" android:icon="@mipmap/app_icon" android:label="@string/app_name" android:isGame="true" android:banner="@drawable/app_banner">    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">      <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" />    </activity>    <meta-data android:name="unity.build-id" android:value="d23ed252-3184-42bb-8dac-d4a3f9f6b02a" />    <meta-data android:name="unity.splash-mode" android:value="0" />    <meta-data android:name="unity.splash-enable" android:value="True" />  </application>  <uses-feature android:glEsVersion="0x00020000" />  <uses-permission android:name="android.permission.INTERNET" />  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" /></manifest>

Please continue reading at https://agrawalsuneet.github.io/blogs/native-android-receive-text-from-other-apps-in-unity/

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store