• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MapboxAccountManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onCreate

import com.mapbox.mapboxsdk.MapboxAccountManager; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    MapboxAccountManager.start(this, getString(R.string.PUBLIC_TOKEN));
    Stetho.initializeWithDefaults(this);

}
 
开发者ID:opticod,项目名称:Moto-Navigator,代码行数:8,代码来源:MotoApplication.java


示例2: onCreate

import com.mapbox.mapboxsdk.MapboxAccountManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    MapboxAccountManager.start(this, getString(R.string.access_token));
    setContentView(R.layout.activity_main);

    locationServices = LocationServices.getLocationServices(MainActivity.this);

    mapView = (MapView) findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(MapboxMap mapboxMap) {
            map = mapboxMap;

            // Check if user has granted location permission. If they haven't, we request it
            // otherwise we enable location tracking.
            if (!locationServices.areLocationPermissionsGranted()) {
                ActivityCompat.requestPermissions(MainActivity.this, new String[]{
                        Manifest.permission.ACCESS_COARSE_LOCATION,
                        Manifest.permission.ACCESS_FINE_LOCATION}, PERMISSIONS_LOCATION);
            } else {
                enableLocationTracking();
            }
        }
    });

    imageButton = (ImageButton) findViewById(R.id.btnPokeball);
    imageButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            new AlertDialog.Builder(MainActivity.this)
                    .setTitle("MONSTER CAUGHT!")
                    .setPositiveButton("OK", null)
                    .show();
        }
    });
}
 
开发者ID:jingsam,项目名称:mapbox-go,代码行数:39,代码来源:MainActivity.java


示例3: onCreate

import com.mapbox.mapboxsdk.MapboxAccountManager; //导入依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MapboxAccountManager.start(this, getString(R.string.access_token));
        setContentView(R.layout.activity_main);

        // Create a mapView
        mapView = (MapView) findViewById(R.id.mapview);
        mapView.onCreate(savedInstanceState);

        // Add a MapboxMap
        mapView.getMapAsync(new OnMapReadyCallback() {
            @Override
            public void onMapReady(MapboxMap mapboxMap) {

                // Customize map with markers, polylines, etc.

                // Local Style JSON in the Android `assets` folder
//                mapboxMap.setStyleUrl("asset://mapbox-raster-v8.json");
                 mapboxMap.setStyleUrl("asset://styles/geography-class-local.json");

                // Style JSON hosted on a server
//                mapboxMap.setStyleUrl("https://www.mapbox.com/android-sdk/files/mapbox-raster-v8.json");

                // Examples of built in Mapbox Styles
//                mapboxMap.setStyleUrl(Style.MAPBOX_STREETS);
//                mapboxMap.setStyleUrl(Style.OUTDOORS);
//                mapboxMap.setStyleUrl(Style.LIGHT);
//                mapboxMap.setStyleUrl(Style.DARK);

            }
        });
    }
 
开发者ID:roblabs,项目名称:osm2vectortiles-android,代码行数:34,代码来源:MainActivity.java


示例4: onCreate

import com.mapbox.mapboxsdk.MapboxAccountManager; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    MapboxAccountManager.start(this, getString(R.string.PUBLIC_TOKEN));

}
 
开发者ID:opticod,项目名称:Moto-Navigator,代码行数:7,代码来源:MotoApplication.java


示例5: onCreateView

import com.mapbox.mapboxsdk.MapboxAccountManager; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    MapboxAccountManager.start(getActivity(), "pk.eyJ1IjoibWV0aW5rYWxlMzgiLCJhIjoiY2lyaHF1dW1uMDAzemlnbmtlN3plbXN3ZiJ9.t2c0KnfotdunLL--tj0NCA");
    return inflater.inflate(R.layout.compass_map, container, false);
}
 
开发者ID:metinkale38,项目名称:prayer-times-android,代码行数:7,代码来源:FragMap.java


示例6: onCreate

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

    // Mapbox access token only needs to be configured once in the app
    MapboxAccountManager.start(this, this.getString(R.string.keychain_mapbox_access_token));

    // Set Content View
    // This contains the MapView in XML and needs to be called after the account manager
    setContentView(R.layout.sg_activity_map);

    // Bind Views
    ButterKnife.bind(this);

    // Check if GPS is enabled and if not send user to the GSP settings
    // TODO Better solution would be to display a dialog and suggesting to go to the settings
    LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);
    boolean enabledGPS = service.isProviderEnabled(LocationManager.GPS_PROVIDER);
    if (!enabledGPS) {
        Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
        startActivity(intent);
    }

    // Create an instance of GoogleAPIClient.
    if (mGoogleApiClient == null) {
        mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(this)
                .addOnConnectionFailedListener(this)
                .addApi(LocationServices.API)
                .build();
    }

    // Initializing MapView
    try {
        this.mMapViewMain = (MapView) findViewById(R.id.mapviewMain);
        this.mMapViewMain.onCreate(savedInstanceState);
        this.mMapViewMain.getMapAsync(new OnMapReadyCallback() {

            @Override
            public void onMapReady(MapboxMap mapboxMap) {
                mMap = mapboxMap;

                // Customize map with markers, polylines, etc.
                // TODO disable scrolling
            }
        });

    } catch (Exception e) {
        Log.e(this.getClass().getSimpleName(), e.getMessage());
    }



    // Save the resolving error boolean if present
    mResolvingError = savedInstanceState != null
            && savedInstanceState.getBoolean(STATE_RESOLVING_ERROR, false);

    // Save the resolving settings boolean if present
    mResolvingSettings = savedInstanceState != null
            && savedInstanceState.getBoolean(STATE_CHECKING_SETTINGS, false);

    // Update location data
    this.updateValuesFromBundle(savedInstanceState);

}
 
开发者ID:jtklein,项目名称:2016GBIFchallenge,代码行数:66,代码来源:SgActivityMap.java


示例7: onCreate

import com.mapbox.mapboxsdk.MapboxAccountManager; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
    }
    Fabric.with(this, new Crashlytics());

    // Init Stetho for debug purpose (database)
    Stetho.initializeWithDefaults(this);

    // Init Dagger
    osmTemplateComponent = DaggerOsmTemplateComponent.builder().osmTemplateModule(new OsmTemplateModule(this)).build();
    osmTemplateComponent.inject(this);

    // Init Flickr object
    StoreConfigManager configManager = new StoreConfigManager();
    flickr = new Flickr(configManager.getFlickrApiKey(), configManager.getFlickrApiKeySecret(), new REST());

    // Cache Disk for Fresco
    DiskCacheConfig diskCacheConfig = DiskCacheConfig.newBuilder(this)
            .setBaseDirectoryPath(new File(Environment.getExternalStorageDirectory().getAbsoluteFile(), getPackageName()))
            .setBaseDirectoryName("images")
            .build();
    // Cache Memory for Fresco
    ImagePipelineConfig imagePipelineConfig = ImagePipelineConfig.newBuilder(this)
            .setBitmapMemoryCacheParamsSupplier(new Supplier<MemoryCacheParams>() {
                @Override
                public MemoryCacheParams get() {
                    return new MemoryCacheParams(10485760, 100, 100, 100, 100);
                }
            })
            .setMainDiskCacheConfig(diskCacheConfig)
            .build();

    // Init Fresco
    Fresco.initialize(this, imagePipelineConfig);

    // Init event bus
    EventBus bus = osmTemplateComponent.getEventBus();
    bus.register(getOsmTemplateComponent().getLoginManager());
    bus.register(getOsmTemplateComponent().getEditPoiManager());
    bus.register(getOsmTemplateComponent().getPoiManager());
    bus.register(getOsmTemplateComponent().getNoteManager());
    bus.register(getOsmTemplateComponent().getSyncManager());
    bus.register(getOsmTemplateComponent().getTypeManager());
    bus.register(getOsmTemplateComponent().getPresetsManager());
    bus.register(getOsmTemplateComponent().getGeocoder());
    bus.register(getOsmTemplateComponent().getEditVectorialWayManager());

    SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
    if (!PreferenceManager.getDefaultSharedPreferences(this).getBoolean(getString(R.string.shared_prefs_preset_default), false)) {
        editor.putBoolean(getString(R.string.shared_prefs_preset_default), true);
    }
    editor.apply();

    MapboxAccountManager.start(this, BuildConfig.MAPBOX_TOKEN);
}
 
开发者ID:jawg,项目名称:osm-contributor,代码行数:59,代码来源:OsmTemplateApplication.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Controller类代码示例发布时间:2022-05-22
下一篇:
Java SelectionTool类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap