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


Java SDKInitializer类代码示例

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


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

示例1: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    SDKInitializer.initialize(getApplicationContext());//在Application的onCreate()不行,必须在activity的onCreate()中
    setContentView(R.layout.activity_main);
    Log.d("gaolei", "MainActivity---------onCreate---------------");
    setStatusBar();
    initMap();
    initView();
    isServiceLive = Utils.isServiceWork(this, "com.biubike.service.RouteService");
    if (isServiceLive)
        beginService();

    FragmentManager fm = getSupportFragmentManager();
    mMenuFragment = (LeftMenuFragment) fm.findFragmentById(R.id.id_container_menu);
    mLeftDrawerLayout.setOnMenuSlideListener(this);

    if (mMenuFragment == null) {
        fm.beginTransaction().add(R.id.id_container_menu, mMenuFragment = new LeftMenuFragment()).commit();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:MainActivity.java

示例2: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    // 禁止默认的页面统计方式,这样将不会再自动统计Activity(默认页面统计只能统计Activity,不能统计Activity下面包含的Fragment)
    MobclickAgent.openActivityDurationTrack(false);

    LogUtils.getLogConfig().configAllowLog(!IS_RELEASE_VERSION)  // Log日志开关
            .configTagPrefix(getPackageName())  //设置Log日志Tag前缀:用包名
            .configShowBorders(true)
            .configLevel(LogLevel.TYPE_VERBOSE);

    if (IS_RELEASE_VERSION) {
        MobclickAgent.setDebugMode(false); // 友盟统计SDK,集成测试开关
    } else {
        MobclickAgent.setDebugMode(true);
    }

    initImageLoader(this); // 初始化ImageLoader
    SDKInitializer.initialize(this); // 初始化百度地图-注意:在SDK各功能组件使用之前都需要调用,因此我们建议该方法放在Application的初始化方法中
}
 
开发者ID:jpaijh,项目名称:TYT,代码行数:21,代码来源:MyApplication.java

示例3: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    SDKInitializer.initialize(getApplicationContext());
    setContentView(R.layout.activity_running);
    //acquireWakeLock();
    initView();
    initSettings();
    checkGPS();
    initMapLocation();

    startButton.setOnClickListener(v -> {
        if (runningStatus == 0) {
            startRunning();
        } else if (runningStatus == 1) {
            new AlertDialog.Builder(RunningActivity.this)
                    .setTitle("结束跑步")
                    .setMessage("你确定要结束跑步吗?")
                    .setPositiveButton("确定", (dialog, which) -> stopRunning())
                    .setNegativeButton("取消", null).create().show();
        }
    });

}
 
开发者ID:SailFlorve,项目名称:RunHDU,代码行数:25,代码来源:RunningActivity.java

示例4: onReceive

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
public void onReceive(Context context, Intent intent) {
	String s = intent.getAction();
	String st1 = getResources().getString(R.string.Network_error);
	if (s.equals(SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_ERROR)) {
		
		String st2 = getResources().getString(R.string.please_check);
		Toast.makeText(instance, st2, Toast.LENGTH_SHORT).show();
	} else if (s.equals(SDKInitializer.SDK_BROADCAST_ACTION_STRING_NETWORK_ERROR)) {
		Toast.makeText(instance, st1, Toast.LENGTH_SHORT).show();
	}
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:12,代码来源:EaseBaiduMapActivity.java

示例5: init

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
private void init() {
    OSCSharedPreference.init(this, "osc_update_sp");
    // 初始化异常捕获类
    AppCrashHandler.getInstance().init(this);
    // 初始化账户基础信息
    AccountHelper.init(this);
    // 初始化网络请求
    ApiHttpClient.init(this);
    //初始化百度地图
    SDKInitializer.initialize(this);
    DBManager.init(this);

    if (OSCSharedPreference.getInstance().hasShowUpdate()) {//如果已经更新过
        //如果版本大于更新过的版本,就设置弹出更新
        if (BuildConfig.VERSION_CODE > OSCSharedPreference.getInstance().getUpdateVersion()) {
            OSCSharedPreference.getInstance().putShowUpdate(true);
        }
    }
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:20,代码来源:OSCApplication.java

示例6: init

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
public static void init(Context context) {
    //百度地图初始化
    SDKInitializer.initialize(context.getApplicationContext());

    // 定位初始化
    mLocClient = new LocationClient(context.getApplicationContext());
    mLocClient.registerLocationListener(myListener);
    LocationClientOption option = new LocationClientOption();
    option.setOpenGps(true); // 打开gps
    option.setCoorType("bd09ll"); // 设置坐标类型
    option.setScanSpan(1000);
    option.setIsNeedAddress(true);//可选,设置是否需要地址信息,默认不需要
    option.setIsNeedLocationDescribe(true);//可选,默认false,设置是否需要位置语义化结果,可以在BDLocation.getLocationDescribe里得到,结果类似于“在北京天安门附近”
    option.setIsNeedLocationPoiList(true);//可选,默认false,设置是否需要POI结果,可以在BDLocation.getPoiList里得到
    mLocClient.setLocOption(option);;
    haveInited=true;
}
 
开发者ID:cn-huangzhou,项目名称:BDLocationUtil,代码行数:18,代码来源:LocationUtil.java

示例7: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //初始化百度地图SDK
    SDKInitializer.initialize(getApplicationContext());
    setContentView(R.layout.cp_activity_city_list);
    StatusBarCompat.setStatusBarColor(this,getResources().getColor(R.color.white));
    //隐藏actionBar
    ActionBar actionBar = getSupportActionBar();
    if(actionBar != null){
        actionBar.hide();
    }
    initData();
    initView();
    //声明LocationClient类
    mLocationClient = new LocationClient(getApplicationContext());
    //注册监听函数
    mLocationClient.registerLocationListener(myListener);
    initLocation();

}
 
开发者ID:organizationAllink,项目名称:wzyx-android-user,代码行数:22,代码来源:CityPickerActivity.java

示例8: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    mContext = getApplicationContext();

    //初始化 Bugly
    CrashReport.initCrashReport(getApplicationContext(), StaticClass.BUGLY_APP_ID, true);

    //初始化 Bmob
    Bmob.initialize(this, StaticClass.BMOB_APP_ID);

    //初始化语音识别
    SpeechUtility.createUtility(getApplicationContext(), SpeechConstant.APPID + "=" +
            StaticClass.VOICE_KEY);

    //初始化百度地图
    SDKInitializer.initialize(getApplicationContext());

    //初始化litepal
    LitePalApplication.initialize(getApplicationContext());
}
 
开发者ID:Hultron,项目名称:LifeHelper,代码行数:23,代码来源:BaseApplication.java

示例9: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
    public void onCreate() {
        MultiDex.install(this);
        super.onCreate();
        instance = this;
        aCache = ACache.get(this);
        DemoHelper.getInstance().init(this);
        SDKInitializer.initialize(this);
        EMClient.getInstance().init(this, initChatOptions());
        EMClient.getInstance().setDebugMode(true);
        initRedPacket();
//        F.setLog(false);
//        //崩溃处理
        CrashHandlerUtil crashHandlerUtil = CrashHandlerUtil.getInstance();
        crashHandlerUtil.init(this);
        crashHandlerUtil.setCrashTip("很抱歉,程序出现异常,即将退出!");
        Config.DEBUG = true;
        initUM();
        QueuedWork.isUseThreadPool = false;
        UMShareAPI.get(this);
    }
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:22,代码来源:GApplication.java

示例10: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    CrashReport.initCrashReport(getApplicationContext(), "e1a62089c6", false);
    ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
            .setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
            .build();
    Fresco.initialize(this, config);
    SDKInitializer.initialize(this);
    Bmob.initialize(this, "b0cb494256d9b86fc931ca930a055b75");
    Logger.addLogAdapter(new AndroidLogAdapter(){
        @Override
        public boolean isLoggable(int priority, String tag) {
            return true;// TODO: 2017/6/5
        }
    });
    sInstance = this;
    initUser();
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:20,代码来源:MyApplication.java

示例11: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    SDKInitializer.initialize(getApplicationContext());//必须放在这里
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);
    myUser = MyApplication.getInstance().getUser();
    if (myUser != null)
        isNeedLogin = false;
    else {
        isNeedLogin = true;
    }
    Log.d(TAG, "initData: " + isNeedLogin);

    initMap();
    requesPemission();
    initViews();
    isServiceLive = Utils.isServiceWork(this, "com.yiwen.mobike.service.RouteService");
    if (isServiceLive)
        beginService();

    initData();

    initEvent();

}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:27,代码来源:MainActivity.java

示例12: onReceive

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
public void onReceive(Context context, Intent intent) {
    String s = intent.getAction();
    System.out.println(TAG + ":action: " + s);
    switch (s) {
        case SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_ERROR:
            System.out.println("key 验证出错! 请在 AndroidManifest.xml 文件中检查 key 设置");
            isOk = false;
            break;
        case SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_OK:
            System.out.println("key 验证成功! 功能可以正常使用");
            isOk = true;
            break;
        case SDKInitializer.SDK_BROADCAST_ACTION_STRING_NETWORK_ERROR:
            System.out.println("网络出错");
            isOk = false;
            break;
    }
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:19,代码来源:MainActivity.java

示例13: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);
    // 注册 SDK 广播监听者
    IntentFilter iFilter = new IntentFilter();
    iFilter.addAction(SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_OK);
    iFilter.addAction(SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_ERROR);
    iFilter.addAction(SDKInitializer.SDK_BROADCAST_ACTION_STRING_NETWORK_ERROR);
    mReceiver = new SDKReceiver();
    registerReceiver(mReceiver, iFilter);
    mLocationClient = new LocationClient(getApplicationContext());
    mLocationClient.registerLocationListener(this);
    initLocation();
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:17,代码来源:MainActivity.java

示例14: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	requestWindowFeature(Window.FEATURE_NO_TITLE);
	// ��ʹ��SDK�����֮ǰ��ʼ��context��Ϣ������ApplicationContext
	SDKInitializer.initialize(getApplicationContext());

	setContentView(R.layout.activity_trans_online);

	// ��ȡ�ؼ�
	initViews();

	// ���ü�����
	setListeners();
}
 
开发者ID:ContentCoderJian,项目名称:SmartTransXA,代码行数:17,代码来源:TransferOnlineActivity.java

示例15: onCreate

import com.baidu.mapapi.SDKInitializer; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	requestWindowFeature(Window.FEATURE_NO_TITLE);

	// ��ʹ��SDK�����֮ǰ��ʼ��context��Ϣ������ApplicationContext
	SDKInitializer.initialize(getApplicationContext());

	setContentView(R.layout.activity_busline_online);

	// ��ȡ�ؼ�
	initViews();

	// ���ü�����
	setListeners();
}
 
开发者ID:ContentCoderJian,项目名称:SmartTransXA,代码行数:17,代码来源:BusLineOnlineActivity.java


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