Start a new topic

Problems with Sensor in Samsung Ace 2.3.5

Problems with Sensor in Samsung Ace 2.3.5

2 people have this problem


 

Hello, my app with Wikitude SDK works fine on Android Sony Xperia LT26i 4.0.Load perfectly with POIS JSON received, displayed and north indicator radar and lets you interact with all the features of the app.

However, Galaxy Ace with android 2.2.5 charge the camera but does not load the radar or POIS.

I get several errors:

 

01-09 09:13:14.070: E / SensorManager (2745): unregisterListener :: all sensors, listener = com.wikitude.tools.listener.OrientationManager $ DeligatedSEL @ 40523218

 

 

01-09 09:13:21.970: E / libEGL (2745): called unimplemented OpenGL ES API

 

 

 

01-09 09:13:21.970: E / Web Console (2745): Uncaught ReferenceError: AR is not defined at: 1

 

 

01-09 09:13:17.500: E / SensorManager (2745): registerListener :: handle = 1 name = MMC314X delay = 20000 Listener = com.wikitude.tools.listener.OrientationManager $ DeligatedSEL @ 405d04c0

 

 

Eclypse'm testing on both devices and the Samsung I get these errors that I find in the Xperia.

 

When generating the apk and try on other devices, I load a small box camera and not get POIS.

 

What can be the problem?

Hi there!

Sound very strange.

Could you please  


Check if Wikitude is working on both devices - It uses the SDK same way any other SDK apps can use it.

Try the provided SampleProjects (SimpleARBrowser)

Check if architectView.isDeviceSupported() returns true on all of your devices

Tell me how you are using the ArchitectView


Regards,
Andi

Hi Andreas:

This is my ARchitectBrowser archive.I think the problems appear when I update to wikitude sdk 1.2

Best regards

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="viewport" content="target-densitydpi=device-dpi, width=540, user-scalable = 0" />

 

    <title>ARchitect World</title>

 

    <!-- CSS Styles -->

    <style type="text/css">

 

        * {

            margin: 0;

        }

        html, body {

            height: 100%;

        }

 

        #footer{

            height: 4em;

            background-color: rgba(255,255,255,1);

            padding: 5px 10px;

            display:none;

            position:absolute;

            bottom: 0px;

            left: 0px;

            right:0px;

            moz-border-radius: 10px;

            -webkit-border-radius: 10px;

            -khtml-border-radius: 10px;

            border-radius: 10px;

 

        }

 

        /* CSS Style for status message at the top of the HUD */

        #msg {

            border-radius: 2em;

            border: solid 2px #6d6d6d;

            background-color: rgba(256, 193, 0, 0.7);

            color: black;

            text-align: center;

            font-weight: bold;

 

            position:absolute;

            width: 60%;

            height: 100;

            left: 20%;

            top: 40%;

        }

        }

        </style>

 

    <!-- Include the ARchitect library -->

    <script src="architect://architect.js"></script>

 

 

 

</head>

 

    <body>

        <script>

 

            // current selected object

            var selectedObject = null;

 

            //variable that keeps the jsonData received from the native app

            var jsonObject;

 

            //function that gets called when the displayed poi bubble is clicked

            //sends the id of the selected poi to the native app

            function generateOnPoiBubbleClickFunc(id)

            {

                return function()

                {

                    document.location = "architectsdk://opendetailpage?id="+id;

                }

            }

 

 

            // creates a property animation

            function createOnClickAnimation(imageDrawable)

            {

                var anim = new AR.PropertyAnimation( imageDrawable, 'scaling', 1.0, 1.2, 750, new AR.EasingCurve(AR.CONST.EASING_CURVE_TYPE.EASE_OUT_ELASTIC, {amplitude : 2.0}) );

                return anim;

            }

 

 

            // creates a function for assigning to label's and imageDrawable's onClickTrigger

            function createClickTrigger(id)

            {

                return function()

                {

                    geoLoca = new AR.GeoLocation(jsonObject.Point.latitude,jsonObject.Point.longitude,jsonObject.Point.altitude);

                    // hide the bubble

                    document.getElementById("footer").style.display = 'block';

                    document.getElementById("poiName").innerHTML=jsonObject.name;

                    document.getElementById("poiDesc").innerHTML= Math.ceil(geoLoca.distanceToUser());

                    document.getElementById("footer").onclick= generateOnPoiBubbleClickFunc(id);

 

                    // reset the previous selected poi

                    if(selectedObject != null)

                    {

                        // reset the property animation

                        selectedObject.animation.stop();

 

                        selectedObject.arLabel.style.backgroundColor = '#FFFFFF80';

                        selectedObject.img.scaling = 1.0;

                        selectedObject.poiObj.renderingOrder = 0;

                    }

 

                    // set a new select status for the current selected poi

                    selectedObject = jsonObject;

                    selectedObject.arLabel.style.backgroundColor = '#FFFFFFFF';

                    selectedObject.poiObj.renderingOrder = 1;

 

                    // start the assigned animation

                    selectedObject.animation.start();

 

                    return true;

                }

            }

 

            function creaRadar () {

                //Muestra mensaje

                document.getElementById("msg").style.display ='block';

                //Crea radar

                var radar = AR.radar;

                radar.background = new AR.ImageResource("radarImg.png");

                radar.positionX = 0.02;

                radar.positionY = 0.02;

                radar.width = 0.3;

                radar.centerX = 0.5;

                radar.centerY = 0.5;

                radar.radius = 0.3;

                radar.northIndicator.image = new AR.ImageResource("north_arrow.png");

                radar.northIndicator.radius = 0.3;

                // radar.onClick = function(){ AR.logger.info(?radar was clicked?);};

                radar.enabled = true;

            }

 

 

            //function called from the native app fia callJavascript method

            //receives json-data as string and processes the contained information

            //Mensaje - Loading JSON objects

            function newData(jsonData){

 

                AR.context.destroyAll();

 

                creaRadar();

 

                // Create new images, which will be loaded right away

                i11 = new AR.ImageResource("ic_11.png", {onError: errorLoadingImage});

                i12 = new AR.ImageResource("ic_12.png", {onError: errorLoadingImage});

                i13 = new AR.ImageResource("ic_13.png", {onError: errorLoadingImage});

                i14 = new AR.ImageResource("ic_14.png", {onError: errorLoadingImage});

 

                i21 = new AR.ImageResource("ic_21.png", {onError: errorLoadingImage});

                i22 = new AR.ImageResource("ic_22.png", {onError: errorLoadingImage});

                i23 = new AR.ImageResource("ic_23.png", {onError: errorLoadingImage});

                i24 = new AR.ImageResource("ic_24.png", {onError: errorLoadingImage});

 

                i31 = new AR.ImageResource("ic_31.png", {onError: errorLoadingImage});

                i32 = new AR.ImageResource("ic_32.png", {onError: errorLoadingImage});

                i33 = new AR.ImageResource("ic_33.png", {onError: errorLoadingImage});

                i34 = new AR.ImageResource("ic_34.png", {onError: errorLoadingImage});

 

                i41 = new AR.ImageResource("ic_41.png", {onError: errorLoadingImage});

                i42 = new AR.ImageResource("ic_42.png", {onError: errorLoadingImage});

                i43 = new AR.ImageResource("ic_43.png", {onError: errorLoadingImage});

 

                i51 = new AR.ImageResource("ic_51.png", {onError: errorLoadingImage});

                i52 = new AR.ImageResource("ic_52.png", {onError: errorLoadingImage});

                i53 = new AR.ImageResource("ic_53.png", {onError: errorLoadingImage});

                i54 = new AR.ImageResource("ic_54.png", {onError: errorLoadingImage});

                i55 = new AR.ImageResource("ic_55.png", {onError: errorLoadingImage});

 

                i61 = new AR.ImageResource("ic_61.png", {onError: errorLoadingImage});

                i62 = new AR.ImageResource("ic_62.png", {onError: errorLoadingImage});

                i63 = new AR.ImageResource("ic_63.png", {onError: errorLoadingImage});

                i64 = new AR.ImageResource("ic_64.png", {onError: errorLoadingImage});

                i65 = new AR.ImageResource("ic_65.png", {onError: errorLoadingImage});

 

                //jsonObject = JSON.parse(jsonData);

jsonObject = jsonData;

 

                for(var i = 0; i < jsonObject.length; i++)

                {

                    var poidrawables = new Array();

                    var label = new AR.Label(jsonObject.name,1.0, {offsetY : -1.5,

                                             triggers: {

                                             onClick:

                                             createClickTrigger(jsonObject.id)},

                                             style : {textColor : '#FFC100',backgroundColor : '#FFFFFF80'}});

 

                    jsonObject.arLabel = label;

 

 

                    var poiImage;

 

                    if(jsonObject.type == 11)

                    {

                        poiImage = i11;

                    }

                    else if(jsonObject.type == 12)

                    {

                        poiImage = i12;

                    }

                    else if(jsonObject.type == 13)

                    {

                        poiImage = i13;

                    }

                    else if(jsonObject.type == 14)

                    {

                        poiImage = i14;

                    }

                    else if(jsonObject.type == 21)

                    {

                        poiImage = i21;

                    }

                    else if(jsonObject.type == 22)

                    {

                        poiImage = i22;

                    }

                    else if(jsonObject.type == 23)

                    {

                        poiImage = i23;

                    }

                    else if(jsonObject.type == 24)

                    {

                        poiImage = i24;

                    }

                    else if(jsonObject.type == 31)

                    {

                        poiImage = i31;

                    }

                    else if(jsonObject.type == 32)

                    {

                        poiImage = i32;

                    }

                    else if(jsonObject.type == 33)

                    {

                        poiImage = i33;

                    }

                    else if(jsonObject.type == 34)

                    {

                        poiImage = i34;

                    }

                    else if(jsonObject.type == 41)

                    {

                        poiImage = i41;

                    }

                    else if(jsonObject.type == 42)

                    {

                        poiImage = i42;

                    }

                    else if(jsonObject.type == 43)

                    {

                        poiImage = i43;

                    }

                    else if(jsonObject.type == 51)

                    {

                        poiImage = i51;

                    }

                    else if(jsonObject.type == 52)

                    {

                        poiImage = i52;

                    }

                    else if(jsonObject.type == 53)

                    {

                        poiImage = i53;

                    }

                    else if(jsonObject.type == 54)

                    {

                        poiImage = i54;

                    }

                    else if(jsonObject.type == 55)

                    {

                        poiImage = i55;

                    }

                    else if(jsonObject.type == 61)

                    {

                        poiImage = i61;

                    }

                    else if(jsonObject.type == 62)

                    {

                        poiImage = i62;

                    }

                    else if(jsonObject.type == 63)

                    {

                        poiImage = i63;

                    }

                    else if(jsonObject.type == 64)

                    {

                        poiImage = i64;

                    }

                    else if(jsonObject.type == 65)

                    {

                        poiImage = i65;

                    } else {

                        poiImage=i21;

                    }

 

                  if (jsonObject.type > 10) {

 

 

 

                        var img = new AR.ImageDrawable(poiImage, 2.0,

                                                   {triggers: {

                                                   onClick:

                                                   createClickTrigger(jsonObject.id)}}

                                                   );

 

                        jsonObject.animation = createOnClickAnimation(img);

                        jsonObject.img = img;

 

                        poidrawables.push(label);

                        poidrawables.push(img);

 

 

                        //Crea punto para radar

                        var radarCircle = new AR.Circle(0.05, {style: {fillColor: '#ff837b'}});

 

                        geoLoc = new AR.GeoLocation(jsonObject.Point.latitude,jsonObject.Point.longitude,jsonObject.Point.altitude);

                        jsonObject.poiObj = new AR.GeoObject(geoLoc, {drawables: {cam: poidrawables,radar: radarCircle}});

 

 

                  }

 

                }

 

                document.getElementById("msg").style.display = 'none';

      }

 

 

            // Called if loading of the image fails.

            function errorLoadingImage() {

                // set error message on HUD - Unable to load image!

                alert('No puedo Cargar imagen');

            }

 

 

            // hide bubble and reset the selected poi if nothing was hit by a display click

            AR.context.onScreenClick = function()

            {

                // hide the bubble

                document.getElementById("footer").style.display = 'none';

 

                // and reset the current selected poi

                if(selectedObject != null)

                {

                    // reset the property animation

                    selectedObject.animation.stop();

 

                    selectedObject.arLabel.style.backgroundColor = '#FFFFFF80';

                    selectedObject.img.scaling = 1.0;

                    selectedObject.poiObj.renderingOrder = 0;

                    selectedObject = null;

                }

            }

 

            // El mismo metodo anterior para ocultar la info del poi pero como funcion para ser llamado desde la carga de la vista

            function quitaInfo()

            {

                // hide the bubble

                document.getElementById("footer").style.display = 'none';

 

                // and reset the current selected poi

                if(selectedObject != null)

                {

                    // reset the property animation

                    selectedObject.animation.stop();

 

                    selectedObject.arLabel.style.backgroundColor = '#FFFFFF80';

                    selectedObject.img.scaling = 1.0;

                    selectedObject.poiObj.renderingOrder = 0;

                    selectedObject = null;

                }

            }

 

 

            </script>


 

Hello again Andreas:

I've checked everything I indicate.

I installed Wikitude browser on both devices.

I installed SimpleARBrowser on both devices.

The two work perfectly.

 

And this is the way we implement ArchitectView.isDeviceSupported

 

 

/ / check if the device fulfills the SDK'S Minimum Requirements

         if (! ArchitectView.isDeviceSupported (this))

         {

         Toast.makeText (this, "The device does not meet the minimum requirements." Toast.LENGTH_LONG.) Show ();

         this.finish ();

         return;

         }

 

Presumably, if the device does not support the window should be closed but not closed, just load the camera and shows neither radar nor POIS.

thanks

 

Hi again!

Concerning the isDeviceSupported() check:
We recommend to simply do not offer AR-View funcitonality in your UI when device is unsupported (e.g. remove AR-View button in your app and tell user somewhere in UI that his device is not "AR-ready")

I presume you fixed the issue you described above, right? If not: Please double-check your implementation against  the sample-projects provided, especially the life-cycle calls and the manifest set-up.

Best regards,
Andreas

 
Login or Signup to post a comment