- 博客(7)
- 收藏
- 关注
原创 android 实现下拉菜单
android4.0系统开始添加了actionbar的控件,可以添加下拉菜单(非弹出框) 但是2.X系统中只能通过其他方式实现——popwindow View popView = getLayoutInflater().inflate(R.layout.trafficrank_pop_list, null, false); //获取popwindow的布局 li
2012-09-10 15:12:04
889
原创 关于android流量统计
对于android 2.2以上的API中,已有了官方统计类:TrafficStats.getMobileTxBytes(); //GPRS上行流量TrafficStats.getMobileRxBytes(); //GPRS下行流量TrafficStats.getTotalTxBytes() ; //总上行流量 含wifiTrafficStats.getTotalRxBytes
2012-09-01 18:11:47
1250
原创 android 获取应用证书及签名信息
private String[] getCertMsg(String packageName){String[] certMsg = new String[2];PackageInfo pis;try {pis = mContext.getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATUR
2012-09-01 18:00:26
1849
原创 android 通过iptables设置网络防火墙
iptables 网络防火墙 以下代码只针对gprs进行禁止访问#!/system/bin/sh查找合适的iptables文件: IPTABLES=iptables BUSYBOX=busybox GREP=grep ECHO=echo # Try to find busybox if /data/data/com.***.activity/app_bin/busybox_g1 --
2012-09-01 17:54:43
1917
1
原创 android 通过iptables设置代理(ROOT权限)
通过iptables设置相应的规则 将访问数据端口重定向iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123iptables -t nat -A OUTPUT -p tcp --dport 443 -j REDIRECT --to-ports 8123
2012-09-01 17:35:06
3695
原创 android 执行shell命令代码
android 执行shell命令方法可执行su、sh命令 只需传入需要执行的命令即可进行执行如:执行安装apk包命令:new ShellCommand().sh.runWaitFor("pm install -r " + /.../apkName.apk)import java.io.DataInputStream;import java.io.DataOu
2012-09-01 17:30:42
1080
原创 android应用程序安装后自动打开
GetBroadcast.registerReceiver(getApplicationContext());//注册广播,用于监听应用是否安装完成//安装apkIntent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(new File(fileURL)),"applicati
2011-10-24 10:25:35
3495
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人