build47 v1.9.3

update baidumap to 4.2
add use baidu tts
add cup support for armearbi-v7a
This commit is contained in:
wangmi 2017-02-15 22:47:05 +08:00
parent 84d404dac3
commit b21814ab03
41 changed files with 468 additions and 208 deletions

View File

@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -4,11 +4,16 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
repositories {
jcenter()
}

View File

@ -54,6 +54,7 @@ dependencies {
compile 'me.dm7.barcodescanner:zxing:1.9'
// compile files('libs/core-3.2.0.jar')
compile files('libs/javase-2.3-SNAPSHOT.jar')
compile files('libs/com.baidu.tts_2.3.0.jar')
}
//tasks.withType(JavaCompile) {
// options.encoding = "GBK"

Binary file not shown.

Binary file not shown.

View File

@ -97,7 +97,6 @@
# -----------------------
-dontoptimize
# -----------------------
# 不混淆指定的文件
# -dontobfuscate
# -----------------------
@ -109,6 +108,7 @@
# -------- 以下是使用了 roboguice-1.1.2.jar 以及 guice-2.0-no_app.jar 功能需要保护的字段及类相关 --------
-keep class com.google.inject.Binder
# -----------------------
-keepclassmembers class * {
@com.google.inject.Inject <init>(...);
}

View File

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.qiyou.mb.android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="46"
android:versionName="1.29.2" >
android:versionCode="47"
android:versionName="1.29.3" >
<uses-sdk
android:minSdkVersion="8"
@ -73,11 +73,11 @@
<!-- home -->
<!-- <meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="4lcFzBPFbukDG9DulM4qjjaI"
/>-->
<!--<meta-data-->
<!--android:name="com.baidu.lbsapi.API_KEY"-->
<!--android:value="4lcFzBPFbukDG9DulM4qjjaI"-->
<!--/>-->
<!---->

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
949467009b6b49774e1965ce072d44ea334807d53dc2636f95ede27592a95390b0440aafedf2db86feece98f39ac7f2fc10db985fd0e8598ec023116b93abdd77bd7ac7a1e83157e2c45151c61c47e3e22fde3f1f87d2e678418305e066de25b3fc5876c0acd3755cb9ec7ffb1d9c7ed94634215fd80ce6e0bc646e9f6a42ff954bafd3c9ebe2edf612bb536f28b9a771db519e0843155b388f69afa91be62472cf1005339868d5e1af244a137707aa588af1ba03d908a69320d449e38329dede1a0770e6a725a04d4190545b120a9902340c1255c73a6ec08ad731c3f601c4e2efbeccd660c53497009522a94566a14da63bdc6fab1e51e25a7fc6f403bbf39

View File

@ -3,56 +3,6 @@
*/
package com.qiyou.mb.android;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.Socket;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.CookieStore;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.protocol.ClientContext;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.cookie.Cookie;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;
import org.apache.http.protocol.HTTP;
import org.apache.http.protocol.HttpContext;
import android.Manifest;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.Application;
import android.app.PendingIntent;
@ -62,50 +12,36 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Point;
import android.location.Location;
import android.location.LocationManager;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.SystemClock;
import android.preference.PreferenceManager;
import android.support.v4.content.ContextCompat;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.baidu.mapapi.BMapManager;
import com.baidu.mapapi.SDKInitializer;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.model.inner.GeoPoint;
import com.baidu.mapapi.search.geocode.GeoCodeResult;
import com.baidu.mapapi.search.geocode.GeoCoder;
import com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeOption;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeResult;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeResult.AddressComponent;
import com.baidu.tts.auth.AuthInfo;
import com.baidu.tts.client.SpeechError;
import com.baidu.tts.client.SpeechSynthesizer;
import com.baidu.tts.client.SpeechSynthesizerListener;
import com.baidu.tts.client.SynthesizerTool;
import com.baidu.tts.client.TtsMode;
import com.facebook.android.crypto.keychain.SharedPrefsBackedKeyChain;
import com.facebook.crypto.Crypto;
import com.facebook.crypto.Entity;
import com.facebook.crypto.util.SystemNativeCryptoLibrary;
import com.google.gson.JsonSyntaxException;
import com.iflytek.speech.ErrorCode;
import com.iflytek.speech.ISpeechModule;
import com.iflytek.speech.InitListener;
import com.iflytek.speech.SpeechConstant;
import com.iflytek.speech.SpeechSynthesizer;
import com.iflytek.speech.SpeechUtility;
import com.iflytek.speech.SynthesizerListener;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
@ -142,10 +78,67 @@ import com.qiyou.mb.android.utils.enums.TrackStatus;
import com.qiyou.mb.android.utils.enums.TrackType;
import com.qiyou.mb.android.utils.log.QLog;
import com.umeng.analytics.MobclickAgent;
import com.umeng.message.PushAgent;
import com.umeng.message.IUmengRegisterCallback;
import com.umeng.message.UTrack;
import com.umeng.message.ALIAS_TYPE;
import com.umeng.message.PushAgent;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.CookieStore;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.protocol.ClientContext;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.cookie.Cookie;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;
import org.apache.http.protocol.HTTP;
import org.apache.http.protocol.HttpContext;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.Socket;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
//import com.iflytek.speech.ErrorCode;
//import com.iflytek.speech.ISpeechModule;
//import com.iflytek.speech.InitListener;
//import com.iflytek.speech.SpeechConstant;
//import com.iflytek.speech.SpeechSynthesizer;
//import com.iflytek.speech.SpeechUtility;
//import com.iflytek.speech.SynthesizerListener;
//import com.qiyou.mb.android.service.TrackDbService;
public class QiYouApplication extends Application {
@ -842,7 +835,7 @@ private ConcurrentHashMap<String,Object> webObjcache;
/**
* Toggles the state of GPS.
*
* @param context
* @param
*/
// private void toggleGps(Context context) {
// ContentResolver resolver = context.getContentResolver();
@ -2622,14 +2615,20 @@ public TypeStatistics getTracksStat(int trackType,long startDate,long endDate)
// TODO Auto-generated method stub
super.onTerminate();
this.shutdownHttpClient();
mTts.stopSpeaking(mTtsListener);
// // ?嚭鏃堕噴鏀捐繛鎺?
mTts.destory();
stopMts();
QLog.getLogger().dLog(TAG, " Application Terminited." );
}
void stopMts(){
// mTts.stopSpeaking(mTtsListener);
//// // ?嚭鏃堕噴鏀捐繛鎺?
// mTts.destory();
mTts.stop();
}
/**创建HttpClient实例
* @return
@ -2760,6 +2759,251 @@ public TypeStatistics getTracksStat(int trackType,long startDate,long endDate)
}
//initial speech utils
private SpeechSynthesizer mTts;
private String mSampleDirPath;
private static final String SAMPLE_DIR_NAME = "baiduTTS";
private static final String SPEECH_FEMALE_MODEL_NAME = "bd_etts_speech_female.dat";
private static final String SPEECH_MALE_MODEL_NAME = "bd_etts_speech_male.dat";
private static final String TEXT_MODEL_NAME = "bd_etts_text.dat";
// private static final String LICENSE_FILE_NAME = "temp_license";
private static final String ENGLISH_SPEECH_FEMALE_MODEL_NAME = "bd_etts_speech_female_en.dat";
private static final String ENGLISH_SPEECH_MALE_MODEL_NAME = "bd_etts_speech_male_en.dat";
private static final String ENGLISH_TEXT_MODEL_NAME = "bd_etts_text_en.dat";
private void makeDir(String dirPath) {
File file = new File(dirPath);
if (!file.exists()) {
file.mkdirs();
}
}
private void initialEnv() {
if (mSampleDirPath == null) {
String sdcardPath = Environment.getExternalStorageDirectory().toString();
mSampleDirPath = sdcardPath + "/qiyou/" + SAMPLE_DIR_NAME;
}
makeDir(mSampleDirPath);
copyFromAssetsToSdcard(false, SPEECH_FEMALE_MODEL_NAME, mSampleDirPath + "/" + SPEECH_FEMALE_MODEL_NAME);
copyFromAssetsToSdcard(false, SPEECH_MALE_MODEL_NAME, mSampleDirPath + "/" + SPEECH_MALE_MODEL_NAME);
copyFromAssetsToSdcard(false, TEXT_MODEL_NAME, mSampleDirPath + "/" + TEXT_MODEL_NAME);
// copyFromAssetsToSdcard(false, LICENSE_FILE_NAME, mSampleDirPath + "/" + LICENSE_FILE_NAME);
// copyFromAssetsToSdcard(false, "english/" + ENGLISH_SPEECH_FEMALE_MODEL_NAME, mSampleDirPath + "/"
// + ENGLISH_SPEECH_FEMALE_MODEL_NAME);
// copyFromAssetsToSdcard(false, "english/" + ENGLISH_SPEECH_MALE_MODEL_NAME, mSampleDirPath + "/"
// + ENGLISH_SPEECH_MALE_MODEL_NAME);
// copyFromAssetsToSdcard(false, "english/" + ENGLISH_TEXT_MODEL_NAME, mSampleDirPath + "/"
// + ENGLISH_TEXT_MODEL_NAME);
}
/**
* 将sample工程需要的资源文件拷贝到SD卡中使用授权文件为临时授权文件请注册正式授权
*
* @param isCover 是否覆盖已存在的目标文件
* @param source
* @param dest
*/
private void copyFromAssetsToSdcard(boolean isCover, String source, String dest) {
File file = new File(dest);
if (isCover || (!isCover && !file.exists())) {
InputStream is = null;
FileOutputStream fos = null;
try {
is = this.getResources().getAssets().open(source);
String path = dest;
fos = new FileOutputStream(path);
byte[] buffer = new byte[1024];
int size = 0;
while ((size = is.read(buffer, 0, 1024)) >= 0) {
fos.write(buffer, 0, size);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
try {
if (is != null) {
is.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
private void initialSpeech(){
initialEnv();
this.mTts = SpeechSynthesizer.getInstance();
this.mTts.setContext(this);
this.mTts.setSpeechSynthesizerListener(mTtsInitListener);
this.mTts.setParam(SpeechSynthesizer.PARAM_VOLUME, "9");
this.mTts.setParam(SpeechSynthesizer.PARAM_SPEED, "5");
this.mTts.setParam(SpeechSynthesizer.PARAM_PITCH, "5");// 语调 [ 0- 9]
this.mTts.setParam(SpeechSynthesizer.PARAM_SPEAKER, "0");//
// 文本模型文件路径 (离线引擎使用)
this.mTts.setParam(SpeechSynthesizer.PARAM_TTS_TEXT_MODEL_FILE, mSampleDirPath + "/"
+ TEXT_MODEL_NAME);
// // 声学模型文件路径 (离线引擎使用)
this.mTts.setParam(SpeechSynthesizer.PARAM_TTS_SPEECH_MODEL_FILE, mSampleDirPath + "/"
+ SPEECH_FEMALE_MODEL_NAME);
// // 本地授权文件路径,如未设置将使用默认路径.设置临时授权文件路径LICENCE_FILE_NAME请替换成临时授权文件的实际路径仅在使用临时license文件时需要进行设置如果在[应用管理]中开通了正式离线授权不需要设置该参数建议将该行代码删除离线引擎
// // 如果合成结果出现临时授权文件将要到期的提示说明使用了临时授权文件请删除临时授权即可
// this.mTts.setParam(SpeechSynthesizer.PARAM_TTS_LICENCE_FILE, mSampleDirPath + "/"
// + LICENSE_FILE_NAME);
// 请替换为语音开发者平台上注册应用得到的App ID (离线授权)
this.mTts.setAppId("6079582"/*这里只是为了让Demo运行使用的APPID,请替换成自己的id。*/);
// 请替换为语音开发者平台注册应用得到的apikey和secretkey (在线授权)
this.mTts.setApiKey("8BEjRGmT6kvGcPzTmkq224MzlLzaMgKV",
"87YRjXyLT2PlPeGDonuHH5n1MrwvFLGm"/*这里只是为了让Demo正常运行使用APIKey,请替换成自己的APIKey*/);
// 发音人在线引擎可用参数为0,1,2,3服务器端会动态增加各值含义参考文档以文档说明为准0--普通女声1--普通男声2--特别男声3--情感男声
this.mTts.setParam(SpeechSynthesizer.PARAM_SPEAKER, "0");
// 设置Mix模式的合成策略
this.mTts.setParam(SpeechSynthesizer.PARAM_MIX_MODE, SpeechSynthesizer.MIX_MODE_DEFAULT);
// 授权检测接口(只是通过AuthInfo进行检验授权是否成功)
// AuthInfo接口用于测试开发者是否成功申请了在线或者离线授权如果测试授权成功了可以删除AuthInfo部分的代码该接口首次验证时比较耗时不会影响正常使用合成使用时SDK内部会自动验证授权
AuthInfo authInfo = this.mTts.auth(TtsMode.MIX);
if (authInfo.isSuccess()) {
QLog.getLogger().d(dTAG, "baidu tts auth success" );
} else {
String errorMsg = authInfo.getTtsError().getDetailMessage();
QLog.getLogger().d(dTAG, "baidu tts auth fail" );
}
// 初始化tts
mTts.initTts(TtsMode.MIX);
// // 加载离线英文资源提供离线英文合成功能
// int result =
// mSpeechSynthesizer.loadEnglishModel(mSampleDirPath + "/" + ENGLISH_TEXT_MODEL_NAME, mSampleDirPath
// + "/" + ENGLISH_SPEECH_FEMALE_MODEL_NAME);
// toPrint("loadEnglishModel result=" + result);
//打印引擎信息和model基本信息
printEngineInfo();
}
/**
* 打印引擎so库版本号及基本信息和model文件的基本信息
*/
private void printEngineInfo() {
QLog.getLogger().d(dTAG, "EngineVersioin=" + SynthesizerTool.getEngineVersion());
QLog.getLogger().d(dTAG, "EngineInfo=" + SynthesizerTool.getEngineInfo());
// String textModelInfo = SynthesizerTool.getModelInfo(mSampleDirPath + "/" + TEXT_MODEL_NAME);
// QLog.getLogger().d(dTAG, "textModelInfo=" + textModelInfo);
// String speechModelInfo = SynthesizerTool.getModelInfo(mSampleDirPath + "/" + SPEECH_FEMALE_MODEL_NAME);
// QLog.getLogger().d(dTAG, "speechModelInfo=" + speechModelInfo);
}
private boolean bdSpeaking = false;
class bdttsListener implements SpeechSynthesizerListener{
@Override
public void onSynthesizeStart(String s) {
}
@Override
public void onSynthesizeDataArrived(String s, byte[] bytes, int i) {
}
@Override
public void onSynthesizeFinish(String s) {
}
@Override
public void onSpeechStart(String s) {
bdSpeaking = true;
}
@Override
public void onSpeechProgressChanged(String s, int i) {
String spkS = s;
int progress = i;
}
@Override
public void onSpeechFinish(String s) {
bdSpeaking = false;
}
@Override
public void onError(String s, SpeechError speechError) {
bdSpeaking = false;
}
}
private bdttsListener mTtsInitListener = new bdttsListener() ;
private int speekingLevel=0;
int sumSleep = 0;
public void speech(final String text,final int level){
// if(!QiYouConstant.CAN_SPEAK)return;
new Thread(){
@Override
public void run() {
while(bdSpeaking &&level <=speekingLevel && sumSleep > 5000){
try {
Thread.sleep(1000);
sumSleep +=1000;
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
sumSleep =0;
mTts.stop();
// bdSpeaking = false;
speekingLevel =level;
mTts.speak(text);
}}.start();
}
public void stopSpeech(){
{
// mTts.pauseSpeaking(mTtsListener);
mTts.stop();
}
}
public void resumeSpeech(){
{
// mTts.resumeSpeaking(mTtsListener);
mTts.resume();
}
}
public boolean isSpeaking(){
return bdSpeaking;
}
//xunfei is below....
/*
private SpeechSynthesizer mTts;
private Toast mToast;
private void initialSpeech(){
@ -2767,17 +3011,15 @@ public TypeStatistics getTracksStat(int trackType,long startDate,long endDate)
SpeechUtility.getUtility(this.getApplicationContext()).setAppid("54769bf1");
// 初始化合成对象
mTts = new SpeechSynthesizer(this, mTtsInitListener);
mToast = Toast.makeText(this,"",Toast.LENGTH_LONG);
// mToast = Toast.makeText(this,"",Toast.LENGTH_LONG);
}
/**
* 鍒濇湡鍖栫洃鍚?
*/
private InitListener mTtsInitListener = new InitListener() {
@Override
public void onInit(ISpeechModule arg0, int code) {
Log.d(TAG, "InitListener init() code = " + code);
// Log.d(TAG, "InitListener init() code = " + code);
if (code == ErrorCode.SUCCESS) {
setParam();
}
@ -2786,9 +3028,7 @@ public TypeStatistics getTracksStat(int trackType,long startDate,long endDate)
}
};
/**
* 鍚堟垚鍥炶皟鐩戝惉銆?
*/
private SynthesizerListener mTtsListener = new SynthesizerListener.Stub() {
@Override
public void onBufferProgress(int progress) throws RemoteException {
@ -2830,35 +3070,7 @@ public TypeStatistics getTracksStat(int trackType,long startDate,long endDate)
// private void showTip(final String str){
//
// mToast.setText(str);
// mToast.show();
// }
private int speekingLevel=0;
// public void speech(final String text){
// speech(text,1);
/* if(!QiYouConstant.CAN_SPEAK)return;
new Thread(){
@Override
public void run() {
while(mTts.isSpeaking()){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
mTts.startSpeaking(text, mTtsListener);
}}.start(); */
// }
public void speech(final String text,final int level){
// if(!QiYouConstant.CAN_SPEAK)return;
@ -2922,6 +3134,21 @@ public TypeStatistics getTracksStat(int trackType,long startDate,long endDate)
mTts.resumeSpeaking(mTtsListener);
}
*/
public void naviUI(Location loc,String msg){

View File

@ -246,7 +246,7 @@ public class MainActivity extends Activity_qiyouBase{
com.umeng.socialize.utils.Log.LOG = QiYouConstant.DEVELOPER_MODE;
String key ="550aa4e4fd98c5a25c000284" ; //old "4eaee02c527015373b000003"
if (!QiYouConstant.DEVELOPER_MODE){
UMAnalyticsConfig config = new UMAnalyticsConfig(this,key , "flyme");
UMAnalyticsConfig config = new UMAnalyticsConfig(this,key , "i7lv");
MobclickAgent. startWithConfigure(config);
MobclickAgent.openActivityDurationTrack(false);
}

View File

@ -1,70 +1,52 @@
package com.qiyou.mb.android.ui.fragments;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.SimpleAdapter.ViewBinder;
import android.widget.Spinner;
import android.widget.TabHost;
import android.widget.TabHost.OnTabChangeListener;
import android.widget.TextView;
import android.widget.Toast;
import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.BitmapDescriptorFactory;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.Marker;
import com.baidu.mapapi.map.MarkerOptions;
import com.baidu.mapapi.map.OverlayOptions;
import com.baidu.mapapi.map.Polyline;
import com.baidu.mapapi.map.PolylineOptions;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.overlayutil.DrivingRouteOverlay;
import com.baidu.mapapi.overlayutil.OverlayManager;
import com.baidu.mapapi.overlayutil.PoiOverlay;
import com.baidu.mapapi.search.core.CityInfo;
import com.baidu.mapapi.search.core.PoiInfo;
import com.baidu.mapapi.search.core.RouteLine;
import com.baidu.mapapi.search.core.SearchResult;
import com.baidu.mapapi.search.geocode.GeoCodeResult;
import com.baidu.mapapi.search.geocode.GeoCoder;
import com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeResult;
import com.baidu.mapapi.search.poi.OnGetPoiSearchResultListener;
import com.baidu.mapapi.search.poi.PoiCitySearchOption;
import com.baidu.mapapi.search.poi.PoiDetailResult;
import com.baidu.mapapi.search.poi.PoiDetailSearchOption;
import com.baidu.mapapi.search.poi.PoiIndoorResult;
import com.baidu.mapapi.search.poi.PoiResult;
import com.baidu.mapapi.search.poi.PoiSearch;
import com.baidu.mapapi.search.route.BikingRouteLine.BikingStep;
@ -73,6 +55,8 @@ import com.baidu.mapapi.search.route.BikingRouteResult;
import com.baidu.mapapi.search.route.DrivingRouteLine.DrivingStep;
import com.baidu.mapapi.search.route.DrivingRoutePlanOption;
import com.baidu.mapapi.search.route.DrivingRouteResult;
import com.baidu.mapapi.search.route.IndoorRouteResult;
import com.baidu.mapapi.search.route.MassTransitRouteResult;
import com.baidu.mapapi.search.route.OnGetRoutePlanResultListener;
import com.baidu.mapapi.search.route.PlanNode;
import com.baidu.mapapi.search.route.RoutePlanSearch;
@ -86,8 +70,6 @@ import com.qiyou.mb.android.R;
import com.qiyou.mb.android.beans.Track;
import com.qiyou.mb.android.beans.basic.Waypoint;
import com.qiyou.mb.android.beans.basic.Waypoint_bean;
import com.qiyou.mb.android.service.QNaviSvc;
import com.qiyou.mb.android.ui.fragments.TrackingBasic_fragment.SpinnerXMLSelectedListener;
import com.qiyou.mb.android.utils.FileScan;
import com.qiyou.mb.android.utils.QSimpleAdapter;
import com.qiyou.mb.android.utils.Utils;
@ -97,6 +79,12 @@ import com.qiyou.mb.android.utils.enums.WorkingTrackType;
import com.qiyou.mb.android.utils.enums.wpFlag;
import com.qiyou.mb.android.utils.log.QLog;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SuppressLint("NewApi")
public class Route_fragment extends TrackTabs_fragment implements IlocationFragment
{
@ -491,6 +479,11 @@ public class Route_fragment extends TrackTabs_fragment implements IlocationFra
}
}
@Override
public void onGetPoiIndoorResult(PoiIndoorResult poiIndoorResult) {
}
}
);
@ -569,7 +562,22 @@ public class Route_fragment extends TrackTabs_fragment implements IlocationFra
return roadWbs.size() > 1 &&!TextUtils.isEmpty(instructions) &&( index==0 || instructions.indexOf("从起点")>0 || instructions.indexOf("方向出发")>0);
}
void cleanRoadInfo(){
instructions = instructions.replaceAll("<b>","").replaceAll("</b>","");
exitInstruction = exitInstruction.replaceAll("<b>","").replaceAll("</b>","");
entranceInstruction = entranceInstruction.replaceAll("<b>","").replaceAll("</b>","");
}
String getRidOfHtmlCharacters(String in){
int fontIndex = in.indexOf("<font");
if(fontIndex>0){
in = in.substring(0,fontIndex);
}
return in.replaceAll("<b>","").replaceAll("</b>","").replaceAll("<br/>","");
}
@Override
public void onGetBikingRouteResult(BikingRouteResult result) {
@ -618,6 +626,7 @@ public class Route_fragment extends TrackTabs_fragment implements IlocationFra
instructions =step.getInstructions();
exitInstruction=step.getExitInstructions();
entranceInstruction=step.getEntranceInstructions();
cleanRoadInfo();
wb.setBearing(step.getDirection()*directionRate);
// QLog.getLogger().d(dTAG, String.format(" instructions %s \n existinstruction %s | entranceInstruction %s" , instructions,exitInstruction,entranceInstruction));
@ -711,7 +720,7 @@ public class Route_fragment extends TrackTabs_fragment implements IlocationFra
wb.setRoadBook(lastRoadbook);
// wb.setComment(content);
// QLog.getLogger().d(dTAG, String.format(" roadbook is %s , turnflag is %s ", lastRoadbook,wb.getTurnFlag().toCHString() ));
QLog.getLogger().d(dTAG, String.format(" roadbook is %s , turnflag is %s ", lastRoadbook,wb.getTurnFlag().toCHString() ));
// wb.setTurnFlag(wpFlag.CUST);
roadWbs.add(wb);
// starttime+=timestep;
@ -761,6 +770,7 @@ public class Route_fragment extends TrackTabs_fragment implements IlocationFra
instructions =step.getInstructions();
exitInstruction=step.getExitInstructions();
entranceInstruction=step.getEntranceInstructions();
cleanRoadInfo();
wb.setBearing(step.getDirection()*directionRate);
QLog.getLogger().d(dTAG, String.format(" instructions %s \n existinstruction %s | entranceInstruction %s", instructions,exitInstruction,entranceInstruction));
@ -809,7 +819,7 @@ public class Route_fragment extends TrackTabs_fragment implements IlocationFra
}else
roadBook =entranceInstruction;
// roadBook = entranceInstruction.replace("-", ",然后前行")/*.replaceAll(",", ",然后")*/;
roadBook = TextUtils.isEmpty(roadBook) ? instructions : roadBook;
if( roadBook.indexOf(",到达终点")>0){
// instructions=instructions.replace(",到达终点",String.format("到达【途经点%s】 \n", custWpNumber+addon ));
@ -837,12 +847,22 @@ public class Route_fragment extends TrackTabs_fragment implements IlocationFra
}
*/
}
@Override
public void onGetIndoorRouteResult(IndoorRouteResult indoorRouteResult) {
}
@Override
public void onGetTransitRouteResult(TransitRouteResult arg0) {
// TODO Auto-generated method stub
}
@Override
public void onGetMassTransitRouteResult(MassTransitRouteResult massTransitRouteResult) {
}
@Override
@ -891,6 +911,7 @@ public class Route_fragment extends TrackTabs_fragment implements IlocationFra
instructions =step.getInstructions();
exitInstruction=step.getExitInstructions();
entranceInstruction=step.getEntranceInstructions();
cleanRoadInfo();
wb.setBearing(step.getDirection()*directionRate);
// QLog.getLogger().d(dTAG, String.format(" instructions %s \n existinstruction %s | entranceInstruction %s", instructions,exitInstruction,entranceInstruction));

View File

@ -306,7 +306,10 @@ public class TrackTabs_fragment extends WebList_fragment{// TrackMap_fragment {
}
void initialFootmark(){
chk_pic = (CheckBox)vContainer.findViewById(R.id.fm_chk_pic);
chk_pic.setChecked(true);
boolean showPickOnly = this.mTrack == null || !this.mTrack.isGpx();
chk_pic.setChecked(showPickOnly);
chk_pic.setOnCheckedChangeListener(m_checkboxListener);
showPicOnly =chk_pic.isChecked();

View File

@ -3,44 +3,12 @@
*/
package com.qiyou.mb.android.utils;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.parsers.ParserConfigurationException;
import org.alternativevision.gpx.GPXParser;
import org.alternativevision.gpx.beans.GPX;
import org.apache.http.util.EncodingUtils;
import org.xml.sax.SAXException;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.ContentUris;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
@ -57,14 +25,15 @@ import android.os.Environment;
import android.preference.PreferenceManager;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.inputmethod.InputMethodManager;
import com.baidu.mapapi.model.LatLng;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.loopj.android.http.Base64;
import com.qiyou.mb.android.QiYouConstant;
import com.qiyou.mb.android.R;
@ -75,9 +44,34 @@ import com.qiyou.mb.android.beans.basic.Waypoint_bean;
import com.qiyou.mb.android.utils.enums.TrackType;
import com.qiyou.mb.android.utils.enums.wpFlag;
import com.qiyou.mb.android.utils.log.QLog;
import com.baidu.mapapi.model.LatLng;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import org.alternativevision.gpx.GPXParser;
import org.alternativevision.gpx.beans.GPX;
import org.apache.http.util.EncodingUtils;
import org.xml.sax.SAXException;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.parsers.ParserConfigurationException;
/**
* @author mwang
*
@ -1239,6 +1233,11 @@ public class Utils {
return str;
}
public static boolean isLocOfGPS(Location loc){
if(loc==null)return false;
return loc.getProvider().equalsIgnoreCase(LocationManager.GPS_PROVIDER);
@ -1743,6 +1742,8 @@ public static LatLng getLatLng(double lat ,double lon){
// 判断手机中是否安装了讯飞语音+
public static boolean checkSpeechServiceInstall(Context context){
return true;
/*
String packageName = "com.iflytek.speechcloud";
List<PackageInfo> packages = context.getPackageManager().getInstalledPackages(0);
for(int i = 0; i < packages.size(); i++){
@ -1754,6 +1755,7 @@ public static boolean checkSpeechServiceInstall(Context context){
}
}
return false;
*/
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,2 +1,2 @@
include ':listviewlibrary', ':PushSDK'
include ':listviewlibrary', ':PushSDK', ':i7lvsvrs'
include ':qy'