Android 百度地图导航没有语音问题踩坑 重点是AndroidManifest.xml的配置问题

Android 百度地图导航没有语音问题踩坑

第一步
确认有没有在代码中加入自己的AppID
修改Demo的AppID
Bundle bundle = new Bundle();
// 必须设置APPID,否则会静音
bundle.putString(BNCommonSettingParam.TTS_APP_ID, “你的AppID”);
BNaviSettingManager.setNaviSdkParam(bundle);
代码写在initSetting()方法中
配置AndroidManifest.xml文件
配置各种key
<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@drawable/ic_launcher"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data
            android:name="com.baidu.speech.APP_ID"
            android:value="你的AppID" />
        <meta-data
            android:name="com.baidu.speech.API_KEY"
            android:value="你的Key" />
        <meta-data
            android:name="com.baidu.speech.SECRET_KEY"
            android:value="你的Secret Key" />
        <meta-data
            android:name="com.baidu.lbsapi.API_KEY"
            android:value="你的Key"/>
        <activity
            android:name=".BNDemoMainActivity"
            android:configChanges="orientation|screenSize|keyboard|keyboardHidden"
            android:label="@string/sdk_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".BNDemoGuideActivity"
            android:configChanges="orientation|screenSize|keyboard|keyboardHidden"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:label="@string/title_route_guide_demo" >
        </activity>
        <service
            android:name="com.baidu.location.f"
            android:enabled="true"
            android:process=":remote" />
    </application>

key的查看方式如下:
去这里http://yuyin.baidu.com/app

AppID可以直接看到
然后点击管理包名 把自己的包名填入,自己的包名可以在AndroidManifest.xml中找到 直接copy就可以了
最后点击查看key

得到了我们需要的key和ID然后对应的填入刚刚的AndroidManifest.xml文件再重新运行即可

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值