ANDROID新特性
apk安装
StrictMode API政策
1 2 3 4 5 6 7 8
| <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.fileProvider" // com.cqian是包名 android:grantUriPermissions="true" android:exported="false"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_install"/> </provider>
|
1 2 3 4 5 6 7 8 9 10
| <files-path name="name" path="path" /> 物理路径相当于Context.getFilesDir() + /path/ <cache-path name="name" path="path" /> 物理路径相当于Context.getCacheDir() + /path/ <external-path name="name" path="path" /> 物理路径相当于Environment.getExternalStorageDirectory() + /path/ <external-files-path name="name" path="path" /> 物理路径相当于Context.getExternalFilesDir(String) + /path/ <external-cache-path name="name" path="path" /> 物理路径相当于Context.getExternalCacheDir() + /path/
|
由于我的存储目录用这个,apkCacheFile是SDk卡上得目录名称
String downFile = context.getExternalCacheDir() + "apkCacheFile"
1 2 3
| <external-cache-path name="name" path="apkCacheFile" />
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| private static void installApk(Context context, File apkFile) { Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setAction(Intent.ACTION_VIEW); String type = "application/vnd.android.package-archive";
Uri uri; if (Build.VERSION.SDK_INT >= 24) { uri = FileProvider.getUriForFile(context, "getPackageName().fileProvider", apkFile); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); } else { uri = Uri.fromFile(apkFile); } intent.setDataAndType(uri, type); context.startActivity(intent); }
|
https://developer.android.google.cn/about/versions/nougat/android-7.0-changes.html
http://blog.csdn.net/github_2011/article/details/74297460
图片拍照
Android P veridex工具使用
win10安装ubuntu
https://www.linuxidc.com/Linux/2018-03/151256.htm
对test.apk进行扫描
./appcompat.sh –dex-file=test.apk
android 11适配
https://juejin.im/post/6860370635664261128
android12适配
Splash
https://www.youtube.com/watch?v=8F0lK2i3VJk
https://developer.android.com/develop/ui/views/launch/splash-screen#elements