02 2012 档案
摘要:<?php $file_name = $_GET['file'] . ".apk"; $file_dir = $_SERVER['DOCUMENT_ROOT'] . "\\"; if(!file_exists($file_dir . $file_name)) { echo "file is not exists"; } else { $file = fopen($file_dir . $file_name, "r"); header("Con...
阅读全文
摘要:一、相关概念1、Drawable就是一个可画的对象,其可能是一张位图(BitmapDrawable),也可能是一个图形(ShapeDrawable),还有可能是一个图层(LayerDrawable),我们根据画图的需求,创建相应的可画对象2、Canvas画布,绘图的目的区域,用于绘图3、Bitmap位图,用于图的处理4、Matrix矩阵二、Bitmap1、从资源中获取Bitmap1 Resources res = getResources();2 Bitmap bmp = BitmapFactory.decodeResource(res, R.drawable.icon);2、...
阅读全文
摘要:一,android安装已经下载好的apk文件Uri uri = Uri.fromFile(updateFile); //获取文件的UriIntent installIntent = new Intent(Intent.ACTION_VIEW);installIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);installIntent.setDataAndType(uri, "application/vnd.android.package-archive");//设置intent的数据类型startActivity(insta...
阅读全文
摘要:一,获取手机屏幕分辨率:DisplayMetrics dm = new DisplayMetrics();this.getWindowManager().getDefaultDisplay().getMetrics(dm);int width = dm.widthPixels;//屏幕宽度int height = dm.heightPixels;//屏幕高度二,setRequestedOrientation 设置屏幕方向setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//通过程序改变屏幕显示的方向1.land
阅读全文
摘要:今天更新新版android SDK,发现对xml配置文件中各个控件属性设置更加严谨了,以前在strings.xml里配置的带有 %s,%f 等变量格式的符号要求更加成%1$s,%1$f这样的符号来代替,其中%1表示第一个位置的变量, $s表示为字符串类。
阅读全文
浙公网安备 33010602011771号