C# Class AndroidHelper, project-tango-poc

Helper functions for common android functionality.
Afficher le fichier Open project: stetro/project-tango-poc Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

AndroidFinish() public static méthode

Calls finish on the Unity Activity.
public static AndroidFinish ( ) : void
Résultat void

AndroidQuit() public static méthode

Calls quit on the Unity Activity.
public static AndroidQuit ( ) : void
Résultat void

ApplicationHasTangoPermissions() public static méthode

Check if the application has a Tango permission.
public static ApplicationHasTangoPermissions ( string permissionType ) : bool
permissionType string String for the permission.
Résultat bool

GetCurrentApplicationLabel() public static méthode

Gets the current application label.
public static GetCurrentApplicationLabel ( ) : string
Résultat string

GetCurrentPackageName() public static méthode

Gets the name of the current package.
public static GetCurrentPackageName ( ) : string
Résultat string

GetPackageInfo() public static méthode

Gets the package info.
public static GetPackageInfo ( string packageName ) : AndroidJavaObject
packageName string Package name.
Résultat UnityEngine.AndroidJavaObject

GetScreenOrientation() public static méthode

Get native android orientation index.
public static GetScreenOrientation ( ) : int
Résultat int

GetTangoDeviceOrientation() public static méthode

Get the devices current and default orientations.
public static GetTangoDeviceOrientation ( ) : TangoDeviceOrientation
Résultat TangoDeviceOrientation

GetTangoHelperObject() public static méthode

Gets the Java tango helper object.
public static GetTangoHelperObject ( ) : AndroidJavaObject
Résultat AndroidJavaObject

GetUnityActivity() public static méthode

Gets the unity activity.
public static GetUnityActivity ( ) : AndroidJavaObject
Résultat AndroidJavaObject

GetVersionCode() public static méthode

Gets the version code.
public static GetVersionCode ( string packageName ) : int
packageName string Package name.
Résultat int

GetVersionName() public static méthode

Gets the name of the version.
public static GetVersionName ( string packageName ) : string
packageName string Package name.
Résultat string

IsTangoCorePresent() public static méthode

Check if the Tango Core package is installed.
public static IsTangoCorePresent ( ) : bool
Résultat bool

IsTangoCoreUpToDate() public static méthode

Check if the Tango Core package is up to date.
public static IsTangoCoreUpToDate ( ) : bool
Résultat bool

PerformanceLog() public static méthode

Used for performance logging from the Android side.
public static PerformanceLog ( string message ) : void
message string Message string to log.
Résultat void

RegisterOnActivityResultEvent() public static méthode

Registers for the Android on activity result event.
public static RegisterOnActivityResultEvent ( OnActivityResultEventHandler onActivityResult ) : void
onActivityResult OnActivityResultEventHandler On activity result.
Résultat void

RegisterOnScreenOrientationChangedEvent() public static méthode

Registers for on orientaiton change event.
public static RegisterOnScreenOrientationChangedEvent ( OnScreenOrientationChangedEventHandler onChanged ) : void
onChanged OnScreenOrientationChangedEventHandler Delegate to call when the screen orientation changes.
Résultat void

RegisterPauseEvent() public static méthode

Registers for the Android pause event.
public static RegisterPauseEvent ( OnPauseEventHandler onPause ) : void
onPause OnPauseEventHandler On pause.
Résultat void

RegisterResumeEvent() public static méthode

Registers for the Android resume event.
public static RegisterResumeEvent ( OnResumeEventHandler onResume ) : void
onResume OnResumeEventHandler On resume.
Résultat void

ShowAndroidToastMessage() public static méthode

Shows the android toast message.
public static ShowAndroidToastMessage ( string message ) : void
message string Message string to show in the toast.
Résultat void

ShowAndroidToastMessage() public static méthode

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.
Résultat void

ShowAndroidToastMessage() public static méthode

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.
Résultat void

StartActivity() public static méthode

Starts the activity for the provided class name.
public static StartActivity ( string className ) : void
className string Class name.
Résultat void

StartTangoPermissionsActivity() public static méthode

Start the Tango permissions activity, requesting that permission.
public static StartTangoPermissionsActivity ( string permissionsType ) : void
permissionsType string String for the permission to request.
Résultat void