zoukankan      html  css  js  c++  java
  • Tasker to detect and vibrate once the ougoing call is being answered

    I happen to find that for GSM standard phone, call duration would be created into sql database only if the outgoing call is being answered, or after hanging up if it is not being answered.

    So i guess this method is meant for CDMA android phone only. cause we could not detect if outgoing call is offhook by the callee via tasker or sl4a.

    Java code would be the solution i think, by monitoring the phone state.
     
     
    If you are interested, please follow my profile instruction below and run some test, please further advise me if it is working or any issues. many thanks!
     
     
    NB.: to run sqlite 3 command, you must make sure your phone has installed the proper sqlite3 file and you must root your phone first to run sqlite3 command.
     
    Tips:
    download the sqlite3 file via the links below and renane it as "sqlite3" if it is not, then put it under the phone root directory /system/bin folder, and don't forget to modify the permission for the sqlite3 file to be
    rwxr-xr-x
     
    android 4.0 or earlier: http://bit.ly/sqlite3
      
     
    profile:

    context: state-phone-call, type:outgoing
     
    task:
     
    action 1: script-run shell,
    command:
    sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "select duration from calls where type <= 2 order by date desc limit 1;"
     
    use root checked, store result in %VIBRATING 
     
    action 2: alert-vibrate, 200ms, if %VIBRATING  ~   1
     
    action 3: task-goto, action number 2, if %VIBRATING    !~   1
     
    Action 4: task-stop, if %VIBRATING  ~   1
  • 相关阅读:
    datetime模块
    python正则表达式练习题
    Python入门——turtle库的使用
    Python入门——Python程序语法元素
    Python入门——eval() 函数
    Python入门——实例1_温度转换
    Python入门——编程方式
    Python入门——程序的基本编写方法
    Python入门——编译和解释
    SQL中isnull、ifnull和nullif函数用法
  • 原文地址:https://www.cnblogs.com/shangdawei/p/4510917.html
Copyright © 2011-2022 走看看