Affichage des articles dont le libellé est sensor. Afficher tous les articles
Affichage des articles dont le libellé est sensor. Afficher tous les articles

dimanche 1 mars 2015

[q]*[help] sensor problems ;( topic






HI GUYS

I'm really getting mad with my z1. I replaced my broken lcd and the serviceman used a lcd with lower build quality.
the lcd itself doesnt have any problem but the sensors go crazy and stop working after a while.
dont know what happens that they do so but mostly happens when i get a call or its on dock charger
the accelerometer, gyroscope, proximity sensor, ambient light, compass & etc. .they stop working and its very nerving thing
any way to fix this guys?! please help :(:(






Fingerprint sensor broken? topic






Hi,

I am still under stock, no root, no warranty void (first time I am lucky that CM is still under development).
When I want to start the fingerprint manager I get the error that I should reboot as there was a problem.
Hard reset led me to the same screen without any modifications from stock software.

Clear error for warranty I assume or any suggestions and experiences?

Best and thank,
Blubberor






vendredi 27 février 2015

[Q] Proximity sensor problem in call topic






I'm having issues with my z3 compact.like when i'm in a call,the screen gets activated randomly when i move the phone .if i hold it straight onto my ears it works all good.But if i move the phone even if very little around or take away the phone from my face and put it back,the screen gets activated and randomly touched.Anyone having the issue while in call?

my past phones are, Sony live with walkman,HTC desire X,Moto G,LG G3,Moto X.So i know how it should be.Never had that kind of behavious before with sensors.






jeudi 26 février 2015

[Q&A] [TIP] Disable broken Proximity sensor topic






Q&A for [TIP] Disable broken Proximity sensor

Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.

Before posting, please use the forum search and read through the discussion thread for [TIP] Disable broken Proximity sensor. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.

Thanks for understanding and for helping to keep XDA neat and tidy! :)






[Guide] Floating in circular boundary (or rectangular) with accelerometer sensor topic






This guide is about floating, moving a point in coordinate system.

It may be useful to make spirit level (bubble level) or magic 8 ball and so on :)

Just use device's accelerometer sensor to moving a center point.

I wrote android custom view which implements SensorEventListener.

Do some initialization (measuring screen size, set boundary size, assign values...) first.

Draw the x, y axis and boundary and little circle.

In end of the onDraw(), invalidate() makes little circle keep moving.



Important formula to make little circle inside circular boundary is below.


Code:


    private void calc(){
        //for simulating object floating on water
        //against gravity
        xCon += mSensorX;
        yCon -= mSensorY;

        /*
        //for simulating object rolling on ground
        //adjust to gravity
        xCon -= mSensorX;
        yCon += mSensorY;
        */

        //for circular boundary
        if(Math.pow(xCon, 2) + Math.pow(yCon, 2) >= boundarySquare){
            isBoundaryOut = true;


            if(xCon != 0 && yCon != 0){
                radian = (float) Math.atan2(yCon, xCon);
            }


            xCon = (float) (Math.cos(radian) * boundary);
            yCon = (float) (Math.sin(radian) * boundary);

        }
        else{
            isBoundaryOut = false;
        }
    }


add the sensor's value to x, y coordinate (xCon, yCon) and check it is out of the circular boundary.
If it is change the value with the Formula

x = cos(atan2(y, x)) * CIRCULAR_BOUDNARY_RADIUS
y = sin(atan2(y, x)) * CIRCULAR_BOUDNARY_RADIUS

You can select the circle to float on water or roll on ground just change addition <-> subtraction.

- For simulating object floating on water, against gravity
xCon += mSensorX;
yCon -= mSensorY;


- For simulating object rolling on ground, adjust to gravity
xCon -= mSensorX;
yCon += mSensorY;


Also you can change boundary shape easily
For rectangle boundary
if(xCon > horizontalBound){
xCon = horizontalBound;
}
else if(xCon < -horizontalBound){
xCon = -horizontalBound;
}
if(yCon > verticalBound){
yCon = verticalBound;
}
else if(yCon < -verticalBound){
yCon = -verticalBound;
}




Code:


    @Override
    public void onSensorChanged(SensorEvent event) {
        if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER)
            return;
       
        mSensorX = sensor_weight * event.values[0];
        mSensorY = sensor_weight * event.values[1];
    }


onSensorChanged() I just add sensor values(weighted) to center point x, y and it seems to be quite enough to do rough simulation.

Whole source code of my custom view is like below.


Code:


package net.gerosyab.circularboundary;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.util.AttributeSet;
import android.view.Display;
import android.view.Surface;
import android.view.View;
import android.view.WindowManager;

public class MyView extends View implements SensorEventListener{

    Context context;

    //weight for calculating speed of floating image
    //multiplied with accelrometer sensor value
    //faster if it is more than 1
    //slower if it is less than 1
    float sensor_weight = 2.15f;

    float width;
    float height;
    float cx;
    float cy;
    float x;
    float y;
    float xCon, yCon;
    float boundary;
    float boundarySquare;
    float dotRadius = 15;
    float radian;
    Paint linePaint, circlePaint, dotPaint, textPaint;
    float horizontalBound;
    float verticalBound;
    boolean isBoundaryOut = false;

    private float mSensorX;
    private float mSensorY;
    private SensorManager mSensorManager;
    private Sensor mAccelerometer;
    private WindowManager mWindowManager;
    private Display mDisplay;

    public MyView(Context context) {
        super(context);
        this.context = context;
        init();
    }

    public MyView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.context = context;
        init();
    }

    public MyView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        this.context = context;
        init();
    }

    private void init(){
        linePaint = new Paint();
        circlePaint = new Paint();
        dotPaint = new Paint();
        textPaint = new Paint();

        linePaint.setColor(Color.WHITE );
        linePaint.setAntiAlias(true);
        linePaint.setStrokeWidth(2);
        linePaint.setStyle(Paint.Style.STROKE);
        circlePaint.setColor(Color.YELLOW);
        circlePaint.setAntiAlias(true);
        circlePaint.setStrokeWidth(2);
        circlePaint.setStyle(Paint.Style.STROKE);
        dotPaint.setColor(Color.RED);
        dotPaint.setAntiAlias(true);
        dotPaint.setStrokeWidth(5);
        dotPaint.setStyle(Paint.Style.FILL);
        textPaint.setColor(Color.WHITE);
        textPaint.setAntiAlias(true);
        textPaint.setStyle(Paint.Style.FILL_AND_STROKE);
        textPaint.setTextSize(40);

        x = cx;
        y = cy;
        xCon = 0;
        yCon = 0;

    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        //draw x, y axis
        canvas.drawLine(cx, 0, cx, height, linePaint);
        canvas.drawLine(0, cy, width, cy, linePaint);

        //draw circular boundary
        canvas.drawCircle(cx, cy, boundary, circlePaint);

        canvas.drawRect(cx - horizontalBound, cy - verticalBound, cx + horizontalBound, cy + verticalBound, circlePaint);

        calc();
        //draw dot
        canvas.drawCircle(xCon + cx, yCon + cy, dotRadius, dotPaint);

        //draw text
        canvas.drawText("isBoundaryOut : " + isBoundaryOut, 100, 50, textPaint);
        canvas.drawText("sensorX : " + mSensorX, 100, 100, textPaint);
        canvas.drawText("sensorY : " + mSensorY, 100, 150, textPaint);
        canvas.drawText("xCon : " + xCon, 100, 200, textPaint);
        canvas.drawText("yCon : " + yCon, 100, 250, textPaint);
        canvas.drawText("cx : " + cx, 100, 300, textPaint);
        canvas.drawText("cy : " + cy, 100, 350, textPaint);
        canvas.drawText("horizontalBound : " + horizontalBound, 100, 400, textPaint);
        canvas.drawText("verticalBound : " + verticalBound, 100, 450, textPaint);
        invalidate();
    }

    private void calc(){
        //for simulating object floating on water
        //against gravity
        xCon += mSensorX;
        yCon -= mSensorY;

        /*
        //for simulating object rolling on ground
        //adjust to gravity
        xCon -= mSensorX;
        yCon += mSensorY;
        */

        /*
        //for rectangle boundary
        if(xCon > horizontalBound){
            xCon = horizontalBound;
        }
        else if(xCon < -horizontalBound){
            xCon = -horizontalBound;
        }
        if(yCon > verticalBound){
            yCon = verticalBound;
        }
        else if(yCon < -verticalBound){
            yCon = -verticalBound;
        }
        */

        //for circular boundary
        if(Math.pow(xCon, 2) + Math.pow(yCon, 2) >= boundarySquare){
            isBoundaryOut = true;


            if(xCon != 0 && yCon != 0){
                radian = (float) Math.atan2(yCon, xCon);
            }

            xCon = (float) (Math.cos(radian) * boundary);
            yCon = (float) (Math.sin(radian) * boundary);
        }
        else{
            isBoundaryOut = false;
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        width = getWidth();
        height = getHeight();
        cx = width / 2;
        cy = height / 2;
        boundary = width * 0.15f;
        horizontalBound = boundary;
        verticalBound = boundary;
        boundarySquare = boundary * boundary;

        mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
        mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
        // Get an instance of the WindowManager
        mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        mDisplay = mWindowManager.getDefaultDisplay();
        mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_UI);
    }

    @Override
    public void onSensorChanged(SensorEvent event) {
        if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER)
            return;

        switch (mDisplay.getRotation()) {
            case Surface.ROTATION_0:
                mSensorX = sensor_weight * event.values[0];
                mSensorY = sensor_weight * event.values[1];
                break;
            case Surface.ROTATION_90:
                mSensorX = sensor_weight * -event.values[1];
                mSensorY = sensor_weight * event.values[0];
                break;
            case Surface.ROTATION_180:
                mSensorX = sensor_weight * -event.values[0];
                mSensorY = sensor_weight * -event.values[1];
                break;
            case Surface.ROTATION_270:
                mSensorX = sensor_weight * event.values[1];
                mSensorY = sensor_weight * -event.values[0];
                break;
        }
    }

    @Override
    public void onAccuracyChanged(Sensor sensor, int accuracy) {

    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        mSensorManager.unregisterListener(this);
    }
}


Hope this is helpful!
Thanks :D








Attached Thumbnails


Click image for larger version<br/><br/>Name:	screeenshot2.png<br/>Views:	N/A<br/>Size:	62.0 KB<br/>ID:	3184507
 

















mercredi 25 février 2015

[Q] Heartrate sensor works weird after lollipop upgrade topic






I recently upgraded galaxy S5's OS to lollipop.

After that the red led of heart rate sensor turns on every time when I place my finger (in device wake-up status) upon it even if I'm not using S-health application to check my heart rate.

Is it a bug or something about background recording heart rate?

Now I'm worrying about the battery consumption of it.






[Q] Proximity sensor fail topic






Hello!

I have a Sony Xperia Z2, and I was very satisfied with the device until I made an upgrade to the Android verion. Since then, the proximity sensor has issues, is working for a while, after is not working. When I restart the device, it's working again, but not always. Also, the gyroscope is having the same problems. Can all this be because of the software? I am running 23.0.1.A.3.9






lundi 23 février 2015

[Q] LG G2 (LS980_ZVC) Motion sensor problem topic






Assalam_o_Alaikum

Hello experts,

I have a little issue in my mobile LG G2 LS980ZVC (Sprint Version). I have flashed Cloudyflex 2.8, but the problem is motion sensor stop working after 2 or 3 days. Then i celebrate sensor and it works again like charm.

Kindly help me about this.

Thanks in advance.

Regards,
Rizwan Raj






dimanche 22 février 2015

Brightnes sensor topic






Hi,
I installed few app for brightness controll (lux, velano) but both reported that phone don't have brightness sensor and offered to use camera sensor instead so I am not sure is it true or not?






samedi 14 février 2015

Disable the Proximity Sensor topic






It is already the second time that the Proximity Sensor of my Nexus 5 is broken. During a call the display turns off and I cannot turn it on again. When I check the sensor with the App "Sensor Box" I can see that it always returns 0. As a workaround I want to disable the broken sensor. I already tried to disable it by adding "gsm.proximity.enable=false" to the build.prop file but this does not work. Does anyone has other ideas how to do this on a Nexus 5 with CM11 installed?






[Q] Xperia E dual doesn't start only the red flash and red sensor light topic






xperia E dual 1605
android 4.1.1.
firmware 11.03.A.3.1
please help,,my xperia e dual doesn't start,I installed TMRW it was working fine but after i turned it off it didn't start,
it just flashes the red led 3 times when i press the power button (although i have leave it on wall charge for more than 13hrs) and red sensor light whenever i try to power it on and when i put it on charge.
i have try to flash it with flashtool but no response in fastmode or flashmode...
please help






mercredi 11 février 2015

Gyroscope sensor not working topic






I have tested via various apps, but sensors are not giving any reading.

Please someone guide me.








lundi 9 février 2015

[Q] Proximity sensor always on topic






Hello,

I noticed that the proximity sensor on my Z1C is always on when the display is off (red light in the top left corner).
Is that normal? Is it also the case for some of you? How can I resolve this?

Thanks,