Native Android in Unity

This post was originally posted at https://agrawalsuneet.github.io/blogs/native-android-in-unity/ and reposted on Medium on 22th Jun 2018.
//Java Code
Context context = getApplicationContext();
CharSequence text = "This is a toast";
int duration = Toast.LENGTH_SHORT;

Toast toast = Toast.makeText(context, text, duration);
toast.show();
//Kotlin Code
val text = "This is a toast"
val duration = Toast.LENGTH_SHORT

val toast = Toast.makeText(applicationContext, text, duration)
toast.show()

Please continue reading at https://agrawalsuneet.github.io/blogs/native-android-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