application

来源:互联网 发布:java文件断点续传 编辑:程序博客网 时间:2024/06/06 03:12


    private void initimageloader() {
        ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(
                this).build();
        ImageLoader.getInstance().init(configuration);
    }




    private void initpush() {
        Resources resource = this.getResources();
            String pkgName = this.getPackageName();
            
            
            Utils.logStringCache = Utils.getLogText(getApplicationContext());
            PushManager.startWork(getApplicationContext(), PushConstants.LOGIN_TYPE_API_KEY,
                    Utils.getMetaValue(this, "api_key"));
            // Push: 如果想基于地理位置推送,可以打开支持地理位置的推送的开关
            // PushManager.enableLbs(getApplicationContext());

            // Push: 设置自定义的通知样式,具体API介绍见用户手册,如果想使用系统默认的可以不加这段代码
            // 请在通知推送界面中,高级设置->通知栏样式->自定义样式,选中并且填写值:1,
            // 与下方代码中 PushManager.setNotificationBuilder(this, 1, cBuilder)中的第二个参数对应
            CustomPushNotificationBuilder cBuilder = new CustomPushNotificationBuilder(
                    resource.getIdentifier(
                            "notification_custom_builder", "layout", pkgName),
                    resource.getIdentifier("notification_icon", "id", pkgName),
                    resource.getIdentifier("notification_title", "id", pkgName),
                    resource.getIdentifier("notification_text", "id", pkgName));
            cBuilder.setNotificationFlags(Notification.FLAG_AUTO_CANCEL);
            cBuilder.setNotificationDefaults(Notification.DEFAULT_VIBRATE);
            cBuilder.setStatusbarIcon(this.getApplicationInfo().icon);
            cBuilder.setLayoutDrawable(resource.getIdentifier(
                    "simple_notification_icon", "drawable", pkgName));
            cBuilder.setNotificationSound(Uri.withAppendedPath(
                    Audio.Media.INTERNAL_CONTENT_URI, "6").toString());
            // 推送高级设置,通知栏样式设置为下面的ID
            PushManager.setNotificationBuilder(this, 1, cBuilder);
    };
 
    
    

    private void initUM() {
        PlatformConfig.setWeixin("wx967daebe835fbeac",
                "5bb696d9ccd75a38c8a0bfe0675559b3");
        // 微信 appid appsecret
        PlatformConfig.setSinaWeibo("3921700954",
                "04b48b094faeb16683c32669824ebdad");
        // 新浪微博 appkey appsecret
        PlatformConfig.setQQZone("100424468",
                "c7394704798a158208a74ab60104f0ba");
        // QQ和Qzone appid appkey
        PlatformConfig.setAlipay("2015111700822536");
        // 支付宝 appid
        PlatformConfig.setYixin("yxc0614e80c9304c11b0391514d09f13bf");
        // 易信 appkey
        PlatformConfig.setTwitter("3aIN7fuF685MuZ7jtXkQxalyi",
                "MK6FEYG63eWcpDFgRYw4w9puJhzDl0tyuqWjZ3M7XJuuG7mMbO");
        // Twitter appid appkey
        PlatformConfig.setPinterest("1439206");
        // Pinterest appid
        PlatformConfig.setLaiwang("laiwangd497e70d4",
                "d497e70d4c3e4efeab1381476bac4c5e");
        // 来往 appid appkey

    }
0 0