CSharp

Below you will find pages that utilize the term “CSharp”
June 26, 2021
Native Android Receive Text from Other Apps in Unity

In continuation to my previous blog Native Android text sharing in Unity, where we learnt about sharing text from a Unity app targeting the Android platform, let’s try to learn about how can we receive a text from other apps. Accepting a text from other apps is not that common but sometimes location-based games required to accept text or location shared from other apps. There can be a generic use case also where we want to accept some text from other apps for any purpose.

May 28, 2021
Typecast Android Object in Untiy

In continuation to previous my previous blogs, where we learnt about how can we use AndroidJavaClass and AndroidJavaObject to achieve simple native Android functionality in Unity, We will move one step ahead and see how can we typecast one Android object to another in Unity.

May 28, 2021
Typecast Android Object in Untiy

This particular script will help you to typecast one Android/Java object into another in Unity.

For further explaination on how this works, please read the article Native Android in Unity.

December 3, 2020
Native Android text sharing to Whatsapp contact in Unity

In the previous blogs, we learnt about how can we trigger native Android text, image or any other format file sharing in Unity App. A lot of you have asked me about how can we share some text directly to a WhatsApp contact.

November 26, 2020
Native Android text sharing to Whatsapp contact in Unity

This particular script will help you to implement a text message sharing directly to a WhatsApp contact in Unity.

For further explaination on how this works, please read the article Native Android text sharing to Whatsapp contact in Unity.

November 23, 2020
Android : Share message directly to whatsapp contact

This particular script will help you to implement a text message sharing directly to a WhatsApp contact in Android.

For further explaination on how this works, please read the article Android : Share message directly to whatsapp contact.

October 15, 2020
Native Android image sharing in Unity using FileProvider

This particular script will help you to implement native Android image sharing using Android’s FileProvider in Unity. This is a fix for “android.os.FileUriExposedException” in Android 8 (Oreo) and above.

October 12, 2020
Native Android text sharing to particular app in Unity

This particular script will help you to implement native Android text sharing to a particular app in Unity.

We use all the native classes of Android in Unity using AndroidJavaClass and AndroidJavaObject and perform the Android’s ACTION_SEND with EXTRA_SUBJECT and EXTRA_TEXT, and share the content to a particular app with package name.

October 11, 2020
Native Android image sharing in Unity

This particular script will help you to implement native Android image sharing in Unity.

We use all the native classes of Android in Unity using AndroidJavaClass and AndroidJavaObject and perform the Android’s ACTION_SEND with EXTRA_SUBJECT, EXTRA_TEXT and EXTRA_STREAM. The content type is set to image/png in the below example but you can change it to any type and share other formats also.

October 10, 2020
Native Android text sharing in Unity

This particular script will help you to implement native Android text sharing in Unity.

We use all the native classes of Android in Unity using AndroidJavaClass and AndroidJavaObject and perform the Android’s ACTION_SEND with EXTRA_SUBJECT and EXTRA_TEXT.

October 9, 2020
Native Android in Unity

This particular script will help you to implement basic native Android in Unity.

This show an example of showing a native Android’s Toast in unity using AndroidJavaClass and AndroidJavaObject.

August 14, 2020
Native Android text sharing to particular app in Unity

In the previous blogs Native Android text sharing in Unity and Native Android image sharing in Unity we learnt about how to share some text or screenshot to other apps in a Unity app targeting Android platforms. In this post will target sharing the same text or image to some particular app directly.

March 29, 2020
Partial class in C# (partial modifier)

Think about a situation where two or more developers need to modify the same class or add new functionalities to the same class. Or assume they need to implement interfaces to the same class. There will be a merge conflict which needs to be resolved manually or using some tool.

May 28, 2019
Native Android image sharing in Unity using FileProvider

While implementing native sharing using my previous post, Native Android image sharing in Unity we saw an exception android.os.FileUriExposedException in Android 8 (Oreo) and above.

August 10, 2018
Native Android image sharing in Unity

In continuation to my previous blogs Native Android in Unity and Native Android text sharing in Unity, will consider another example of native Android screenshot sharing functionality in the unity app.

June 29, 2018
Native Android text sharing in Unity

In continuation to my previous blogs Native Android in Unity, will consider another example of native Android text sharing functionality in the unity app. This is a very common requirement in any unity app targeting Android platform to share the high score or challenge other players with a text message or a screenshot of the high score. The sharing can be done via any of the app available on the user’s device which supports sharing.

June 22, 2018
Native Android in Unity

While developing unity games in C# targeting android platform, we always want to use few native android features in our game. These features can be showing notifications on certain actions in the game or can be sharing the high score with other players and inviting them to try our game using android native share. Android gives us all the possibilities to achieve these native android functionalities in unity app using C#.