AndroidNativeCore.AndroidCore
Description
This class gives you features of native android intents call and dial number,message,mail,share text and image,open applications and view by thier package id.
Summary:
Public methods | |
---|---|
void |
makeCall(string number)
Call directly to given number in |
void |
Dail(string number)
Dail number in device call app take number
as |
void |
ComposeMessage(string number,
string message)
This method open device default message app add number and message by given string format. |
void |
ComposeMail(string emailAddress,
string subject, string body)
This method open device default email app add recipetnt email,subject and body by given string format. |
void |
Share(string extraSubject,
string extraText)
This method share text with subject and message in given by string format into other apps. |
void |
Share(string extraText,
Texture2D extraStream)
This method share text in as string and image as Texture2D format into other apps. |
bool |
isApplicationInstalled(string package)
This method return true if application given by package(string) is installed on device else return false. |
void |
openApplication(string package)
This method open application in device by by package(string) name. |
void |
openApplicationView(string data)
This method open installed application view by given data(string) in device. |
Example
using AndroidNativeCore;
using UnityEngine;
class example{
AndroidCore androidCore;
void Start(){
androidCore = new AndroidCore();
}
public void youtubeVedio(){
string vedioId = "kyD0q57zw40";
androidCore.openApplicationView("vnd.youtube:"+vedioId);
}
public void openWhatsApp()
{
//this code check whatsapp installation if it is installed opens it on device
if(androidCore.isApplicationInstalled("com.whatsapp"))
androidCore.openApplication("com.whatsapp");
else
Debug.Log("Whatsapp not installed");
}
}