Exemplo n.º 1
0
        public override void onReceive(Context arg0, Intent arg1)
        {
            TestTip.Inst.ShowText("GeoFenceBroadcast success");
            GeofenceData geofenceData = GeofenceData.getDataFromIntent(arg1);
            string       s            = "receive\n";

            if (geofenceData != null)
            {
                int      errorCode  = geofenceData.getErrorCode();
                int      conversion = geofenceData.getConversion();
                List     list       = geofenceData.getConvertingGeofenceList();
                Location mLocation  = geofenceData.getConvertingLocation();
                bool     status     = geofenceData.isSuccess();
                s += "errorcode: " + errorCode.ToString() + "\n";
                s += "conversion: " + conversion.ToString() + "\n";
                for (int i = 0; i < list.toArray().Length; i++)
                {
                    Geofence g = HmsUtil.GetHmsBase <Geofence>(list.toArray()[i]);
                    s += ("geoFence id :" + g.getUniqueId() + "\n");
                }
                s += ("location is :" + mLocation.getLongitude() + " " + mLocation.getLatitude() + "\n");
                s += ("is successful :" + status);
            }
            TestTip.Inst.ShowText(s);
        }
Exemplo n.º 2
0
        private void listResultTest()
        {
            initAGCStorageManagement();
            StorageReference reference = mAGCStorageManagement.getStorageReference();

            Task       listTask   = reference.listAll();
            ListResult listResult = HmsUtil.GetHmsBase <ListResult>(Tasks.await(listTask));

            List fileList = listResult.getFileList();

            if (fileList == null)
            {
                Debug.Log("listResultTest fail: fileList is null");
                return;
            }

            List dirList = listResult.getDirList();

            if (dirList == null)
            {
                Debug.Log("listResultTest fail: dirList is null");
                return;
            }

            string pageMaker = listResult.getPageMarker();

            Debug.Log("listResultTest success. pageMaker: " + pageMaker);
        }
Exemplo n.º 3
0
        public string transferProviderInfo(List info)
        {
            if (info == null)
            {
                return("");
            }
            var Builder = new StringBuilder();

            AndroidJavaObject[] mapList = info.toArray();
            for (int i = 0; i < mapList.Length; i++)
            {
                Map          map = HmsUtil.GetHmsBase <Map>(mapList[i]);
                Set <string> kset;
                string[]     keyArray;
                if (map != null)
                {
                    kset = map.keySet();
                    if (kset != null)
                    {
                        keyArray = kset.toArray();
                        for (int j = 0; j < keyArray.Length; j++)
                        {
                            Builder.Append(keyArray[j] + "  ");
                            Builder.Append(map.getOrDefault(keyArray[j], "") + "  ");
                        }
                    }
                }
            }

            return(Builder.ToString());
        }
        void request()
        {
            AndroidJavaClass  javaUnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject currentActivity = javaUnityPlayer.GetStatic <AndroidJavaObject>("currentActivity");
            Activity          aaa             = HmsUtil.GetHmsBase <Activity>(currentActivity);

            ActivityCompat.requestPermissions(aaa, permissions, 1);
        }
Exemplo n.º 5
0
        public override void onProgress(AndroidJavaObject arg0)
        {
            UploadTask.UploadResult uploadResult = HmsUtil.GetHmsBase <UploadTask.UploadResult>(arg0);
            FileMetadata            metadata     = uploadResult.getMetadata();

            if (metadata == null)
            {
                Debug.LogFormat("MyProgressListener:onProgress, get metadata failed!");
            }

            Debug.LogFormat(m_name + " progress : {0}",
                            (uploadResult.getBytesTransferred() * 1.0) / uploadResult.getTotalByteCount());
        }
Exemplo n.º 6
0
        public override void onReceive(Context arg0, Intent arg1)
        {
            TestTip.Inst.ShowText("LocationBroadcast onReceive");
            string s = "data";

            ActivityConversionResponse activityTransitionResult = ActivityConversionResponse.getDataFromIntent(arg1);

            if (activityTransitionResult != null && isListenActivityConversion == true)
            {
                List list = activityTransitionResult.getActivityConversionDatas();
                AndroidJavaObject[] obj = list.toArray();
                for (int i = 0; i < obj.Length; i++)
                {
                    ActivityConversionData d = HmsUtil.GetHmsBase <ActivityConversionData>(obj[i]);
                    s += $"activityTransitionEvent[{i}]:" +
                         $"active type: {d.getActivityType()} " +
                         $"active ConversionType: {d.getConversionType()} ";
                }
            }

            if (LocationResult.hasResult(arg1))
            {
                s += "\n";
                LocationResult      locationResult = LocationResult.extractResult(arg1);
                List                ls             = locationResult.getLocations();
                AndroidJavaObject[] obj            = ls.toArray();
                for (int i = 0; i < obj.Length; i++)
                {
                    Location loc = HmsUtil.GetHmsBase <Location>(obj[i]);
                    s += "onLocationResult location[Longitude,Latitude,Accuracy]:" + loc.getLongitude()
                         + "," + loc.getLatitude() + "," + loc.getAccuracy() + "\n";
                }
            }
            ActivityIdentificationResponse activityRecognitionResult = ActivityIdentificationResponse.getDataFromIntent(arg1);

            if (activityEnabled && activityRecognitionResult.obj != null)
            {
                s += "\n";
                List list = activityRecognitionResult.getActivityIdentificationDatas();
                AndroidJavaObject[] obj = list.toArray();
                s += obj.Length.ToString() + "\n";
                for (int i = 0; i < obj.Length; i++)
                {
                    ActivityIdentificationData d = HmsUtil.GetHmsBase <ActivityIdentificationData>(obj[i]);
                    int type  = d.getIdentificationActivity();
                    int value = d.getPossibility();
                    s += "ActivityIdentificationResponse [type,value]:" + type + "," + value + "\n";
                }
            }
            TestTip.Inst.ShowText(s);
        }
Exemplo n.º 7
0
        public string transferProviderInfo(List info)
        {
            var Builder = new StringBuilder();

            AndroidJavaObject[] mapList = info.toArray();
            for (int i = 0; i < mapList.Length; i++)
            {
                Map      temp     = HmsUtil.GetHmsBase <Map>(mapList[i]);
                string[] keyArray = temp.keySet().toArray();
                for (int j = 0; j < keyArray.Length; j++)
                {
                    Builder.Append(keyArray[i] + "  ");
                    Builder.Append(temp.getOrDefault(keyArray[i], "") + "  ");
                }
            }

            return(Builder.ToString());
        }
Exemplo n.º 8
0
        public override void onLocationResult(LocationResult locationResult)
        {
            TestTip.Inst.ShowText("LocationCallback onLocationResult");
            List ls = locationResult.getLocations();

            AndroidJavaObject[] obj = ls.toArray();
            string s = "";

            for (int i = 0; i < obj.Length; i++)
            {
                Location loc = HmsUtil.GetHmsBase <Location>(obj[i]);
                s += "onLocationResult location[Longitude,Latitude,Accuracy]:" + loc.getLongitude()
                     + "," + loc.getLatitude() + "," + loc.getAccuracy();
                longitude = loc.getLongitude();
                latitude  = loc.getLatitude();
            }
            TestTip.Inst.ShowText(s);
        }
        public void timePointStateBaseTest()
        {
            byte[] data     = new byte[100];
            string filename = "timePointStateBaseTest.data";

            StorageReference storageReference = mAGCStorageManagement.getStorageReference(filename);
            UploadTask       task             = storageReference.putBytes(data, new FileMetadata());

            StorageTask.ErrorResult        err       = task.getTimePointState();
            StorageTask.TimePointStateBase timePoint = HmsUtil.GetHmsBase <StorageTask.TimePointStateBase>(err.obj);
            Exception e = timePoint.getError();

            if (e == null)
            {
                Debug.Log("timePointStateBaseTest fail, error result is null");
                return;
            }

            StorageReference timeRef = timePoint.getStorage();

            if (timeRef == null)
            {
                Debug.Log("timePointStateBaseTest fail, timeRef is null");
                return;
            }

            StorageTask storageTask = timePoint.getTask();

            if (storageTask == null)
            {
                Debug.Log("timePointStateBaseTest fail, storageTask is null");
                return;
            }

            Debug.Log("timePointStateBaseTest success");
        }
 public void readStream(AndroidJavaObject arg0, AndroidJavaObject arg1)
 {
     readStream(HmsUtil.GetHmsBase <StreamDownloadResult>(arg0), HmsUtil.GetHmsBase <InputStream>(arg1));
 }
Exemplo n.º 11
0
 public void onMessageError(AndroidJavaObject arg0)
 {
     onMessageError(HmsUtil.GetHmsBase <AppMessage>(arg0));
 }
Exemplo n.º 12
0
 public void onMessageDisplay(AndroidJavaObject arg0)
 {
     onMessageDisplay(HmsUtil.GetHmsBase <AppMessage>(arg0));
 }
Exemplo n.º 13
0
 public void onSnapshot(AndroidJavaObject arg0, AndroidJavaObject arg1)
 {
     onSnapshot(HmsUtil.GetHmsBase <CloudDBZoneSnapshot>(arg0),
                HmsUtil.GetHmsBase <AGConnectCloudDBException>(arg1));
 }
 public void displayMessage(AndroidJavaObject arg0, AndroidJavaObject arg1)
 {
     displayMessage(HmsUtil.GetHmsBase <AppMessage>(arg0), HmsUtil.GetHmsBase <AGConnectAppMessagingCallback>(arg1));
 }
 public void onChanged(AndroidJavaObject arg0)
 {
     onChanged(HmsUtil.GetHmsBase <TokenSnapshot>(arg0));
 }
 public HttpURLConnection createConnection(AndroidJavaObject arg0)
 {
     return(createConnection(HmsUtil.GetHmsBase <URL>(arg0)));
 }
Exemplo n.º 17
0
 public void onMessageDismiss(AndroidJavaObject arg0, AndroidJavaObject arg1)
 {
     onMessageDismiss(HmsUtil.GetHmsBase <AppMessage>(arg0), HmsUtil.GetHmsBase <DismissType>(arg1));
 }
 public override void onProgress(AndroidJavaObject arg0)
 {
     DownloadTask.DownloadResult downloadResult = HmsUtil.GetHmsBase <DownloadTask.DownloadResult>(arg0);
     Debug.LogFormat(m_name + " progress : {0}",
                     (downloadResult.getBytesTransferred() * 1.0) / downloadResult.getTotalByteCount());
 }
 public void onLocationAvailability(AndroidJavaObject arg0)
 {
     onLocationAvailability(HmsUtil.GetHmsBase <LocationAvailability>(arg0));
 }
 public void onLocationResult(AndroidJavaObject arg0)
 {
     onLocationResult(HmsUtil.GetHmsBase <LocationResult>(arg0));
 }
Exemplo n.º 21
0
 public void onMessageDismiss(AndroidJavaObject arg0, AndroidJavaObject arg1)
 {
     onMessageDismiss(HmsUtil.GetHmsBase <AppMessage>(arg0), HmsUtil.GetHmsBase <AGConnectAppMessagingCallback.DismissType>(arg1));
 }
 public void onSuccess(AndroidJavaObject arg0, bool arg1, AndroidJavaObject arg2)
 {
     onSuccess(HmsUtil.GetHmsBase <ConsentStatus>(arg0), arg1, HmsUtil.GetHmsBase <List>(arg2));
 }
Exemplo n.º 23
0
 public void onRewarded(AndroidJavaObject arg0)
 {
     onRewarded(HmsUtil.GetHmsBase <Reward>(arg0));
 }