Skip to content

Instantly share code, notes, and snippets.

View amiroveisi's full-sized avatar

Amir amiroveisi

  • Freelancer
View GitHub Profile
@Guendeli
Guendeli / ToastMessage.cs
Created September 28, 2016 10:08
a script to show Toast Messages on Android Unity3D Apps
using UnityEngine;
public class ToastMessage : MonoBehaviour
{
string toastString;
string input;
AndroidJavaObject currentActivity;
AndroidJavaClass UnityPlayer;
AndroidJavaObject context;
@ftvs
ftvs / PhonecallReceiver.java
Last active October 11, 2023 10:05
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Gabe Sechan http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@mabster
mabster / AutoTemplateSelector.cs
Created January 13, 2012 02:11
WPF Dynamic DataTemplates
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
namespace WpfApplication8