1. 取得手机屏幕大小
DisplayMetrics dm = new DisplayMetrics();
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);//dm.widthPixels和dm.heightPixels
2. 手机端获取apk文件的包名
PackageInfo pkgInfo = context.getPackageManager().getPackageArchiveInfo(strFilePath, 0);
String strPackageName = pkgInfo.packageName;//即为apk文件(目录为strFilePath)的包名(package name)
3. 使用Drawable.Draw时注意事项
Drawable drawable = getContext().getResources().getDrawable(R.drawable.bg);
//下面该行必不可少(当然类似的设定区域的也可以),否则绘制不上去(空白),也许默认的绘图区域是Rect(0, 0, 0, 0)
drawable.setBounds(new Rect(0, 0, getWidth(), getHeight()));
drawable.draw(m_canvas);