资源简介

android百度地图语音导航demo 集成模拟导航 和实时导航

资源截图

代码片段和文件信息

package com.baidu.navi.sdkdemo;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.view.View;

import com.baidu.navisdk.BNaviModuleManager;
import com.baidu.navisdk.BaiduNaviManager;
import com.baidu.navisdk.comapi.mapcontrol.BNMapController;
import com.baidu.navisdk.comapi.routeplan.BNRoutePlaner;
import com.baidu.navisdk.comapi.tts.BNTTSPlayer;
import com.baidu.navisdk.comapi.tts.BNavigatorTTSPlayer;
import com.baidu.navisdk.comapi.tts.IBNTTSPlayerListener;
import com.baidu.navisdk.model.datastruct.LocData;
import com.baidu.navisdk.model.datastruct.SensorData;
import com.baidu.navisdk.ui.routeguide.BNavigator;
import com.baidu.navisdk.ui.routeguide.IBNavigatorListener;
import com.baidu.navisdk.ui.widget.RoutePlanObserver;
import com.baidu.navisdk.ui.widget.RoutePlanObserver.IJumpToDownloadListener;
import com.baidu.nplatform.comapi.map.MapGLSurfaceView;

public class BNavigatorActivity extends Activity{

public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
//创建NmapView
if (Build.VERSION.SDK_INT < 14) {
            BaiduNaviManager.getInstance().destroyNMapView();
        }
MapGLSurfaceView nMapView = BaiduNaviManager.getInstance().createNMapView(this);

//创建导航视图
View navigatorView = BNavigator.getInstance().init(BNavigatorActivity.this getIntent().getExtras() nMapView);

//填充视图
setContentView(navigatorView);
BNavigator.getInstance().setListener(mBNavigatorListener);
BNavigator.getInstance().startNav();

// 初始化TTS. 开发者也可以使用独立TTS模块,不用使用导航SDK提供的TTS
BNTTSPlayer.initPlayer();
//设置TTS播放回调
BNavigatorTTSPlayer.setTTSPlayerListener(new IBNTTSPlayerListener() {
            
            @Override
            public int playTTSText(String arg0 int arg1) {
             //开发者可以使用其他TTS的API
                return BNTTSPlayer.playTTSText(arg0 arg1);
            }
            
            @Override
            public void phoneHangUp() {
                //手机挂断
            }
            
            @Override
            public void phoneCalling() {
                //通话中
            }
            
            @Override
            public int getTTSState() {
             //开发者可以使用其他TTS的API
                return BNTTSPlayer.getTTSState();
            }
        });

BNRoutePlaner.getInstance().setObserver(new RoutePlanObserver(this new IJumpToDownloadListener() {

@Override
public void onJumpToDownloadOfflineData() {
// TODO Auto-generated method stub

}
}));

}

private IBNavigatorListener mBNavigatorListener = new IBNavigatorListener() {
        
        @Override
        public void onYawingRequestSuccess() {
            // TODO 偏航请求成功
            
        }
        
        @Override
        public void onYawingRequestStart() {
            // TODO 开始偏航请求
            
        }
       

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-06-11 14:56  BaiduNaviSDKDemo\
     文件         466  2014-04-16 11:17  BaiduNaviSDKDemo\.classpath
     文件         857  2014-04-16 11:11  BaiduNaviSDKDemo\.project
     目录           0  2014-02-26 16:19  BaiduNaviSDKDemo\.settings\
     文件          57  2014-02-26 16:19  BaiduNaviSDKDemo\.settings\org.eclipse.core.resources.prefs
     文件         177  2014-02-26 16:19  BaiduNaviSDKDemo\.settings\org.eclipse.jdt.core.prefs
     文件        3822  2014-06-11 14:56  BaiduNaviSDKDemo\AndroidManifest.xml
     目录           0  2014-06-11 14:15  BaiduNaviSDKDemo\assets\
     文件     1416126  2014-06-11 14:47  BaiduNaviSDKDemo\assets\BaiduNaviSDK_Resource_v1_0_0.png
     文件           5  2014-06-11 14:15  BaiduNaviSDKDemo\assets\channel
     文件          23  2014-04-04 11:02  BaiduNaviSDKDemo\BaiduNaviSDK_v1_1_0.jar.properties
     目录           0  2014-06-11 14:56  BaiduNaviSDKDemo\bin\
     目录           0  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\
     目录           0  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\
     目录           0  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\
     目录           0  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\
     目录           0  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\
     文件        1956  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\BNavigatorActivity$1.class
     文件        1113  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\BNavigatorActivity$2.class
     文件         856  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\BNavigatorActivity$3.class
     文件        3505  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\BNavigatorActivity.class
     文件        2354  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\DemoMainActivity.class
     文件        1281  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\RouteGuideDemo$1.class
     文件        1282  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\RouteGuideDemo$2.class
     文件        1290  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\RouteGuideDemo$3.class
     文件        3232  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\RouteGuideDemo.class
     文件        2027  2014-06-11 14:56  BaiduNaviSDKDemo\bin\classes\com\baidu\navi\sdkdemo\RoutePlanDemo.class
     文件        1218  2014-02-26 16:19  BaiduNaviSDKDemo\build.bat
     文件        4036  2014-02-26 16:19  BaiduNaviSDKDemo\build.xml
     文件          70  2014-02-26 16:19  BaiduNaviSDKDemo\demo_build.bat
     文件       72224  2014-02-26 16:19  BaiduNaviSDKDemo\demo_build.xml
............此处省略69个文件信息

评论

共有 条评论