Code Monkey home page Code Monkey logo

sleep's Introduction

Sleep

目前大部分功能只支持6.0及以下的设备,并且大部分需要系统权限 用于切换wifi和GPRS网络,获取电量,充电状态,控制放电,读取串口数据模版,控制系统休眠唤醒,获取当前网络信号强度,获取网络定位

1:开启关闭GPRS

这个功能需要是系统应用或者拥有系统签名才可以实现,通过NetSwitchUtils工具可查看,使用了@hide api,需要系统权限或签名。

2:连接指定wifi

可以实现关闭开启WLAN,并且连接到指定wifi,可能存在部分wifi难连接的情况,通过WifiConnectUtils工具可查看。

3:开启休眠或唤醒,获取IMe

可通过PhoneControl关闭或唤醒手机,IMEI获取也可以查看,可获取网络定位,部分手机可能会存在休眠期间间断性断网情况,但,我并没有时间研究。通过修改系统数据库实现,需要系统权限或签名。

4:获取当前网络信号强度

信号强度6.0情况下可分5个强度,通过给TelephonyManager设置PhoneStatListener监听可以获取到,详情可以从NetSignUtils和MainActivityt中查看。

4:获取电量,充电状态,控制放电

获取电量,充电状态,需要通过读取串口数据可以获取到,需要机器的厂商提供串口数据的解析方式,控制和关闭放电需要通过ndk写入数据,所以这些功能需要是定制的系统。需要系统权限或签名。

sleep's People

Contributors

wanxuedong avatar

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.