最近在用android sqlite数据库时,有这么一个需求,就是希望通过一条insert语句同时插入多条记录(记录数>>1000)
在网上搜索得知,mysql中提供类似
INSERT INTO TABLE(col1, col2) VALUES(val11, val12), (v[……]
Read more
问题:windows下运行sdkManager.exe总是提示:
Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xml Failed to fetch URL https://dl-ssl.google.[……]
Read more
找到一个可以把log保存下来的方法,这样如果不接USB线时操作手机发生问题就能看见log了,简单实验可行
1. 连接USB
2. 执行adb shell登到手机
3. logcat -v time -f /sdcard/locker.log *:W &
然后就可以拔掉USB线[……]
Read more
打电话:
1
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "13333333333"));
获取本机号码:
12345
TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);String deviceid = tm.getDeviceId();String tel = tm.getLine1Number(); //本机号码String imei =tm.getSimSerialNumber();String imsi =tm.getSubscriberId ......
When I used BufferedInputStream and I specify a buffer size, Dalvik gives me this warning – Default buffer size used in BufferedInputStream constructo[……]
Read more
1234567891011121314
/*** 判断服务是否正在运行* @return*/public boolean isServiceWorked() { ActivityManager myManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ArrayList runningService = (ArrayList) myManager.getRunningServices(Integer.MAX_VALUE); for (int i = 0; i < runningService.size(); i++) { &n ......
在Android系统中进行网络开发时,如果使用了java.nio等相关包后有可能碰到异常java.net.SocketException: Bad address family。原因是Android2.2bug不能启用IPV6协议,具体可点击http://code.google.com/p/andr[……]
Read more
思考着用后台service来弹出对话框,于是在网上搜到了这样的一种方法:
1234567891011121314151617181920212223242526272829
View view = View.inflate(StatusBarService.this, R.layout.power_off_dialog, null);AlertDialog.Builder b = new AlertDialog.Builder(StatusBarService.this);b.setView(view);final AlertDialog d = b.create();d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG); //系统中关机对话框就是这个属性//d.getWindow().s ......