上一页 1 2 3 4 5 6 7 8 9 ··· 82 下一页
摘要: 假设有这样一个应用场景,一个服务一直在默默的工作(比如即时地获取服务器的消息),即使在屏幕已经因为长时间无操作而关闭,或者用户按了电源键让屏幕关闭,手机进入休眠状态,他必须依然在工作中。一旦从服务器获取到消息,他能点亮屏幕,然后进行一些处理工作。 1、让服务持续运行而不受手机休眠的影响,要这样处理: 阅读全文
posted @ 2018-06-25 11:46 netcorner 阅读(7142) 评论(0) 推荐(0) 编辑
摘要: public static boolean isDebugVersion(Context context) { try { ApplicationInfo info = context.getApplicationInfo(); return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; } catc... 阅读全文
posted @ 2018-06-03 10:18 netcorner 阅读(1916) 评论(0) 推荐(0) 编辑
摘要: 无法截屏主要原因是webview渲染方式所导致;只需要AndroidManifest.xml中设置属性Android:hardwareAccelerated=”false”。 阅读全文
posted @ 2018-02-27 15:55 netcorner 阅读(2503) 评论(0) 推荐(0) 编辑
摘要: 使用了html5 页面,使用webView加载后发现 超链接的锚点不可以用 为webView设置下面两句就好了: mWebView.getSettings().setDomStorageEnabled(true);mWebView.getSettings().setDatabaseEnabled(t 阅读全文
posted @ 2018-01-05 22:58 netcorner 阅读(8276) 评论(0) 推荐(0) 编辑
摘要: 第一步:在nginx.conf中配置反向代理时把真实IP带上,例如: server { listen 80; server_name myibook.com.cn; location ~ ^/(WEB-INF)/ { deny all; } location / { proxy_pass http: 阅读全文
posted @ 2017-10-15 15:57 netcorner 阅读(1429) 评论(0) 推荐(0) 编辑
摘要: #运行用户 #user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processes 2; #全局错误日志及PID文件 error_log logs/error.log; error_log logs/error.log notice; error_log logs/error.log info; #pid logs/nginx.pid; #工作模式及... 阅读全文
posted @ 2017-08-25 09:05 netcorner 阅读(13944) 评论(1) 推荐(0) 编辑
摘要: 目前Android SDK定义的Tag有:TAG_DATETIME 时间日期TAG_FLASH 闪光灯TAG_GPS_LATITUDE 纬度TAG_GPS_LATITUDE_REF 纬度参考TAG_GPS_LONGITUDE 经度TAG_GPS_LONGITUDE_REF 经度参考TAG_IMAGE 阅读全文
posted @ 2017-08-03 15:30 netcorner 阅读(1968) 评论(0) 推荐(0) 编辑
摘要: DENSITYSIZELOCATIONRATIOSCREENMARGIN XXXHDPI 192×192 drawable-xxxhdpi 4 640 DPI 12 to 16 pixels XXHDPI 144×144 drawable-xxhdpi 3 480 DPI 8 to 12 pixel 阅读全文
posted @ 2017-08-02 14:57 netcorner 阅读(509) 评论(0) 推荐(0) 编辑
摘要: #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections ... 阅读全文
posted @ 2017-07-20 10:20 netcorner 阅读(313) 评论(0) 推荐(0) 编辑
摘要: nginx会根据预先设置的权重转发请求, 若给某一台服务器转发请求时,达到默认超时时间未响应,则再向另一台服务器转发请求。 默认超时时间1分钟。 修改默认超时时间为1s: 阅读全文
posted @ 2017-07-20 10:13 netcorner 阅读(12884) 评论(0) 推荐(2) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 82 下一页