-1

I am a newbee in android and I have a question. I surfed a lot in order to find out how to calculate the no of stairs climbed. Now I came across accelerometer and few applications which ask us to input certain values like tread, raise and so on.

GPS was another option. But to my knowledge GPS does not work indoors.

I just wanted to know is there any way else to find the no of stairs climbed apart from this.

Thanks in advance.

kanchan
  • 77
  • 3
  • 11
  • 1
    Use a TextView. Set the text to "How many stairs did you climb?" and put an EditText next to it. That's the easiest way. Sorry, couldn't resist. Apart from that, accelerometer is the answer. – Simon Oct 16 '12 at 10:52
  • @Simon why didn't you put it as an answer.. I think that is the only way to implement this requirement... I still don't know how accelerometer can be used for this requirement? – Krishnabhadra Oct 16 '12 at 11:00

2 Answers2

0

You will need to use accelerometer. There is no other way to do it.

See how to count step using accelerometer in android for possible answers. To avoid asking for tread depth and step height, you could assume one step per step, if you see what I mean :)

Community
  • 1
  • 1
Simon
  • 14,407
  • 8
  • 46
  • 61
0

I would try to develop a pedometer algorithm specifically for this task, see reference to the general pedometer algorithms at Android accelerometer accuracy (Inertial navigation), under indoor positioning.

Developing a pedometer requires lots of experiments and tweaking, and there will always be a way to fool your application.

Community
  • 1
  • 1
Ali
  • 56,466
  • 29
  • 168
  • 265
  • Any decent ninja should be able to beat your detection logic. – Mister Smith Oct 22 '12 at 10:45
  • @MisterSmith Sorry, I don't follow. Could you please expand on this? – Ali Oct 22 '12 at 11:14
  • Just trying to portrait what you already said. The detection is based on certain asumptions on the acceleration function, but you can also climb the stairs with no acceleration. A ninja will do it in a single jump, of course :) – Mister Smith Oct 22 '12 at 11:37
  • @MisterSmith :) Yes, you can always fool the application. I haven't thought of ninjas though... :D – Ali Oct 22 '12 at 11:40