Giter Club home page Giter Club logo

stepcounter's People

Contributors

zhouguangfu avatar zhouguangfu09 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stepcounter's Issues

关于访问服务中的数据的一些问题

你好,请问不是从服务中返回数据给Activity要使用一些手段,如回调什么的,这里在StepCounterActivity类中为什么直接就能访问到StepDetector类中通过传感器得到的数据?像下面这样:
`
if (thread == null) {

        thread = new Thread() {// 子线程用于监听当前步数的变化

            @Override
            public void run() {
                // TODO Auto-generated method stub
                super.run();
                int temp = 0;
                while (true) {
                    try {
                        Thread.sleep(300);
                    } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    if (StepCounterService.FLAG) {
                        Message msg = new Message();
                        if (temp != StepDetector.CURRENT_SETP) {
                            temp = StepDetector.CURRENT_SETP;
                        }
                        if (startTimer != System.currentTimeMillis()) {
                            timer = tempTime + System.currentTimeMillis()
                                    - startTimer;
                        }
                        handler.sendMessage(msg);// 通知主线程
                    }
                }
            }
        };
        thread.start();
    }

`

还有这样:

private void countDistance() { if (StepDetector.CURRENT_SETP % 2 == 0) { distance = (StepDetector.CURRENT_SETP / 2) * 3 * step_length * 0.01; } else { distance = ((StepDetector.CURRENT_SETP / 2) * 3 + 1) * step_length * 0.01; } }

谢谢您的回答

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.