Android計步代碼

所有博文已遷移至個人網站:http://ravenxrz.ink,請勿再留言評論,本文新鏈接:http://ravenxrz.ink/2019/05/03/android-stepcounting-code.html

前言

Android端計步代碼,經測試較為精準。使用了計步傳感器(耗能低,準確度高)和加速度傳感器(適用度廣,基本上各個手機上都有這個傳感器),代碼中牽涉到數據的操作,數據庫我使用的是GreenDao,相關代碼就不貼了,因為配置一下就好了,畢竟重在計步嘛

主要使用到的技術:

  • 傳感器的使用
  • 廣播監聽
  • 計時類
  • 常駐通知
  • 使用Messenger進行跨進程通信
  • 計步算法

效果圖

計步變化

實物不好拍攝,就直接錄了個GIF,實際用著還是不錯的。

廢話不多說,直接上代碼

public class StepService extends Service implements SensorEventListener {

    //TAG
    private static String TAG = "StepService";
    //存儲間隔
    private static int duration = 3000;
    //當前日期
    private static String CURRENT_DATE = "";
    //傳感器
    private SensorManager sensorManager;

    //廣播--監聽手機狀態變化
    private BroadcastReceiver mReceiver;
    //===============================================倒計時
    private TimeCount time;
    //===============================================數據庫操作
    private StepsDao stepsDao = DBUtil.getStepsDao();
    //當前步數
    private int CURRENT_STEPS;
    //期望步數
    private float EXPECT_STEPS;
    //計步傳感器類型 0-counter 1-detector
    private static  int stepSensor = -1;
    //是否記錄
    private boolean hasRecord = false;
    //已經走過的步數
    private int hasStepCount = 0;
    //以前走過的步數
    private int previousStepCount = 0;
    //===============================================采用加速度傳感器所要用到的變量

    public static float SENSITIVITY = 10; // SENSITIVITY靈敏度
    private float mLastValues[] = new float[3 * 2];
    private float mScale[] = new float[2];
    private float mYOffset;
    private static long end = 0;
    private static long start = 0;
    /**
     * 最后加速度方向
     */
    private float mLastDirections[] = new float[3 * 2];
    private float mLastExtremes[][] = { new float[3 * 2], new float[3 * 2] };
    private float mLastDiff[] = new float[3 * 2];
    private int mLastMatch = -1;

    //===============================================messenger
    //跨進程通信--使用Messenger方式
    private Messenger messengerFromService = new Messenger(new MessengerHandler());
    private  Messenger messengerFromClient;


    private class MessengerHandler extends Handler{
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            switch (msg.what){
                case Constants.MSG_FROM_CLIENT:
                    messengerFromClient = msg.replyTo;
                    StepService.this.sendMessage();
                    break;
                default:
                    break;
            }
        }
    }
    //===============================================通知相關
    private static final int NOTIFI_ID = 100;
    //格式管理
    private DecimalFormat df = new DecimalFormat("#0.0");


    @Override
    public void onCreate() {
        super.onCreate();
        EXPECT_STEPS = 8000f;
        //初始化廣播
        initBroadcastReceiver();
        new Thread(new Runnable() {
            @Override
            public void run() {
                //獲取傳感器類型
                startStepDetector();
            }
        }).start();
        startTimeCount();
        initTodayData();
    }


    /**
     * 取得今日日期
     * @return
     */
    private String getTodayDate(){
        Date date = new Date(System.currentTimeMillis());
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(date);
    }

    /**
     * 初始化當天的步數
     */
    private void initTodayData() {
        CURRENT_DATE = getTodayDate();
        //===============================================在這里進行數據新的一列的存儲
        //通過日期匹配,當數據中有今日步數的行,那么將步數值進行讀取,如果沒有那么久新增一行,并將CURRENT_STEP存儲進去
        QueryBuilder qb = stepsDao.queryBuilder();
        qb.where(StepsDao.Properties.Date.eq(getTodayDate()));
        Steps steps = (Steps) qb.unique();
        if(steps!=null){
            CURRENT_STEPS = steps.getUStep();
        }else{
            //增加一行
            Steps stepsAdd = new Steps();
            stepsAdd.setDate(CURRENT_DATE);
            stepsAdd.setUStep(0);
            stepsAdd.setHasUpLoad(false);
            stepsDao.insert(stepsAdd);
        }
    }
    /**
     * 獲取當前步數占有率
     */
    private String getCurrentOccupancy(){
        //默認8000,完善時在Service啟動的時候進行復制
        return df.format((float)CURRENT_STEPS/EXPECT_STEPS*100);
    }

    /**
     * 獲取傳感器實例
     */
    private void startStepDetector() {
        if(sensorManager!=null){
            sensorManager = null;
        }
        sensorManager = (SensorManager) this.getSystemService(SENSOR_SERVICE);
        addCountStepListener();

    }
    Sensor countSensor ;
    Sensor detectorSensor ;
    Sensor accelerateSensor;
    private void addCountStepListener() {
         countSensor = sensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER);
         detectorSensor = sensorManager.getDefaultSensor(Sensor.TYPE_STEP_DETECTOR);
        //利用加速度傳感器
        accelerateSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);

        if(countSensor!=null){
            //選擇計步傳感器
            stepSensor = 0;
            Log.i(TAG,"計步傳感器");
            sensorManager.registerListener(StepService.this,countSensor,SENSOR_DELAY_NORMAL);
        }else if(detectorSensor!=null){
            //步數檢測器
            stepSensor = 1;
            Log.i(TAG,"步數監測器");
            sensorManager.registerListener(StepService.this,detectorSensor,SENSOR_DELAY_FASTEST);
        }else if(accelerateSensor != null){
            stepSensor = 2;
            int h = 480;
            mYOffset = h * 0.5f;
            mScale[0] = -(h * 0.5f * (1.0f / (SensorManager.STANDARD_GRAVITY * 2)));
            mScale[1] = -(h * 0.5f * (1.0f / (SensorManager.MAGNETIC_FIELD_EARTH_MAX)));
            Log.i(TAG,"加速度傳感器");
            sensorManager.registerListener(StepService.this,accelerateSensor,SENSOR_DELAY_FASTEST);
        }

    }

    /**
     * 傳感器回調
     * @param event
     */
    @Override
    public void onSensorChanged(SensorEvent event) {
        if(stepSensor == 0){
            int tempStep = (int) event.values[0];
            if(!hasRecord){
                hasRecord = true;
                hasStepCount = tempStep;
            }else{
                int thisStepCount = tempStep -hasStepCount;
                CURRENT_STEPS+=(thisStepCount-previousStepCount);
                previousStepCount = thisStepCount;
            }
            sendMessage();
            setNotification();
        }else if(stepSensor == 1){
            if(event.values[0] == 1.0){
                hasRecord = true;
                CURRENT_STEPS++;
                sendMessage();
                setNotification();
            }
        }else if(stepSensor == 2){
            hasRecord = true;
            synchronized (this) {
                float vSum = 0;
                for (int i = 0; i < 3; i++) {
                    final float v = mYOffset + event.values[i] * mScale[1];
                    vSum += v;
                }
                int k = 0;
                float v = vSum / 3;

                float direction = (v > mLastValues[k] ? 1
                        : (v < mLastValues[k] ? -1 : 0));
                if (direction == -mLastDirections[k]) {
                    // Direction changed
                    int extType = (direction > 0 ? 0 : 1); // minumum or
                    // maximum?
                    mLastExtremes[extType][k] = mLastValues[k];
                    float diff = Math.abs(mLastExtremes[extType][k]
                            - mLastExtremes[1 - extType][k]);

                    if (diff > SENSITIVITY) {
                        boolean isAlmostAsLargeAsPrevious = diff > (mLastDiff[k] * 2 / 3);
                        boolean isPreviousLargeEnough = mLastDiff[k] > (diff / 3);
                        boolean isNotContra = (mLastMatch != 1 - extType);

                        if (isAlmostAsLargeAsPrevious && isPreviousLargeEnough
                                && isNotContra) {
                            end = System.currentTimeMillis();
                            if (end - start > 500) {// 此時判斷為走了一步

                                CURRENT_STEPS++;
                               sendMessage();
                               setNotification();
                                mLastMatch = extType;
                                start = end;
                            }
                        } else {
                            mLastMatch = -1;
                        }
                    }
                    mLastDiff[k] = diff;
                }
                mLastDirections[k] = direction;
                mLastValues[k] = v;
            }
            }
        }


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

    }

    private void sendMessage(){
        Message msg = Message.obtain(null,Constants.MSG_FROM_SERVICE);
        Bundle bundle = new Bundle();
        bundle.putInt("currentSteps",CURRENT_STEPS);
        msg.setData(bundle);
        try {
            if(hasRecord&&messengerFromClient!=null) {
                messengerFromClient.send(msg);
            }
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }


    /**
     * 注冊廣播
     */
    private void initBroadcastReceiver() {
        final IntentFilter filter = new IntentFilter();
        // 屏幕滅屏廣播
        filter.addAction(Intent.ACTION_SCREEN_OFF);
        //關機廣播
        filter.addAction(Intent.ACTION_SHUTDOWN);
        // 屏幕亮屏廣播
        filter.addAction(Intent.ACTION_SCREEN_ON);
        // 屏幕解鎖廣播
        filter.addAction(Intent.ACTION_USER_PRESENT);
        // 當長按電源鍵彈出“關機”對話或者鎖屏時系統會發出這個廣播
        // 所以監聽這個廣播,當收到時就隱藏自己的對話,如點擊pad右下角部分彈出的對話框
        filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        //監聽日期變化
        filter.addAction(Intent.ACTION_DATE_CHANGED);
        filter.addAction(Intent.ACTION_TIME_CHANGED);
        filter.addAction(Intent.ACTION_TIME_TICK);

        mReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                String action = intent.getAction();
                if(Intent.ACTION_SCREEN_ON.equals(action)){
                    Log.i(TAG,"ScreenOn");
                } else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
                    Log.i(TAG,"ScreenOff");
                    //60s
                    duration = 6000;
                }else if (Intent.ACTION_USER_PRESENT.equals(action)){
                    Log.i(TAG,"screen unlock");
                    save();
                    //30s
                    duration = 3000;
                }else if(Intent.ACTION_SHUTDOWN.equals(action)){
                    Log.i(TAG,"shutdown");
                    save();
                }else if(Intent.ACTION_DATE_CHANGED.equals(action)){
                    save();
                    isNewDay();
                }else if(Intent.ACTION_TIME_CHANGED.equals(action)){
                    save();
                    isNewDay();
                }else if(Intent.ACTION_TIME_TICK.equals(action)){
                    save();
//                    isNewDay();
                }else if("ANewacount".equals(action)){

                    //當時一個新用戶登錄的時候
                    //清除數據
                    Log.i(TAG,"收到新賬戶廣播");
                    initTodayData();
                }
            }
        };
        registerReceiver(mReceiver,filter);
    }

    /**
     * 0點時初始化數據
     */
    private void isNewDay() {
        String time = "00:00";
        if(time.equals(new SimpleDateFormat("HH:mm").format(new Date()))||(!CURRENT_DATE.equals(getTodayDate()))){
            initTodayData();
        }
    }

    /**
     * 存儲到數據中去
     */
    private void save() {
        int tempStep = CURRENT_STEPS;
        QueryBuilder qb = stepsDao.queryBuilder();
        qb.where(StepsDao.Properties.Date.eq(getTodayDate()));
        Steps steps = (Steps) qb.unique();
        //不為空時,說明還未到12點,我們進行更新就行,為空說明為最后一次存儲
        if(steps!=null){
            steps.setUStep(tempStep);
            steps.setDate(CURRENT_DATE);
            stepsDao.update(steps);
        }else{
            steps = new Steps();
            steps.setUStep(tempStep);
            steps.setDate(CURRENT_DATE);
            stepsDao.update(steps);
        }

    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return messengerFromService.getBinder();
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        setNotification();
        return START_STICKY;
        //如果被系統kill掉,系統會自動將kill時的狀態保留為開始狀態,之后進行重連
    }

    private void setNotification() {
        PendingIntent pd = PendingIntent.getActivity(this,0,new Intent(this, MainViewActivity.class),0);
        //在這里進行前臺服務
        Notification.Builder builder = new Notification.Builder(this)
                .setOngoing(true)
                .setSmallIcon(R.drawable.poplog)
                .setLargeIcon(BitmapFactory.decodeResource(this.getResources(),R.drawable.poplog))
                .setContentTitle("當前步數"+CURRENT_STEPS)
                .setContentText("今日完成百分比"+getCurrentOccupancy()+"%")
                .setWhen(System.currentTimeMillis())
                .setContentIntent(pd);
        startForeground(NOTIFI_ID,builder.build());
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        //取消前臺進程
        stopForeground(true);
        unregisterReceiver(mReceiver);
        //注銷各傳感器
        if(countSensor!= null || detectorSensor != null || accelerateSensor != null){
            sensorManager.unregisterListener(StepService.this);
        }


    }


    /**
     * 開始計時
     */
    private void startTimeCount() {
        time = new TimeCount(duration,1000);
        time.start();
    }

    private class TimeCount extends CountDownTimer{


        /**
         * @param millisInFuture    The number of millis in the future from the call
         *                          to {@link #start()} until the countdown is done and {@link #onFinish()}
         *                          is called.
         * @param countDownInterval The interval along the way to receive
         *                          {@link #onTick(long)} callbacks.
         */
        public TimeCount(long millisInFuture, long countDownInterval) {
            super(millisInFuture, countDownInterval);
        }

        @Override
        public void onTick(long millisUntilFinished) {

        }

        @Override
        public void onFinish() {
            //如果計時器正常結束,則開始計步
            time.cancel();
            save();
            startTimeCount();
        }
    }
}

代碼分析

onCreate

    @Override
    public void onCreate() {
        super.onCreate();
        EXPECT_STEPS = 8000f;
        //初始化廣播
        initBroadcastReceiver();
        new Thread(new Runnable() {
            @Override
            public void run() {
                //獲取傳感器類型
                startStepDetector();
            }
        }).start();
        startTimeCount();
        initTodayData();
    }

代碼上寫得很簡單明了,即:初始廣播,獲取傳感器類型,開始計時,以及初始化日期

初始化廣播

 /**
     * 注冊廣播
     */
    private void initBroadcastReceiver() {
        final IntentFilter filter = new IntentFilter();
        // 屏幕滅屏廣播
        filter.addAction(Intent.ACTION_SCREEN_OFF);
        //關機廣播
        filter.addAction(Intent.ACTION_SHUTDOWN);
        // 屏幕亮屏廣播
        filter.addAction(Intent.ACTION_SCREEN_ON);
        // 屏幕解鎖廣播
        filter.addAction(Intent.ACTION_USER_PRESENT);
        // 當長按電源鍵彈出“關機”對話或者鎖屏時系統會發出這個廣播
        // 所以監聽這個廣播,當收到時就隱藏自己的對話,如點擊pad右下角部分彈出的對話框
        filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        //監聽日期變化
        filter.addAction(Intent.ACTION_DATE_CHANGED);
        filter.addAction(Intent.ACTION_TIME_CHANGED);
        filter.addAction(Intent.ACTION_TIME_TICK);

        mReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                String action = intent.getAction();
                if(Intent.ACTION_SCREEN_ON.equals(action)){
                    Log.i(TAG,"ScreenOn");
                } else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
                    Log.i(TAG,"ScreenOff");
                    //60s
                    duration = 6000;
                }else if (Intent.ACTION_USER_PRESENT.equals(action)){
                    Log.i(TAG,"screen unlock");
                    save();
                    //30s
                    duration = 3000;
                }else if(Intent.ACTION_SHUTDOWN.equals(action)){
                    Log.i(TAG,"shutdown");
                    save();
                }else if(Intent.ACTION_DATE_CHANGED.equals(action)){
                    save();
                    isNewDay();
                }else if(Intent.ACTION_TIME_CHANGED.equals(action)){
                    save();
                    isNewDay();
                }else if(Intent.ACTION_TIME_TICK.equals(action)){
                    save();
//                    isNewDay();
                }else if("ANewacount".equals(action)){

                    //當時一個新用戶登錄的時候
                    //清除數據
                    Log.i(TAG,"收到新賬戶廣播");
                    initTodayData();
                }
            }
        };
        registerReceiver(mReceiver,filter);
    }

在這段代碼里,主要是監聽用戶手機狀態的改變,根據狀態的改變進行不同的操作,如“用戶關機時,將當前步數進行保存”、“當到達凌晨0點時需要進行新的一天的數據庫更新”等等。別忘了注銷Receiver

獲取傳感器

 /**
     * 獲取傳感器實例
     */
    private void startStepDetector() {
        if(sensorManager!=null){
            sensorManager = null;
        }
        sensorManager = (SensorManager) this.getSystemService(SENSOR_SERVICE);
        addCountStepListener();

    }
    Sensor countSensor ;
    Sensor detectorSensor ;
    Sensor accelerateSensor;
    private void addCountStepListener() {
         countSensor = sensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER);
         detectorSensor = sensorManager.getDefaultSensor(Sensor.TYPE_STEP_DETECTOR);
        //利用加速度傳感器
        accelerateSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);

        if(countSensor!=null){
            //選擇計步傳感器
            stepSensor = 0;
            Log.i(TAG,"計步傳感器");
            sensorManager.registerListener(StepService.this,countSensor,SENSOR_DELAY_NORMAL);
        }else if(detectorSensor!=null){
            //步數檢測器
            stepSensor = 1;
            Log.i(TAG,"步數監測器");
            sensorManager.registerListener(StepService.this,detectorSensor,SENSOR_DELAY_FASTEST);
        }else if(accelerateSensor != null){
            stepSensor = 2;
            int h = 480;
            mYOffset = h * 0.5f;
            mScale[0] = -(h * 0.5f * (1.0f / (SensorManager.STANDARD_GRAVITY * 2)));
            mScale[1] = -(h * 0.5f * (1.0f / (SensorManager.MAGNETIC_FIELD_EARTH_MAX)));
            Log.i(TAG,"加速度傳感器");
            sensorManager.registerListener(StepService.this,accelerateSensor,SENSOR_DELAY_FASTEST);
        }

    }

這個沒什么好說的,就是獲取各個傳感器對象,首先選擇的是計步傳感器,如果沒有計步傳感器那么久檢查是否有加速度傳感器,同樣的別忘了注銷傳感器對象。

計步的核心代碼

  /**
     * 傳感器回調
     * @param event
     */
    @Override
    public void onSensorChanged(SensorEvent event) {
        if(stepSensor == 0){
            int tempStep = (int) event.values[0];
            if(!hasRecord){
                hasRecord = true;
                hasStepCount = tempStep;
            }else{
                int thisStepCount = tempStep -hasStepCount;
                CURRENT_STEPS+=(thisStepCount-previousStepCount);
                previousStepCount = thisStepCount;
            }
            sendMessage();
            setNotification();
        }else if(stepSensor == 1){
            if(event.values[0] == 1.0){
                hasRecord = true;
                CURRENT_STEPS++;
                sendMessage();
                setNotification();
            }
        }else if(stepSensor == 2){
            hasRecord = true;
            synchronized (this) {
                float vSum = 0;
                for (int i = 0; i < 3; i++) {
                    final float v = mYOffset + event.values[i] * mScale[1];
                    vSum += v;
                }
                int k = 0;
                float v = vSum / 3;

                float direction = (v > mLastValues[k] ? 1
                        : (v < mLastValues[k] ? -1 : 0));
                if (direction == -mLastDirections[k]) {
                    // Direction changed
                    int extType = (direction > 0 ? 0 : 1); // minumum or
                    // maximum?
                    mLastExtremes[extType][k] = mLastValues[k];
                    float diff = Math.abs(mLastExtremes[extType][k]
                            - mLastExtremes[1 - extType][k]);

                    if (diff > SENSITIVITY) {
                        boolean isAlmostAsLargeAsPrevious = diff > (mLastDiff[k] * 2 / 3);
                        boolean isPreviousLargeEnough = mLastDiff[k] > (diff / 3);
                        boolean isNotContra = (mLastMatch != 1 - extType);

                        if (isAlmostAsLargeAsPrevious && isPreviousLargeEnough
                                && isNotContra) {
                            end = System.currentTimeMillis();
                            if (end - start > 500) {// 此時判斷為走了一步

                                CURRENT_STEPS++;
                               sendMessage();
                              setNotification();
                                mLastMatch = extType;
                                start = end;
                            }
                        } else {
                            mLastMatch = -1;
                        }
                    }
                    mLastDiff[k] = diff;
                }
                mLastDirections[k] = direction;
                mLastValues[k] = v;
            }
            }
        }


  • 計步傳感器
    首先從傳感器中拿到tempStep,它代表著從計步以來的總步數,所以需要記錄上次走的步數,用這次步數減去上次走的步數得到的差值,再疊加,就可以得到當前走的總步數了。
  • 加速度傳感器
    這部分的算法似乎是某個google的大神寫的,我也沒看懂
  • 另外
    sendMessagesetNotification分別為更新UI界面和更新通知欄。

寫在最后

因為寫這個功能的時候參看了不少代碼,而且時間較為久了,參看了不少博文,忘了具體的博主了,這里就感謝所有博主了。ok,上課去了。

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 228,936評論 6 535
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 98,744評論 3 421
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 176,879評論 0 381
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,181評論 1 315
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 71,935評論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,325評論 1 324
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,384評論 3 443
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,534評論 0 289
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 49,084評論 1 335
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 40,892評論 3 356
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 43,067評論 1 371
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,623評論 5 362
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,322評論 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,735評論 0 27
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 35,990評論 1 289
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 51,800評論 3 395
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 48,084評論 2 375

推薦閱讀更多精彩內容

  • 最近在項目中研究計步模塊,主要功能記錄當天步數,類似微信運動,支付寶計步,咕咚今日步數。開發之前的調研工作,搜遍b...
    碼農一顆顆閱讀 32,374評論 37 111
  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 172,677評論 25 708
  • Spring Cloud為開發人員提供了快速構建分布式系統中一些常見模式的工具(例如配置管理,服務發現,斷路器,智...
    卡卡羅2017閱讀 134,799評論 18 139
  • 閱歷太淺、不夠優秀、沒有才華,寫不出多優美的文章; 閑來無事、看不進書、沒有WIFI,寫些亂七八糟的文字。 在我們...
    段子安1120閱讀 442評論 0 0
  • (一) 時光慢慢劃過純白的紙張,寫下青春的誓言,當紙到盡頭,誰陪...
    與戚說閱讀 758評論 0 0