當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。