当前位置: 首页>>代码示例>>Java>>正文


Java AdManager类代码示例

本文整理汇总了Java中net.youmi.android.AdManager的典型用法代码示例。如果您正苦于以下问题:Java AdManager类的具体用法?Java AdManager怎么用?Java AdManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AdManager类属于net.youmi.android包,在下文中一共展示了AdManager类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPerm

import net.youmi.android.AdManager; //导入依赖的package包/类
@AfterPermissionGranted(RC_EXTERNAL_STORAGE_PHONE_STATE_PER)
private void getPerm() {
    if (!EasyPermissions.hasPermissions(this, Constants.EXTERNAL_STORAGE_PHONE_STATE_PER)) {
        // Ask for one permission
        EasyPermissions.requestPermissions(this,
                                           getString(R.string.rationale_camera),
                                           RC_EXTERNAL_STORAGE_PHONE_STATE_PER,
                                           Constants.EXTERNAL_STORAGE_PHONE_STATE_PER);
    }
    AdManager.getInstance(this)
             .init(Constants.APPID, Constants.APPSECRET, false, true);
    mBtnStartService = (Button) findViewById(R.id.maina_start_service);
    mBtnUpdate = (Button) findViewById(R.id.maina_update);
    mBtnShare = (Button) findViewById(R.id.maina_share);
    mBtnStartService.setOnClickListener(this);
    mBtnUpdate.setOnClickListener(this);
    mBtnShare.setOnClickListener(this);
}
 
开发者ID:ynztlxdeai,项目名称:MoneyPackage,代码行数:19,代码来源:MainActivity.java

示例2: onCreate

import net.youmi.android.AdManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    AdManager.getInstance(this).init("ec8c67b1a4580605","5f8f35dead09da7c",false);
    isFromWeatherActivity = getIntent().getBooleanExtra("from_weather_activity",false);
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    //第一次启动若选择过城市,并且不是从天气界面跳转回来的,则直接跳到天气界面
    if (prefs.getBoolean("city_selected",false) && !isFromWeatherActivity) {
        Intent intent = new Intent(this,WeatherActivity.class);
        startActivity(intent);
        finish();
        return;
    }
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.choose_area);
    findViews();
    kamiWeatherDB = KamiWeatherDB.getInstance(this);
    setListView();
    queryProvinces();

}
 
开发者ID:E-Kunt,项目名称:KamiWeather,代码行数:22,代码来源:ChooseAreaActivity.java

示例3: onCreate

import net.youmi.android.AdManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	AdManager.getInstance(this).init("68b1873bb6ef8cbf", "d088eb484463c693", true);
	AppConnect.getInstance(this).getPopAdView(this);

	SpotManager.getInstance(this).loadSpotAds();

	// 实例化广告条
	AdView adView = new AdView(this, AdSize.FIT_SCREEN);

	// 获取要嵌入广告条的布局
	LinearLayout adLayout=(LinearLayout)findViewById(R.id.adLayout);

	// 将广告条加入到布局中
	adLayout.addView(adView);
}
 
开发者ID:xu6148152,项目名称:binea_project_for_android,代码行数:19,代码来源:MainActivity.java

示例4: runApp

import net.youmi.android.AdManager; //导入依赖的package包/类
/**
 * 跑应用的逻辑
 */
private void runApp() {
    tvSplash = (TextView) findViewById(R.id.tvSplash);
    rotateyAnimRun(tvSplash);
    //初始化SDK
    AdManager.getInstance(this).init(appId, appSecret,false,false);
    //设置开屏
    setupSplashAd();
}
 
开发者ID:aduroidpc,项目名称:TaskNotepad,代码行数:12,代码来源:SplashActivity.java

示例5: runApp

import net.youmi.android.AdManager; //导入依赖的package包/类
/**
 * 跑应用的逻辑
 */
private void runApp() {
	//初始化SDK
	AdManager.getInstance(mContext).init("85aa56a59eac8b3d", "a14006f66f58d5d7");
	//设置开屏
	setupSplashAd();
}
 
开发者ID:minggo620,项目名称:AndroidAutoClick,代码行数:10,代码来源:SplashActivity.java

示例6: runApp

import net.youmi.android.AdManager; //导入依赖的package包/类
/**
 * 跑应用的逻辑
 */
private void runApp() {
    //初始化SDK
    AdManager.getInstance(mContext).init("d05e3439db391fcb", "aea2844b236a0eea", false, false);
    //设置开屏
    setupSplashAd();
}
 
开发者ID:MichaelLee826,项目名称:MortgageCalculator,代码行数:10,代码来源:Activity_Splash_Ad.java

示例7: onCreate

import net.youmi.android.AdManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_help);

    //有米广告:发布ID  应用密钥  测试模式  日志输出
    AdManager.getInstance(this).init("d05e3439db391fcb", "aea2844b236a0eea", false, false);

    //获取要嵌入广告条的布局
    LinearLayout bannerLayout = (LinearLayout)findViewById(R.id.help_ll_banner);

    //获取广告条
    View bannerView = BannerManager.getInstance(Activity_Help.this).getBannerView(new net.youmi.android.normal.banner.BannerViewListener() {
        @Override
        public void onRequestSuccess() {
            System.out.println("请求广告成功");
        }

        @Override
        public void onSwitchBanner() {
            System.out.println("切换广告条");
        }

        @Override
        public void onRequestFailed() {
            System.out.println("请求广告失败");
        }
    });

    //将广告条加入到布局中
    bannerLayout.addView(bannerView);
}
 
开发者ID:MichaelLee826,项目名称:MortgageCalculator,代码行数:33,代码来源:Activity_Help.java

示例8: onCreate

import net.youmi.android.AdManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);

    // 获取根节点
    RelativeLayout rlSplashRoot = (RelativeLayout) findViewById(R.id.rl_splashRoot);

    tvVersion = (TextView) findViewById(R.id.tv_version);
    // 设置splash页面的版本信息
    tvVersion.setText("版本:" + getAppVersionInfo()[0].toString());
    bar = (ProgressBar) findViewById(R.id.pb_downloadProgress);

    // 初始化数据
    initDatabases("address.db");//归属地数据库
    initDatabases("antivirus.db");//病毒数据库

    /**
     * 初始化有米广告
     */
    AdManager.getInstance(SplashActivity.this).init("4b0bce58084858e2", "834be8234147e19d", false);

    // 拿到配置文件
    prefConfig = getSharedPreferences("config", MODE_PRIVATE);
    // 根据用户是否开启了自动更新予以不同业务逻辑
    if (prefConfig.getBoolean("auto_update", true)) {
        // 检查更新
        checkUpdate();
    } else {
        // 否则就发送延迟消息,跳转home页面
        handler.sendEmptyMessageDelayed(CODE_ENTER_HOME, 2000);
    }

    // 设置splash页面的启动动画
    AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
    alphaAnimation.setDuration(2000);
    rlSplashRoot.startAnimation(alphaAnimation);
}
 
开发者ID:paifeng,项目名称:Mobile-guards,代码行数:39,代码来源:SplashActivity.java

示例9: onCreate

import net.youmi.android.AdManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.m_more);
	GridView gridview = (GridView) findViewById(R.id.gridview);
	myRenren = (MyRenren)getApplication();
	renren = ((MyRenren) getApplication()).getRenren();
	AdManager.getInstance(this).init(appid,
			appkey, true);
	// 如果使用积分广告,请务必调用积分广告的初始化接口:
	OffersManager.getInstance(this).onAppLaunch();
	PointsManager.getInstance(this).registerNotify(this);
	// 生成数据源 一个List
	ArrayList<HashMap<String, Object>> DateList = new ArrayList<HashMap<String, Object>>();
	for (int i = 0; i < 9; i++) {
		// 医用HashMap来存储
		HashMap<String, Object> hashMap = new HashMap<String, Object>();
		// 添加图像资源的ID
		hashMap.put("Image", msgIds_img[i]);
		// 按序号做ItemText
		hashMap.put("Text", getResources().getText(msgIds_title[i]));
		// 添加到List去
		DateList.add(hashMap);
	}
	// 生成适配器的simpleAdapter
	// DateList 数据源
	// R.layout.item 来自于item。xml 控制GridView中每一项的布局(一个ImageView 一个TextView)
	// 第三个参数是hashoMap的键值
	// 第四个参数是item。xml中ImageView,TextView的ID
	SimpleAdapter simpleAdapter = new SimpleAdapter(this, DateList,
			R.layout.gride_item, new String[] { "Image", "Text" },
			new int[] { R.id.ItemImage, R.id.ItemText });
	// 添加并且显示
	gridview.setAdapter(simpleAdapter);
	// 添加消息处理
	gridview.setOnItemClickListener(new ItemClickListener());
	mBanner = new OffersBanner(this, OffersAdSize.SIZE_MATCH_SCREENx60);
	RelativeLayout layoutOffersBanner = (RelativeLayout) findViewById(R.id.offersBannerLayout);
	layoutOffersBanner.addView(mBanner);
}
 
开发者ID:yulingtianxia,项目名称:ChangYou,代码行数:41,代码来源:M_MoreActivity.java

示例10: onCreate

import net.youmi.android.AdManager; //导入依赖的package包/类
protected void onCreate(Bundle paramBundle)
{
  super.onCreate(paramBundle);
  setContentView(2130903040);
  initViews();
  AdManager.getInstance(this).init("0b72edb291dc1783", "96198b6864575a0d", false);
  OffersManager.getInstance(this).onAppLaunch();
  PointsManager.getInstance(this).registerNotify(this);
  new UpdateHelper(this).execute(new Void[0]);
}
 
开发者ID:dotcool,项目名称:coolreader,代码行数:11,代码来源:MainAdsActivity.java

示例11: doInBackground

import net.youmi.android.AdManager; //导入依赖的package包/类
protected AppUpdateInfo doInBackground(Void[] paramArrayOfVoid)
{
  try
  {
    AppUpdateInfo localAppUpdateInfo = AdManager.getInstance(this.mContext).checkAppUpdate();
    return localAppUpdateInfo;
  }
  catch (Throwable localThrowable)
  {
    localThrowable.printStackTrace();
  }
  return null;
}
 
开发者ID:dotcool,项目名称:coolreader,代码行数:14,代码来源:UpdateHelper.java

示例12: init

import net.youmi.android.AdManager; //导入依赖的package包/类
public void init(){
    //有米广告:发布ID  应用密钥  测试模式  日志输出
    AdManager.getInstance(this).init("d05e3439db391fcb", "aea2844b236a0eea", false, false);

    //获取要嵌入广告条的布局
    LinearLayout bannerLayout = (LinearLayout)findViewById(R.id.ll_banner);

    //获取广告条
    View bannerView = BannerManager.getInstance(Activity_Main.this).getBannerView(new net.youmi.android.normal.banner.BannerViewListener() {
        @Override
        public void onRequestSuccess() {
            System.out.println("请求广告成功");
        }

        @Override
        public void onSwitchBanner() {
            System.out.println("切换广告条");
        }

        @Override
        public void onRequestFailed() {
            System.out.println("请求广告失败");
        }
    });

    //将广告条加入到布局中
    bannerLayout.addView(bannerView);

    //友盟统计服务
    //MobclickAgent.setDebugMode(true);                                                             //集成测试模式
    MobclickAgent.setScenarioType(Activity_Main.this, MobclickAgent.EScenarioType.E_UM_NORMAL);     //场景
    MobclickAgent.enableEncrypt(true);                                                              //加密发送数据

    //开启友盟推送服务
    PushAgent mPushAgent = PushAgent.getInstance(Activity_Main.this);
    mPushAgent.onAppStart();

    //友盟统计服务获取集成测试设备ID
    //String deviceInfo = getDeviceInfo(Activity_Main.this);
    //System.out.println(deviceInfo);

    //友盟推送服务测试模式时需要获取的device_token
    /*mPushAgent.register(new IUmengRegisterCallback() {
        @Override
        public void onSuccess(String s) {
            Log.d("device_token是:", s);
        }

        @Override
        public void onFailure(String s, String s1) {
            System.out.println("注册失败");
        }
    });*/
}
 
开发者ID:MichaelLee826,项目名称:MortgageCalculator,代码行数:55,代码来源:Activity_Main.java

示例13: onCreate

import net.youmi.android.AdManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //友盟统计服务
    //MobclickAgent.setDebugMode(true);                                                               //集成测试模式
    MobclickAgent.setScenarioType(Activity_Splash.this, MobclickAgent.EScenarioType.E_UM_NORMAL);     //场景
    MobclickAgent.enableEncrypt(true);                                                                //加密发送数据

    //开启友盟推送服务
    PushAgent mPushAgent = PushAgent.getInstance(Activity_Splash.this);
    mPushAgent.onAppStart();

    //有米广告:发布ID  应用密钥  测试模式  日志输出
    AdManager.getInstance(this).init("d05e3439db391fcb", "aea2844b236a0eea", false, true);

    // 设置全屏
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    // 移除标题栏
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    //首次启动显示欢迎页面
    setContentView(R.layout.activity_splash);

    System.out.println("启动");

    //显示版本号
    String version = "";
    TextView versionTextView = (TextView)findViewById(R.id.Splash_Version_TextView);
    PackageManager packageManager = getPackageManager();
    try {
        version = packageManager.getPackageInfo(getPackageName(), 0).versionName;
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }
    versionTextView.setText("V" + version);

    //延时2秒跳转
    new Handler().postDelayed(new Runnable(){
        public void run() {
            Intent intent = new Intent();
            intent.setClass(Activity_Splash.this, Activity_Splash_Ad.class);
            startActivity(intent);
            //overridePendingTransition(R.anim.anim_splash_fade_in, R.anim.anim_splash_fade_out);
            finish();
        }
    }, 2000);
}
 
开发者ID:MichaelLee826,项目名称:MortgageCalculator,代码行数:49,代码来源:Activity_Splash.java

示例14: onCreate

import net.youmi.android.AdManager; //导入依赖的package包/类
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //注册广播接收器
        mailReceiver = new MailReceiver();
        IntentFilter filter = new IntentFilter();
        filter.addAction("com.jimidigi.smth3k.action.APP_TWEETPUB");
        registerReceiver(mailReceiver, filter);

        appContext = (AppContext) getApplication();
        //网络连接判断
        if (!appContext.isNetworkConnected())
            UIHelper.ToastMessage(this, R.string.network_not_connected);
        //初始化登录

        appContext.initLoginInfo();


        this.initHeadView();
        this.initFootBar();
        this.initPageScroll();
        this.initFrameButton();
        this.initBadgeView();
        this.initQuickActionGrid();
        this.initFrameListView();

        //检查新版本
        if (appContext.isCheckUp()) {
            UmengUpdateAgent.setUpdateOnlyWifi(false);
            UmengUpdateAgent.update(this);
            UmengUpdateAgent.setUpdateAutoPopup(false);
//            UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
//                @Override
//                public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
//                    switch (updateStatus) {
//                        case 0: // has update
//                            UmengUpdateAgent.showUpdateDialog(Main.this, updateInfo);
//                            break;
//                        case 1: // has no update
//                            Toast.makeText(getApplicationContext(), "没有更新", Toast.LENGTH_SHORT)
//                                    .show();
//                            break;
//                        case 2: // none wifi
//                            Toast.makeText(getApplicationContext(), "没有wifi连接, 只在wifi下更新", Toast.LENGTH_SHORT)
//                                    .show();
//                            break;
//                        case 3: // time out
//                            Toast.makeText(getApplicationContext(), "超时", Toast.LENGTH_SHORT)
//                                    .show();
//                            break;
//                    }
//                }
//            });
//
//            UmengUpdateAgent.setDownloadListener(new UmengDownloadListener() {
//                @Override
//                public void OnDownloadEnd(int result) {
//                    Toast.makeText(getApplicationContext(), "下载完成 : " + result, Toast.LENGTH_SHORT).show();
//                }
//            });
        }


        AdManager.getInstance(this).init("14ab017831bb686c", "6789f4956be67a6e", false);
//        OffersManager.getInstance(this).onAppLaunch();

        //启动轮询通知信息
        this.foreachUserNotice();
    }
 
开发者ID:cobola,项目名称:smth3k,代码行数:72,代码来源:Main.java


注:本文中的net.youmi.android.AdManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。