reference:
https://blog.csdn.net/lcuwb/article/details/90705397?utm_source=distribute.pc_relevant.none-task
https://mcxiaoke.gitbooks.io/mqtt-cn/content/mqtt/01-Introduction.html?q=
其他参考:
make install 出现错误, 需要首先make html
https://blog.csdn.net/qudany10061700/article/details/86504294
https://blog.csdn.net/qq_44041062/article/details/96881953
https://blog.csdn.net/herr_kun/article/details/84146462
MQTT :
下载:
https://www.eclipse.org/paho/downloads.php
MQTT app 参考:
https://blog.csdn.net/asjqkkkk/article/details/80714234
apk :实现基本参考下面的例子:
https://www.jianshu.com/p/e1f7ce2989ff
实现方式:
打算在这里启动服务,启动bin 开机启动
external/drm_hwcomposer
Android 环境搭建:
1, jdk 安装
https://blog.csdn.net/bzlj2912009596/article/details/81507642
2, android studio 安装
https://blog.csdn.net/dimo__/article/details/86504274
其中介绍了 UTF-8 需要设定
Protocol Buffer 简介:
https://blog.csdn.net/mzpmzk/article/details/80824839
https://www.jb51.net/article/163871.htm
1, 获取SN
https://blog.csdn.net/HelloWorldRun/article/details/86091163
public static String getDeviceSN(){
String serialNumber = android.os.Build.SERIAL;
return serialNumber;
}
2, 获取frimware
public String getFirmwareVersion(){
String firmwareversion = android.os.Build.VERSION.RELEASE+android.os.Build.BRAND;
Log.d(TAG, "getFirmwareVersion: "+firmwareversion);
return firmwareversion;
}
3,获取电池level
https://developer.android.com/training/monitoring-device-state/battery-monitoring
/**
* getBatteryLevel
*/
public int getBatteryLevel() {
BatteryManager batteryManager = (BatteryManager)context.getSystemService(BATTERY_SERVICE);
int battery = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);
Log.d(TAG,"getBatteryLevel: " + battery);
return battery;
}
4, 获取充电状态
/**
* getChargingState
*/
public int getChargingState() {
BatteryManager batteryManager = (BatteryManager)context.getSystemService(BATTERY_SERVICE);
int status = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_STATUS);
Log.d(TAG,"getChargingState:UNKNOWN=1,CHARGING=2,DISCHARGING=3,NOT_CHARGING=4,FULL=5; getstatus=" + status);
return status;
}
5.获取IP 地址
/**
* getIp
*/
public long getIp() {
//获取wifi服务
WifiManager wifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
//判断wifi是否开启
if (!wifiManager.isWifiEnabled()) {
wifiManager.setWifiEnabled(true);
}
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
int ipAddress = wifiInfo.getIpAddress();
Log.d(TAG, "getIp: " + ipAddress);
return ipAddress;
}
获取当前时区:
https://blog.csdn.net/u011974987/article/details/52858085?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
public int getCurrentTimeZone() {
TimeZone tz = TimeZone.getDefault();
int offsetMinutes = (tz.getRawOffset() / 60000)/60;
Log.d(TAG, "getCurrentTimeZone: " + offsetMinutes);
return offsetMinutes;
}