自定义插件 Error initializing Cordova: Class not found
一般情况是缺失配置,在config.xml
platformsandroidappsrcmainresxmlconfig.xml中
需要有下面的配置,补充自定义插件的内容
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
一般情况是缺失配置,在config.xml
platformsandroidappsrcmainresxmlconfig.xml中
需要有下面的配置,补充自定义插件的内容
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
以Chrome浏览器为例,实际上chrome内核都可以。
1.用Cordova 打包一个debug版的App(注意是debug版本的哦)
2.用USB线连接手机和电脑(电脑必须安装有手机驱动和Chrome浏览器)
3.打开手机的USB调试开关(找不到的百度自己的机型查找)
4.打开电脑上Chrome在地址栏输入"chrome://inspect"进入,如图
5.打开手机上的Cordova App,浏览器出现手机相关页面信息,点击进入
6.这样就可方便的调试
java.lang.SecurityException: getDeviceId: Neither user 10065 nor current process has android.permission.READ_PHONE_STATE.
原因:动态权限的问题
Android 6.0 (API Level 23) 及以后引入了运行时权限,安装 APP 时不再授予所有需要的权限,而是在运行的时候根据需要向用户请求权限,而且用户可以随时取消已经授予的权限。
GitHub 上有个对开源库 https://github.com/googlesamples/easypermissions 进行二次封装的开源库 https://github.com/forJrking/HeiPermission 还不错,可以尝试下。
参考链接:
http://blog.csdn.net/github_33304260/article/details/53328297
https://developer.android.com/training/permissions/requesting.html
select ltrim(Convert(numeric(9,2),25*100.0/30))+'%' As 百分比
- 得到百分比小数
select Cast(Convert(numeric(9,2),25*100.0/30) as decimal(18,2)) As 百分比小数
NUMERIC(P,S) P的默认值是:38 S的默认值是:-84~127
numeric(a,b)函数有两个参数,前面一个为总的位数,后面一个参数是小数点后的位数,例如numeric(5,2)是总位数为5,小数点后为2位的数,也就是说这个字段的整数位最大是3位。
List<Integer> numbers = Arrays.asList(1,2,3,4,5,6,7,8,9,10);
int chunkSize = 20; //3 ok
AtomicInteger counter = new AtomicInteger();
Collection<List<Integer>> resultList = numbers.stream()
.collect(Collectors.groupingBy(it -> counter.getAndIncrement() / chunkSize))
.values();
System.out.println(resultList);
举例说明:
Check out Lists.partition(java.util.List, int) from Google Guava:
Returns consecutive sublists of a list, each of the same size (the final list may be smaller). For example, partitioning a list containing [a, b, c, d, e] with a partition size of 3 yields [[a, b, c], [d, e]] -- an outer list containing two inner lists of three and two elements, all in the original order.