C# Класс AndroidHelper, project-tango-poc

Helper functions for common android functionality.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AndroidFinish ( ) : void

Calls finish on the Unity Activity.

AndroidQuit ( ) : void

Calls quit on the Unity Activity.

ApplicationHasTangoPermissions ( string permissionType ) : bool

Check if the application has a Tango permission.

GetCurrentApplicationLabel ( ) : string

Gets the current application label.

GetCurrentPackageName ( ) : string

Gets the name of the current package.

GetPackageInfo ( string packageName ) : AndroidJavaObject

Gets the package info.

GetScreenOrientation ( ) : int

Get native android orientation index.

GetTangoDeviceOrientation ( ) : TangoDeviceOrientation

Get the devices current and default orientations.

GetTangoHelperObject ( ) : AndroidJavaObject

Gets the Java tango helper object.

GetUnityActivity ( ) : AndroidJavaObject

Gets the unity activity.

GetVersionCode ( string packageName ) : int

Gets the version code.

GetVersionName ( string packageName ) : string

Gets the name of the version.

IsTangoCorePresent ( ) : bool

Check if the Tango Core package is installed.

IsTangoCoreUpToDate ( ) : bool

Check if the Tango Core package is up to date.

PerformanceLog ( string message ) : void

Used for performance logging from the Android side.

RegisterOnActivityResultEvent ( OnActivityResultEventHandler onActivityResult ) : void

Registers for the Android on activity result event.

RegisterOnScreenOrientationChangedEvent ( OnScreenOrientationChangedEventHandler onChanged ) : void

Registers for on orientaiton change event.

RegisterPauseEvent ( OnPauseEventHandler onPause ) : void

Registers for the Android pause event.

RegisterResumeEvent ( OnResumeEventHandler onResume ) : void

Registers for the Android resume event.

ShowAndroidToastMessage ( string message ) : void

Shows the android toast message.

ShowAndroidToastMessage ( string message, ToastLength length ) : void

Shows the android toast message.

ShowAndroidToastMessage ( string message, bool callFinish ) : void

Shows the android toast message.

StartActivity ( string className ) : void

Starts the activity for the provided class name.

StartTangoPermissionsActivity ( string permissionsType ) : void

Start the Tango permissions activity, requesting that permission.

Приватные методы

Метод Описание
ConnectCloud ( ) : bool

Connects to the TangoCloudService.

DisconnectCloud ( ) : bool

Disconnects from the TangoCloudService.

StartExportADFActivity ( string srcAdfUuid, string exportLocation ) : void

Call export ADF permission activity.

StartImportADFActivity ( string adfPath ) : void

Call import ADF permission activity.

_RegisterCallbacks ( ) : void

Inializes the AndroidJavaProxy for the Android lifecycle callbacks.

_ShowAndroidToastMessage ( string message, ToastLength length ) : void

Shows the android toast message.

Описание методов

AndroidFinish() публичный статический Метод

Calls finish on the Unity Activity.
public static AndroidFinish ( ) : void
Результат void

AndroidQuit() публичный статический Метод

Calls quit on the Unity Activity.
public static AndroidQuit ( ) : void
Результат void

ApplicationHasTangoPermissions() публичный статический Метод

Check if the application has a Tango permission.
public static ApplicationHasTangoPermissions ( string permissionType ) : bool
permissionType string String for the permission.
Результат bool

GetCurrentApplicationLabel() публичный статический Метод

Gets the current application label.
public static GetCurrentApplicationLabel ( ) : string
Результат string

GetCurrentPackageName() публичный статический Метод

Gets the name of the current package.
public static GetCurrentPackageName ( ) : string
Результат string

GetPackageInfo() публичный статический Метод

Gets the package info.
public static GetPackageInfo ( string packageName ) : AndroidJavaObject
packageName string Package name.
Результат UnityEngine.AndroidJavaObject

GetScreenOrientation() публичный статический Метод

Get native android orientation index.
public static GetScreenOrientation ( ) : int
Результат int

GetTangoDeviceOrientation() публичный статический Метод

Get the devices current and default orientations.
public static GetTangoDeviceOrientation ( ) : TangoDeviceOrientation
Результат TangoDeviceOrientation

GetTangoHelperObject() публичный статический Метод

Gets the Java tango helper object.
public static GetTangoHelperObject ( ) : AndroidJavaObject
Результат AndroidJavaObject

GetUnityActivity() публичный статический Метод

Gets the unity activity.
public static GetUnityActivity ( ) : AndroidJavaObject
Результат AndroidJavaObject

GetVersionCode() публичный статический Метод

Gets the version code.
public static GetVersionCode ( string packageName ) : int
packageName string Package name.
Результат int

GetVersionName() публичный статический Метод

Gets the name of the version.
public static GetVersionName ( string packageName ) : string
packageName string Package name.
Результат string

IsTangoCorePresent() публичный статический Метод

Check if the Tango Core package is installed.
public static IsTangoCorePresent ( ) : bool
Результат bool

IsTangoCoreUpToDate() публичный статический Метод

Check if the Tango Core package is up to date.
public static IsTangoCoreUpToDate ( ) : bool
Результат bool

PerformanceLog() публичный статический Метод

Used for performance logging from the Android side.
public static PerformanceLog ( string message ) : void
message string Message string to log.
Результат void

RegisterOnActivityResultEvent() публичный статический Метод

Registers for the Android on activity result event.
public static RegisterOnActivityResultEvent ( OnActivityResultEventHandler onActivityResult ) : void
onActivityResult OnActivityResultEventHandler On activity result.
Результат void

RegisterOnScreenOrientationChangedEvent() публичный статический Метод

Registers for on orientaiton change event.
public static RegisterOnScreenOrientationChangedEvent ( OnScreenOrientationChangedEventHandler onChanged ) : void
onChanged OnScreenOrientationChangedEventHandler Delegate to call when the screen orientation changes.
Результат void

RegisterPauseEvent() публичный статический Метод

Registers for the Android pause event.
public static RegisterPauseEvent ( OnPauseEventHandler onPause ) : void
onPause OnPauseEventHandler On pause.
Результат void

RegisterResumeEvent() публичный статический Метод

Registers for the Android resume event.
public static RegisterResumeEvent ( OnResumeEventHandler onResume ) : void
onResume OnResumeEventHandler On resume.
Результат void

ShowAndroidToastMessage() публичный статический Метод

Shows the android toast message.
public static ShowAndroidToastMessage ( string message ) : void
message string Message string to show in the toast.
Результат void

ShowAndroidToastMessage() публичный статический Метод

Shows the android toast message.
public static ShowAndroidToastMessage ( string message, ToastLength length ) : void
message string Message string to show in the toast.
length ToastLength Toast message time length.
Результат void

ShowAndroidToastMessage() публичный статический Метод

Shows the android toast message.
public static ShowAndroidToastMessage ( string message, bool callFinish ) : void
message string Message string to show in the toast.
callFinish bool If set to true call finish on the unity activity.
Результат void

StartActivity() публичный статический Метод

Starts the activity for the provided class name.
public static StartActivity ( string className ) : void
className string Class name.
Результат void

StartTangoPermissionsActivity() публичный статический Метод

Start the Tango permissions activity, requesting that permission.
public static StartTangoPermissionsActivity ( string permissionsType ) : void
permissionsType string String for the permission to request.
Результат void