Native Android in Unity

This post was originally posted at 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);;
//Kotlin Code
val text = "This is a toast"
val duration = Toast.LENGTH_SHORT

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

Please continue reading at




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why I used Ansible to trigger Terraform

Week 3 : Creating spaces for testing REST API

NullTrace CTF-2021

Offline Content Migration in AEM — using oak-upgrade

AEM OAK Repository Version Information as shown in CRXDE|Lite

Implicit none and carry on

Data Flow with Apache Nifi in Google Cloud Platform

MSTICpy 0.7.0/1 Release

Write a program to write a menu driven program where the program  will ask for options from the…

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
Suneet Agrawal

Suneet Agrawal

More from Medium

Implementing Android 6.0 permissions in Unity3D

Kotlin Coroutines [Part-3]

Extension Functions in Kotlin

How To Inspect Elements On Android Devices?