Click here to Skip to main content
15,923,222 members
Home / Discussions / Mobile
   

Mobile

 
AnswerRe: diff between windows mobile and windows CE Pin
Alain Rist8-Dec-10 21:27
Alain Rist8-Dec-10 21:27 
GeneralRe: diff between windows mobile and windows CE Pin
mathy8-Dec-10 22:38
mathy8-Dec-10 22:38 
GeneralRe: diff between windows mobile and windows CE Pin
Alain Rist8-Dec-10 23:04
Alain Rist8-Dec-10 23:04 
AnswerRe: diff between windows mobile and windows CE Pin
chenlin_817-Jan-11 21:35
chenlin_817-Jan-11 21:35 
Questionplease help me Pin
wael_abumidan8-Dec-10 2:29
wael_abumidan8-Dec-10 2:29 
AnswerRe: please help me Pin
Richard MacCutchan8-Dec-10 3:00
mveRichard MacCutchan8-Dec-10 3:00 
AnswerRe: please help me Pin
Kasson10-Dec-10 20:33
Kasson10-Dec-10 20:33 
QuestionAndroid Sensor; No movement Pin
Smaini Nurbs29-Nov-10 12:10
Smaini Nurbs29-Nov-10 12:10 
Hi, how is the sensor suppose to detect that there's no movement coming from the phone? Because the phone is still, the numbers keep running. Thanks for the help in advance.



package com.example.testsensors;

import java.util.List;
import android.app.Activity;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

public class TestSensors extends Activity implements SensorEventListener {
    private boolean theRegisteredSensor;
    private SensorManager theSensorManager;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        theRegisteredSensor = false;
        theSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
    }
        protected void onStart() {
                super.onResume();
                List<Sensor> sensors = theSensorManager
                .getSensorList(Sensor.TYPE_ACCELEROMETER);
                if (sensors.size() > 0) {
                        Sensor sensor = sensors.get(0);
                        theRegisteredSensor = theSensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_FASTEST);
                }
        }



        @Override
        protected void onPause() {
                if (theRegisteredSensor) {
                        theSensorManager.unregisterListener(this);
                        theRegisteredSensor = false;
                }
                super.onPause();
        }


        @Override
        public void onAccuracyChanged(Sensor sensor, int accuracy) {
                // TODO Auto-generated method stub
        }

        @Override
        public void onSensorChanged(SensorEvent event) {
            // TODO Auto-generated method stub
            StringBuffer StringBuff = new StringBuffer();
            if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER){
                StringBuff.append("Accelerometer\n");
                StringBuff.append("X-axis:").append(event.values[0]).append("\n");
                StringBuff.append("Y-axis:").append(event.values[1]).append("\n");
                TextView tv = (TextView) findViewById(R.id.accero_counters);
                tv.setText(StringBuff.toString());
            Toast.makeText(getBaseContext()
            , "Movement is detected.",Toast.LENGTH_SHORT).show();
        }
   }
}

AnswerRe: Android Sensor; No movement Pin
Tony Richards11-Dec-10 0:01
Tony Richards11-Dec-10 0:01 
QuestionAndroid Mobile Pin
Poornima_S29-Nov-10 0:42
Poornima_S29-Nov-10 0:42 
AnswerRe: Android Mobile Pin
LloydA1118-Dec-10 3:52
LloydA1118-Dec-10 3:52 
QuestionPDA Serail Number Pin
Amr M. K.20-Nov-10 19:23
Amr M. K.20-Nov-10 19:23 
AnswerRe: PDA Serail Number Pin
KingsGambit21-Nov-10 16:54
KingsGambit21-Nov-10 16:54 
GeneralRe: PDA Serail Number Pin
Amr M. K.23-Nov-10 2:07
Amr M. K.23-Nov-10 2:07 
GeneralBest tutorials for Windows Phone 7 Pin
raju melveetilpurayil18-Nov-10 13:10
professionalraju melveetilpurayil18-Nov-10 13:10 
GeneralRe: Best tutorials for Windows Phone 7 Pin
KingsGambit22-Nov-10 17:04
KingsGambit22-Nov-10 17:04 
GeneralRe: Best tutorials for Windows Phone 7 Pin
PavanPareta23-Nov-10 23:05
PavanPareta23-Nov-10 23:05 
QuestionIP Camera video in .NET CF app. Pin
koleraba15-Nov-10 4:37
koleraba15-Nov-10 4:37 
QuestionAndroid TestSensor Pin
Smaini Nurbs14-Nov-10 16:22
Smaini Nurbs14-Nov-10 16:22 
QuestionCall Class Pin
Smaini Nurbs13-Nov-10 1:08
Smaini Nurbs13-Nov-10 1:08 
AnswerRe: Call Class Pin
Smaini Nurbs13-Nov-10 1:09
Smaini Nurbs13-Nov-10 1:09 
GeneralVross post warning!! Pin
Peter_in_278013-Nov-10 9:51
professionalPeter_in_278013-Nov-10 9:51 
QuestionAndriod Development using Eclipse Pin
hussain.attiya7-Nov-10 0:55
hussain.attiya7-Nov-10 0:55 
AnswerRe: Andriod Development using Eclipse Pin
hussain.attiya7-Nov-10 1:12
hussain.attiya7-Nov-10 1:12 
QuestionAndroid Stopwatch *Urgent Help* Pin
Smaini Nurbs5-Nov-10 0:40
Smaini Nurbs5-Nov-10 0:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.