![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
android开发
文章平均质量分 54
lrch
这个作者很懒,什么都没留下…
展开
-
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 阅读 · 0 评论 -
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 · 1083 阅读 · 0 评论 -
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 · 3709 阅读 · 0 评论 -
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 · 1919 阅读 · 1 评论 -
关于android流量统计
对于android 2.2以上的API中,已有了官方统计类:TrafficStats.getMobileTxBytes(); //GPRS上行流量TrafficStats.getMobileRxBytes(); //GPRS下行流量TrafficStats.getTotalTxBytes() ; //总上行流量 含wifiTrafficStats.getTotalRxBytes原创 2012-09-01 18:11:47 · 1252 阅读 · 0 评论 -
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 · 1851 阅读 · 0 评论 -
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 阅读 · 0 评论