使用Unity直接向安卓拨号,调用安卓的方法
1,显示一条安卓的消息
//展示一个安卓的消息
public static void ShowAndroidMessage(string message)
{
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaClass toast = new AndroidJavaClass("android.widget.Toast");
AndroidJavaObject context = currentActivity.Call<AndroidJavaObject>("getApplicationContext");
currentActivity.Call("runOnUiThread", new AndroidJavaRunnable(() =>
{
toast.CallStatic<AndroidJavaObject>("makeText", context, message, toast.GetStatic<int>("LENGTH_LONG")).Call("show");
}));
}
2,获取手机上Apk列表
//获