Android开发 build.gradle的使用记录

时间:2021-06-02 14:11:15   收藏:0   阅读:0

将打包apk重命名

android {
    
    //命令打包apk重命名
    android.applicationVariants.all { variant ->
        variant.outputs.all {
            outputFileName = "YT-${variant.name}-${variant.versionName}.apk"
        }
    }
}

manifestPlaceholders妙用

https://www.cnblogs.com/zhaohongtian/p/6808962.html 参考

       String jpush_appkey;
        try {
            ApplicationInfo appInfo = getPackageManager()
                    .getApplicationInfo(getPackageName(),
                            PackageManager.GET_META_DATA);

            jpush_appkey = appInfo.metaData.getString("JPUSH_APPKEY");

            Logger.d("jpush_appkey=" + jpush_appkey);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();

        }

 

 

end

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!