├── .gitignore
├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── gradle.xml
├── inspectionProfiles
│ ├── Project_Default.xml
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app-armeabi-v7a-release.apk
├── app-release.apk
├── app-universal-release.apk
├── app-x86-release.apk
├── app-x86_64-release.apk
├── app
├── .gitignore
├── assets
│ ├── BaiduNaviSDK_3.0.png
│ ├── BaiduNaviSDK_Resource_3.0.png
│ └── channel
├── build.gradle
├── libs
│ ├── BaiduLBS_Android.jar
│ ├── alipaySdk-20180403.jar
│ ├── armeabi
│ │ ├── libBDSpeechDecoder_V1.so
│ │ ├── libBaiduMapSDK_base_v4_5_2.so
│ │ ├── libBaiduMapSDK_map_v4_5_2.so
│ │ ├── libapp_BaiduNaviApplib.so
│ │ ├── libapp_BaiduPanoramaAppLib.so
│ │ ├── libapp_BaiduVIlib.so
│ │ ├── libaudiomessage-jni.so
│ │ ├── libbd_etts.so
│ │ ├── libbds.so
│ │ ├── libbdtts.so
│ │ ├── libcrypto.so
│ │ ├── libcurl.so
│ │ ├── libetts_domain_data_builder.so
│ │ ├── libgnustl_shared.so
│ │ ├── liblocSDK7a.so
│ │ ├── liblocnaviSDK.so
│ │ └── libssl.so
│ ├── httpmime-4.1.2.jar
│ ├── ksoap2-android-assembly-2.4-jar-with-dependencies.jar
│ ├── libammsdk.jar
│ └── open_sdk_r5990_lite.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── dyf
│ │ └── baidumap
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ ├── BaiduNaviSDK_3.0.png
│ │ ├── BaiduNaviSDK_Resource_3.0.png
│ │ └── channel
│ ├── ic_launcher-web.png
│ ├── java
│ │ └── com
│ │ │ └── dyf
│ │ │ ├── baidumap
│ │ │ ├── BNDemoGuideActivity.java
│ │ │ ├── BNEventDialog.java
│ │ │ ├── BNEventHandler.java
│ │ │ ├── Base64.java
│ │ │ ├── BaseUIListener.java
│ │ │ ├── BindPlateNumActivity.java
│ │ │ ├── EvaluateActivity.java
│ │ │ ├── Info.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MyOrientationListener.java
│ │ │ ├── PayResult.java
│ │ │ ├── ReChargeActivity.java
│ │ │ ├── ReserveActivity.java
│ │ │ ├── ReturnActivity.java
│ │ │ ├── ShowPlateNumActivity.java
│ │ │ └── wxapi
│ │ │ │ └── WXEntryActivity.java
│ │ │ ├── model
│ │ │ └── ResultParklotInfo.java
│ │ │ └── utils
│ │ │ ├── AlipayConstants.java
│ │ │ ├── Constant.java
│ │ │ ├── Convert.java
│ │ │ ├── Inet.java
│ │ │ ├── OrderInfoUtil2_0.java
│ │ │ ├── SendRequest.java
│ │ │ ├── SignUtils.java
│ │ │ ├── SysoUtils.java
│ │ │ ├── ToastShow.java
│ │ │ └── Util.java
│ └── res
│ │ ├── drawable
│ │ ├── img_border.xml
│ │ ├── myloc_72px.png
│ │ └── navi_guide_turn.png
│ │ ├── layout
│ │ ├── activity_bind_plate_num.xml
│ │ ├── activity_evaluate.xml
│ │ ├── activity_main.xml
│ │ ├── activity_re_charge.xml
│ │ ├── activity_reserve.xml
│ │ ├── activity_return.xml
│ │ ├── activity_show_plate_num.xml
│ │ ├── dialog_date.xml
│ │ ├── dialog_time.xml
│ │ ├── marker_info.xml
│ │ ├── navi_event_dialog.xml
│ │ └── re.xml
│ │ ├── menu
│ │ └── main.xml
│ │ ├── mipmap-hdpi
│ │ ├── a01.png
│ │ ├── a02.png
│ │ ├── a03.png
│ │ ├── a04.png
│ │ ├── bg_map_bottom.png
│ │ ├── ic_launcher.png
│ │ ├── icon_app.png
│ │ ├── location_tips.png
│ │ ├── map_zan.png
│ │ ├── marker.png
│ │ └── navigation.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── navigation.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── navigation.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── navigation.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── navigation.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── dyf
│ └── baidumap
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── resource
├── a01.png
├── a02.png
├── a03.png
├── a04.png
├── bg_map_bottom.png
├── icon_app.png
├── location_tips.png
├── map_zan.png
├── marker.png
├── myloc_Map_Marker_Ball_Pink_128px.png
├── myloc_Map_Marker_Ball_Pink_32px.png
├── myloc_Map_Marker_Ball_Pink_48px.png
├── myloc_Map_Marker_Ball_Pink_64px.png
├── myloc_Map_Marker_Ball_Pink_72px.png
├── myloc_Map_Marker_Ball_Pink_96px.png
├── navigation_16px.png
├── navigation_24px.png
├── navigation_32px.png
├── navigation_48px.png
├── navigation_64px.png
├── navigation_72px.png
└── 覆盖物信息.txt
├── settings.gradle
└── 项目所需密钥.zip
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | 1.8
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Shared_Parking_Space_Mobile
2 | 共享停车位手机客户端
3 |
--------------------------------------------------------------------------------
/app-armeabi-v7a-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app-armeabi-v7a-release.apk
--------------------------------------------------------------------------------
/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app-release.apk
--------------------------------------------------------------------------------
/app-universal-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app-universal-release.apk
--------------------------------------------------------------------------------
/app-x86-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app-x86-release.apk
--------------------------------------------------------------------------------
/app-x86_64-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app-x86_64-release.apk
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/assets/BaiduNaviSDK_3.0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/assets/BaiduNaviSDK_3.0.png
--------------------------------------------------------------------------------
/app/assets/BaiduNaviSDK_Resource_3.0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/assets/BaiduNaviSDK_Resource_3.0.png
--------------------------------------------------------------------------------
/app/assets/channel:
--------------------------------------------------------------------------------
1 | baidu
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | signingConfigs {
5 | config {
6 | keyAlias 'androiddebugkey'
7 | keyPassword 'android'
8 | storeFile file('C:/Users/diy/.android/debug.keystore')
9 | storePassword 'android'
10 | }
11 | }
12 | compileSdkVersion 24
13 | buildToolsVersion "25.0.2"
14 | defaultConfig {
15 | applicationId "com.dyf.baidumap"
16 | minSdkVersion 15
17 | targetSdkVersion 24
18 | versionCode 1
19 | versionName "1.0"
20 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
21 | signingConfig signingConfigs.config
22 | splits {
23 | abi {
24 | enable true
25 | reset()
26 | include 'x86', 'armeabi-v7a','x86_64'
27 | universalApk true
28 | }
29 | }
30 | }
31 | buildTypes {
32 | release {
33 | minifyEnabled false
34 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35 | signingConfig signingConfigs.config
36 | }
37 | debug {
38 | signingConfig signingConfigs.config
39 | }
40 | }
41 | sourceSets {
42 | main {
43 | jniLibs.srcDirs 'libs'
44 | }
45 | }
46 | productFlavors {
47 | }
48 | }
49 |
50 | dependencies {
51 | compile fileTree(include: ['*.jar'], dir: 'libs')
52 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
53 | exclude group: 'com.android.support', module: 'support-annotations'
54 | })
55 | compile files('libs/httpmime-4.1.2.jar')
56 | compile files('libs/BaiduLBS_Android.jar')
57 | compile files('libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar')
58 | compile files('libs/libammsdk.jar')
59 | compile files('libs/open_sdk_r5990_lite.jar')
60 | //compile files('libs/android-support-v4.jar')
61 | compile files('libs/alipaySdk-20180403.jar')
62 | compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
63 | compile 'com.android.support:appcompat-v7:24.2.1'
64 | compile 'com.android.support.constraint:constraint-layout:1.0.0-beta3'
65 | testCompile 'junit:junit:4.12'
66 | }
67 |
--------------------------------------------------------------------------------
/app/libs/BaiduLBS_Android.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/BaiduLBS_Android.jar
--------------------------------------------------------------------------------
/app/libs/alipaySdk-20180403.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/alipaySdk-20180403.jar
--------------------------------------------------------------------------------
/app/libs/armeabi/libBDSpeechDecoder_V1.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libBDSpeechDecoder_V1.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libBaiduMapSDK_base_v4_5_2.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libBaiduMapSDK_base_v4_5_2.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libBaiduMapSDK_map_v4_5_2.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libBaiduMapSDK_map_v4_5_2.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libapp_BaiduNaviApplib.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libapp_BaiduNaviApplib.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libapp_BaiduPanoramaAppLib.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libapp_BaiduPanoramaAppLib.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libapp_BaiduVIlib.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libapp_BaiduVIlib.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libaudiomessage-jni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libaudiomessage-jni.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libbd_etts.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libbd_etts.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libbds.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libbds.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libbdtts.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libbdtts.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libcrypto.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libcrypto.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libcurl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libcurl.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libetts_domain_data_builder.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libetts_domain_data_builder.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libgnustl_shared.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libgnustl_shared.so
--------------------------------------------------------------------------------
/app/libs/armeabi/liblocSDK7a.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/liblocSDK7a.so
--------------------------------------------------------------------------------
/app/libs/armeabi/liblocnaviSDK.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/liblocnaviSDK.so
--------------------------------------------------------------------------------
/app/libs/armeabi/libssl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/armeabi/libssl.so
--------------------------------------------------------------------------------
/app/libs/httpmime-4.1.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/httpmime-4.1.2.jar
--------------------------------------------------------------------------------
/app/libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar
--------------------------------------------------------------------------------
/app/libs/libammsdk.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/libammsdk.jar
--------------------------------------------------------------------------------
/app/libs/open_sdk_r5990_lite.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/libs/open_sdk_r5990_lite.jar
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\D\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/dyf/baidumap/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest
19 | {
20 | @Test
21 | public void useAppContext() throws Exception
22 | {
23 | // Context of the app under test.
24 | Context appContext = InstrumentationRegistry.getTargetContext();
25 |
26 | assertEquals("com.dyf.baidumap", appContext.getPackageName());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
41 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
67 |
68 |
69 |
70 |
74 |
75 |
76 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/app/src/main/assets/BaiduNaviSDK_3.0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/src/main/assets/BaiduNaviSDK_3.0.png
--------------------------------------------------------------------------------
/app/src/main/assets/BaiduNaviSDK_Resource_3.0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/src/main/assets/BaiduNaviSDK_Resource_3.0.png
--------------------------------------------------------------------------------
/app/src/main/assets/channel:
--------------------------------------------------------------------------------
1 | baidu
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/24KKKK/Shared_Parking_Space_Mobile/ec02da0a142e08ffc54b1897ef4a47e965cb255e/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/BNDemoGuideActivity.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.os.Build;
6 | import android.os.Bundle;
7 | import android.os.Handler;
8 | import android.util.Log;
9 | import android.view.View;
10 |
11 | import com.baidu.navisdk.adapter.BNRouteGuideManager;
12 | import com.baidu.navisdk.adapter.BNRouteGuideManager.CustomizedLayerItem;
13 | import com.baidu.navisdk.adapter.BNRouteGuideManager.OnNavigationListener;
14 | import com.baidu.navisdk.adapter.BNRoutePlanNode;
15 | import com.baidu.navisdk.adapter.BNRoutePlanNode.CoordinateType;
16 | import com.baidu.navisdk.adapter.BNaviBaseCallbackModel;
17 | import com.baidu.navisdk.adapter.BaiduNaviCommonModule;
18 | import com.baidu.navisdk.adapter.NaviModuleFactory;
19 | import com.baidu.navisdk.adapter.NaviModuleImpl;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | /**
25 | * 诱导界面
26 | *
27 | * @author sunhao04
28 | */
29 | public class BNDemoGuideActivity extends Activity
30 | {
31 |
32 | private final String TAG = BNDemoGuideActivity.class.getName();
33 | private BNRoutePlanNode mBNRoutePlanNode = null;
34 | private BaiduNaviCommonModule mBaiduNaviCommonModule = null;
35 |
36 | /*
37 | * 对于导航模块有两种方式来实现发起导航。 1:使用通用接口来实现 2:使用传统接口来实现
38 | *
39 | */
40 | // 是否使用通用接口
41 | private boolean useCommonInterface = true;
42 |
43 | @Override
44 | protected void onCreate(Bundle savedInstanceState)
45 | {
46 | super.onCreate(savedInstanceState);
47 |
48 | MainActivity.activityList.add(this);
49 | createHandler();
50 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
51 | {
52 | }
53 | View view = null;
54 | if (useCommonInterface)
55 | {
56 | //使用通用接口
57 | mBaiduNaviCommonModule = NaviModuleFactory.getNaviModuleManager().getNaviCommonModule(
58 | NaviModuleImpl.BNaviCommonModuleConstants.ROUTE_GUIDE_MODULE, this,
59 | BNaviBaseCallbackModel.BNaviBaseCallbackConstants.CALLBACK_ROUTEGUIDE_TYPE, mOnNavigationListener);
60 | if (mBaiduNaviCommonModule != null)
61 | {
62 | mBaiduNaviCommonModule.onCreate();
63 | view = mBaiduNaviCommonModule.getView();
64 | }
65 |
66 | } else
67 | {
68 | //使用传统接口
69 | view = BNRouteGuideManager.getInstance().onCreate(this, mOnNavigationListener);
70 | }
71 |
72 |
73 | if (view != null)
74 | {
75 | setContentView(view);
76 | }
77 |
78 | Intent intent = getIntent();
79 | if (intent != null)
80 | {
81 | Bundle bundle = intent.getExtras();
82 | if (bundle != null)
83 | {
84 | mBNRoutePlanNode = (BNRoutePlanNode) bundle.getSerializable(MainActivity.ROUTE_PLAN_NODE);
85 | }
86 | }
87 | //显示自定义图标
88 | if (hd != null)
89 | {
90 | hd.sendEmptyMessageAtTime(MSG_SHOW, 5000);
91 | }
92 |
93 | BNEventHandler.getInstance().getDialog(this);
94 | BNEventHandler.getInstance().showDialog();
95 | }
96 |
97 | @Override
98 | protected void onResume()
99 | {
100 | super.onResume();
101 | if (useCommonInterface)
102 | {
103 | if (mBaiduNaviCommonModule != null)
104 | {
105 | mBaiduNaviCommonModule.onResume();
106 | }
107 | } else
108 | {
109 | BNRouteGuideManager.getInstance().onResume();
110 | }
111 |
112 |
113 | }
114 |
115 | protected void onPause()
116 | {
117 | super.onPause();
118 |
119 | if (useCommonInterface)
120 | {
121 | if (mBaiduNaviCommonModule != null)
122 | {
123 | mBaiduNaviCommonModule.onPause();
124 | }
125 | } else
126 | {
127 | BNRouteGuideManager.getInstance().onPause();
128 | }
129 |
130 | }
131 |
132 | ;
133 |
134 | @Override
135 | protected void onDestroy()
136 | {
137 | super.onDestroy();
138 | if (useCommonInterface)
139 | {
140 | if (mBaiduNaviCommonModule != null)
141 | {
142 | mBaiduNaviCommonModule.onDestroy();
143 | }
144 | } else
145 | {
146 | BNRouteGuideManager.getInstance().onDestroy();
147 | }
148 | MainActivity.activityList.remove(this);
149 | BNEventHandler.getInstance().disposeDialog();
150 | }
151 |
152 | @Override
153 | protected void onStop()
154 | {
155 | super.onStop();
156 | if (useCommonInterface)
157 | {
158 | if (mBaiduNaviCommonModule != null)
159 | {
160 | mBaiduNaviCommonModule.onStop();
161 | }
162 | } else
163 | {
164 | BNRouteGuideManager.getInstance().onStop();
165 | }
166 |
167 | }
168 |
169 | /*/
170 | * (non-Javadoc)
171 | * @see android.app.Activity#onBackPressed()
172 | * 此处onBackPressed传递false表示强制退出,true表示返回上一级,非强制退出
173 | */
174 | @Override
175 | public void onBackPressed()
176 | {
177 | if (useCommonInterface)
178 | {
179 | if (mBaiduNaviCommonModule != null)
180 | {
181 | mBaiduNaviCommonModule.onBackPressed(true);
182 | }
183 | } else
184 | {
185 | BNRouteGuideManager.getInstance().onBackPressed(false);
186 | }
187 | }
188 |
189 | public void onConfigurationChanged(android.content.res.Configuration newConfig)
190 | {
191 | super.onConfigurationChanged(newConfig);
192 | if (useCommonInterface)
193 | {
194 | if (mBaiduNaviCommonModule != null)
195 | {
196 | mBaiduNaviCommonModule.onConfigurationChanged(newConfig);
197 | }
198 | } else
199 | {
200 | BNRouteGuideManager.getInstance().onConfigurationChanged(newConfig);
201 | }
202 |
203 | }
204 |
205 | ;
206 |
207 |
208 | @Override
209 | public boolean onKeyDown(int keyCode, android.view.KeyEvent event)
210 | {
211 | if (useCommonInterface)
212 | {
213 | if (mBaiduNaviCommonModule != null)
214 | {
215 | Bundle mBundle = new Bundle();
216 | mBundle.putInt(RouteGuideModuleConstants.KEY_TYPE_KEYCODE, keyCode);
217 | mBundle.putParcelable(RouteGuideModuleConstants.KEY_TYPE_EVENT, event);
218 | mBaiduNaviCommonModule.setModuleParams(RouteGuideModuleConstants.METHOD_TYPE_ON_KEY_DOWN, mBundle);
219 | try
220 | {
221 | Boolean ret = (Boolean) mBundle.get(RET_COMMON_MODULE);
222 | if (ret)
223 | {
224 | return true;
225 | }
226 | } catch (Exception e)
227 | {
228 | e.printStackTrace();
229 | }
230 | }
231 | }
232 | return super.onKeyDown(keyCode, event);
233 | }
234 |
235 | @Override
236 | protected void onStart()
237 | {
238 | super.onStart();
239 | // TODO Auto-generated method stub
240 | if (useCommonInterface)
241 | {
242 | if (mBaiduNaviCommonModule != null)
243 | {
244 | mBaiduNaviCommonModule.onStart();
245 | }
246 | } else
247 | {
248 | BNRouteGuideManager.getInstance().onStart();
249 | }
250 | }
251 |
252 | private void addCustomizedLayerItems()
253 | {
254 | List items = new ArrayList();
255 | CustomizedLayerItem item1 = null;
256 | if (mBNRoutePlanNode != null)
257 | {
258 | item1 = new CustomizedLayerItem(mBNRoutePlanNode.getLongitude(), mBNRoutePlanNode.getLatitude(),
259 | mBNRoutePlanNode.getCoordinateType(), getResources().getDrawable(R.mipmap.ic_launcher),
260 | CustomizedLayerItem.ALIGN_CENTER);
261 | items.add(item1);
262 |
263 | BNRouteGuideManager.getInstance().setCustomizedLayerItems(items);
264 | }
265 | BNRouteGuideManager.getInstance().showCustomizedLayer(true);
266 | }
267 |
268 | private static final int MSG_SHOW = 1;
269 | private static final int MSG_HIDE = 2;
270 | private static final int MSG_RESET_NODE = 3;
271 | private Handler hd = null;
272 |
273 | private void createHandler()
274 | {
275 | if (hd == null)
276 | {
277 | hd = new Handler(getMainLooper())
278 | {
279 | public void handleMessage(android.os.Message msg)
280 | {
281 | if (msg.what == MSG_SHOW)
282 | {
283 | addCustomizedLayerItems();
284 | } else if (msg.what == MSG_HIDE)
285 | {
286 | BNRouteGuideManager.getInstance().showCustomizedLayer(false);
287 | } else if (msg.what == MSG_RESET_NODE)
288 | {
289 | BNRouteGuideManager.getInstance().resetEndNodeInNavi(
290 | new BNRoutePlanNode(116.21142, 40.85087, "百度大厦11", null, CoordinateType.GCJ02));
291 | }
292 | }
293 |
294 | ;
295 | };
296 | }
297 | }
298 |
299 | private OnNavigationListener mOnNavigationListener = new OnNavigationListener()
300 | {
301 |
302 | @Override
303 | public void onNaviGuideEnd()
304 | {
305 | //退出导航
306 | finish();
307 | }
308 |
309 | @Override
310 | public void notifyOtherAction(int actionType, int arg1, int arg2, Object obj)
311 | {
312 |
313 | if (actionType == 0)
314 | {
315 | //导航到达目的地 自动退出
316 | Log.i(TAG, "notifyOtherAction actionType = " + actionType + ",导航到达目的地!");
317 | }
318 |
319 | Log.i(TAG, "actionType:" + actionType + "arg1:" + arg1 + "arg2:" + arg2 + "obj:" + obj.toString());
320 | }
321 |
322 | };
323 |
324 | private final static String RET_COMMON_MODULE = "module.ret";
325 |
326 | private interface RouteGuideModuleConstants
327 | {
328 | final static int METHOD_TYPE_ON_KEY_DOWN = 0x01;
329 | final static String KEY_TYPE_KEYCODE = "keyCode";
330 | final static String KEY_TYPE_EVENT = "event";
331 | }
332 | }
333 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/BNEventDialog.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.graphics.Bitmap;
6 | import android.graphics.drawable.BitmapDrawable;
7 | import android.os.Bundle;
8 | import android.view.Gravity;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.Window;
12 | import android.view.WindowManager;
13 | import android.widget.ImageView;
14 | import android.widget.LinearLayout;
15 | import android.widget.TextView;
16 |
17 | public class BNEventDialog extends Dialog
18 | {
19 |
20 | private Context mContext;
21 |
22 | private LinearLayout mRouteGuideLl;
23 |
24 | private TextView mRemainTimeTx;
25 | private TextView mRemainDistanceTx; // 剩余总距离
26 | private TextView mCurrentSpeedTx;
27 |
28 | private ImageView mTurnImage;
29 | private TextView mGoDistanceTx;
30 | private TextView mNextRoadTx;
31 |
32 | private TextView mAlongMeters;
33 | private TextView mCurrentRoadTx;
34 |
35 | private ImageView mEnlargeImg;
36 |
37 | private TextView mLocateTx;
38 |
39 | public BNEventDialog(Context context)
40 | {
41 | super(context);
42 | mContext = context;
43 | }
44 |
45 | @Override
46 | protected void onCreate(Bundle savedInstanceState)
47 | {
48 | super.onCreate(savedInstanceState);
49 | requestWindowFeature(Window.FEATURE_NO_TITLE);
50 | LayoutInflater infalter = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
51 | View layout = infalter.inflate(R.layout.navi_event_dialog, null);
52 | setContentView(layout);
53 |
54 | if (layout == null)
55 | {
56 | return;
57 | }
58 |
59 | Window window = this.getWindow();
60 | WindowManager.LayoutParams lp = window.getAttributes();
61 | lp.width = 700;
62 | lp.height = 700;
63 | window.setAttributes(lp);
64 | window.setGravity(Gravity.BOTTOM | Gravity.LEFT);
65 |
66 | mRouteGuideLl = (LinearLayout) layout.findViewById(R.id.route_guide_ll);
67 |
68 | mRemainTimeTx = (TextView) layout.findViewById(R.id.remain_time_tx);
69 | mRemainDistanceTx = (TextView) layout.findViewById(R.id.remain_distance_tx);
70 | mCurrentSpeedTx = (TextView) layout.findViewById(R.id.current_speed_tx);
71 |
72 | mTurnImage = (ImageView) layout.findViewById(R.id.turn_img);
73 | mGoDistanceTx = (TextView) layout.findViewById(R.id.remain_distance);
74 | mNextRoadTx = (TextView) layout.findViewById(R.id.next_road_tx);
75 |
76 | mAlongMeters = (TextView) layout.findViewById(R.id.along_meters_tx);
77 | mCurrentRoadTx = (TextView) layout.findViewById(R.id.current_road_tx);
78 |
79 | mEnlargeImg = (ImageView) layout.findViewById(R.id.enlarge_view_img);
80 |
81 | mLocateTx = (TextView) layout.findViewById(R.id.loacte_tx);
82 | }
83 |
84 | public void updateLocateState(boolean hasLocate)
85 | {
86 | if (mLocateTx != null)
87 | {
88 | mLocateTx.setText(hasLocate ? "定位成功" : "定位中");
89 | }
90 | }
91 |
92 | public void onEnlageShow(int type, Bitmap arrowBmp, Bitmap bgBmp)
93 | {
94 | if (mEnlargeImg != null)
95 | {
96 | mEnlargeImg.setImageBitmap(arrowBmp);
97 | mEnlargeImg.setBackgroundDrawable(new BitmapDrawable(bgBmp));
98 | mEnlargeImg.setVisibility(View.VISIBLE);
99 | }
100 | if (mRouteGuideLl != null)
101 | {
102 | mRouteGuideLl.setVisibility(View.GONE);
103 | }
104 | }
105 |
106 | public void onEnlargeHide()
107 | {
108 | if (mEnlargeImg != null)
109 | {
110 | mEnlargeImg.setVisibility(View.GONE);
111 | }
112 | if (mRouteGuideLl != null)
113 | {
114 | mRouteGuideLl.setVisibility(View.VISIBLE);
115 | }
116 | }
117 |
118 | public void updateTurnIcon(Bitmap map)
119 | {
120 | if (mTurnImage != null)
121 | {
122 | mTurnImage.setImageBitmap(map);
123 | }
124 | }
125 |
126 | public void updateGoDistanceTx(String tx)
127 | {
128 | if (mGoDistanceTx != null)
129 | {
130 | mGoDistanceTx.setText(tx);
131 | }
132 | }
133 |
134 | public void updateNextRoad(String nextRoad)
135 | {
136 | if (mNextRoadTx != null)
137 | {
138 | mNextRoadTx.setText(nextRoad);
139 | }
140 | }
141 |
142 | public void updateAlongMeters(String alongMeters)
143 | {
144 | if (mAlongMeters != null)
145 | {
146 | mAlongMeters.setText(alongMeters);
147 | }
148 | }
149 |
150 | public void updateCurrentRoad(String currentRoad)
151 | {
152 | if (mCurrentRoadTx != null)
153 | {
154 | mCurrentRoadTx.setText(currentRoad);
155 | }
156 | }
157 |
158 | public void updateCurrentSpeed(String speed)
159 | {
160 | if (mCurrentSpeedTx != null)
161 | {
162 | mCurrentSpeedTx.setText(speed);
163 | }
164 | }
165 |
166 | public void updateRemainDistance(String distance)
167 | {
168 | if (mRemainDistanceTx != null)
169 | {
170 | mRemainDistanceTx.setText(distance);
171 | }
172 | }
173 |
174 | public void updateRemainTime(String time)
175 | {
176 | if (mRemainTimeTx != null)
177 | {
178 | mRemainTimeTx.setText(time);
179 | }
180 | }
181 | }
182 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/BNEventHandler.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.graphics.BitmapFactory;
6 | import android.os.Bundle;
7 | import android.text.TextUtils;
8 | import android.util.Log;
9 |
10 | import com.baidu.navisdk.adapter.BNaviCommonParams;
11 |
12 | public class BNEventHandler
13 | {
14 |
15 | private BNEventDialog mEventDialog = null;
16 |
17 | private static class LazyLoader
18 | {
19 | private static BNEventHandler mInstance = new BNEventHandler();
20 | }
21 |
22 | public static BNEventHandler getInstance()
23 | {
24 | return LazyLoader.mInstance;
25 | }
26 |
27 | private BNEventHandler()
28 | {
29 | }
30 |
31 | public BNEventDialog getDialog(Context ctx)
32 | {
33 | if (mEventDialog == null)
34 | {
35 | mEventDialog = new BNEventDialog(ctx);
36 | }
37 | return mEventDialog;
38 | }
39 |
40 | public void showDialog()
41 | {
42 | if (mEventDialog != null)
43 | {
44 | mEventDialog.setCanceledOnTouchOutside(false);
45 | mEventDialog.show();
46 | }
47 | }
48 |
49 | public void dismissDialog()
50 | {
51 | if (mEventDialog != null)
52 | {
53 | mEventDialog.dismiss();
54 | }
55 | }
56 |
57 | public void disposeDialog()
58 | {
59 | mEventDialog = null;
60 | }
61 |
62 | public void handleNaviEvent(int what, int arg1, int arg2, Bundle bundle)
63 | {
64 | Log.i("onCommonEventCall", String.format("%d,%d,%d,%s", what, arg1, arg2,
65 | (bundle == null ? "" : bundle.toString())));
66 | switch (what)
67 | {
68 | case BNaviCommonParams.MessageType.EVENT_NAVIGATING_STATE_BEGIN:
69 | break;
70 | case BNaviCommonParams.MessageType.EVENT_NAVIGATING_STATE_END:
71 | break;
72 | case BNaviCommonParams.MessageType.EVENT_GPS_LOCATED:
73 | mEventDialog.updateLocateState(true);
74 | break;
75 | case BNaviCommonParams.MessageType.EVENT_GPS_DISMISS:
76 | mEventDialog.updateLocateState(false);
77 | break;
78 | case BNaviCommonParams.MessageType.EVENT_ON_YAW_SUCCESS:
79 | break;
80 | case BNaviCommonParams.MessageType.EVENT_ROAD_TURN_ICON_UPDATE:
81 | byte[] byteArray = bundle.getByteArray(BNaviCommonParams.BNGuideKey.ROAD_TURN_ICON);
82 | Bitmap map = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
83 | Log.e("长度:",byteArray.length+"");
84 | mEventDialog.updateTurnIcon(map);
85 | break;
86 | case BNaviCommonParams.MessageType.EVENT_ROAD_TURN_DISTANCE_UPDATE:
87 | String turndis = bundle.getString(BNaviCommonParams.BNGuideKey.TROAD_TURN_DISTANCE);
88 | mEventDialog.updateGoDistanceTx(turndis);
89 | mEventDialog.updateAlongMeters(turndis);
90 | break;
91 | case BNaviCommonParams.MessageType.EVENT_ROAD_NEXT_ROAD_NAME:
92 | String nextRoad = bundle.getString(BNaviCommonParams.BNGuideKey.NEXT_ROAD_NAME);
93 | if (!TextUtils.isEmpty(nextRoad))
94 | {
95 | mEventDialog.updateNextRoad(nextRoad);
96 | }
97 | break;
98 | case BNaviCommonParams.MessageType.EVENT_ROAD_CURRENT_ROAD_NAME:
99 | String currentRoad = bundle.getString(BNaviCommonParams.BNGuideKey.CURRENT_ROAD_NAME);
100 | if (!TextUtils.isEmpty(currentRoad))
101 | {
102 | mEventDialog.updateCurrentRoad(currentRoad);
103 | }
104 | break;
105 | case BNaviCommonParams.MessageType.EVENT_REMAIN_DISTANCE_UPDATE:
106 | String remainDisctance = bundle.getString(BNaviCommonParams.BNGuideKey.TOTAL_REMAIN_DISTANCE);
107 | mEventDialog.updateRemainDistance(remainDisctance);
108 | break;
109 | case BNaviCommonParams.MessageType.EVENT_REMAIN_TIME_UPDATE:
110 | String remainTime = bundle.getString(BNaviCommonParams.BNGuideKey.TOTAL_REMAIN_TIME);
111 | mEventDialog.updateRemainTime(remainTime);
112 | break;
113 | case BNaviCommonParams.MessageType.EVENT_RASTER_MAP_SHOW:
114 | int type = bundle.getInt(BNaviCommonParams.BNEnlargeRoadKey.ENLARGE_TYPE);
115 | byte[] arrowByte = bundle.getByteArray(BNaviCommonParams.BNEnlargeRoadKey.ARROW_IMAGE);
116 | byte[] bgByte = bundle.getByteArray(BNaviCommonParams.BNEnlargeRoadKey.BACKGROUND_IMAGE);
117 | Bitmap arrowMap = BitmapFactory.decodeByteArray(arrowByte, 0, arrowByte.length);
118 | Log.e("长度:",arrowByte.length+"");
119 | Bitmap bgMap = BitmapFactory.decodeByteArray(bgByte, 0, bgByte.length);
120 | Log.e("长度:",bgByte.length+"");
121 | mEventDialog.onEnlageShow(type, arrowMap, bgMap);
122 | break;
123 | case BNaviCommonParams.MessageType.EVENT_RASTER_MAP_UPDATE:
124 | String remainDistance = bundle.getString(BNaviCommonParams.BNEnlargeRoadKey.REMAIN_DISTANCE);
125 | String roadName = bundle.getString(BNaviCommonParams.BNEnlargeRoadKey.ROAD_NAME);
126 | int progress = bundle.getInt(BNaviCommonParams.BNEnlargeRoadKey.DRIVE_PROGRESS);
127 | break;
128 | case BNaviCommonParams.MessageType.EVENT_RASTER_MAP_HIDE:
129 | mEventDialog.onEnlargeHide();
130 | break;
131 | case BNaviCommonParams.MessageType.EVENT_ROUTE_PLAN_SUCCESS:
132 | int distance = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.TOTAL_DISTANCE);
133 | int time = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.TOTAL_TIME);
134 | int tollFees = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.TOLL_FESS);
135 | int lightCounts = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.TRAFFIC_LIGHT);
136 | int gasMoney = bundle.getInt(BNaviCommonParams.BNRouteInfoKey.GAS_MONEY);
137 | break;
138 | case BNaviCommonParams.MessageType.EVENT_SERVICE_AREA_UPDATE:
139 | String firstName = bundle.getString(BNaviCommonParams.BNGuideKey.FIRST_SERVICE_NAME);
140 | int firstDistance = bundle.getInt(BNaviCommonParams.BNGuideKey.FIRST_SERVICE_TIME);
141 | String secondeName = bundle.getString(BNaviCommonParams.BNGuideKey.SECOND_SERVICE_NAME);
142 | int secondeDistance = bundle.getInt(BNaviCommonParams.BNGuideKey.SECOND_SERVICE_TIME);
143 | break;
144 | case BNaviCommonParams.MessageType.EVENT_CURRENT_SPEED:
145 | mEventDialog.updateCurrentSpeed(String.valueOf(arg1));
146 | break;
147 | case BNaviCommonParams.MessageType.EVENT_ALONG_UPDATE:
148 | boolean isAlong = bundle.getBoolean(BNaviCommonParams.BNGuideKey.IS_ALONG);
149 | break;
150 | case BNaviCommonParams.MessageType.EVENT_CURRENT_MILES:
151 | int miles = arg1;
152 | default:
153 | break;
154 | }
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/Base64.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | public final class Base64 {
4 |
5 | private static final int BASELENGTH = 128;
6 | private static final int LOOKUPLENGTH = 64;
7 | private static final int TWENTYFOURBITGROUP = 24;
8 | private static final int EIGHTBIT = 8;
9 | private static final int SIXTEENBIT = 16;
10 | private static final int FOURBYTE = 4;
11 | private static final int SIGN = -128;
12 | private static char PAD = '=';
13 | private static byte[] base64Alphabet = new byte[BASELENGTH];
14 | private static char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
15 |
16 | static {
17 | for (int i = 0; i < BASELENGTH; ++i) {
18 | base64Alphabet[i] = -1;
19 | }
20 | for (int i = 'Z'; i >= 'A'; i--) {
21 | base64Alphabet[i] = (byte) (i - 'A');
22 | }
23 | for (int i = 'z'; i >= 'a'; i--) {
24 | base64Alphabet[i] = (byte) (i - 'a' + 26);
25 | }
26 |
27 | for (int i = '9'; i >= '0'; i--) {
28 | base64Alphabet[i] = (byte) (i - '0' + 52);
29 | }
30 |
31 | base64Alphabet['+'] = 62;
32 | base64Alphabet['/'] = 63;
33 |
34 | for (int i = 0; i <= 25; i++) {
35 | lookUpBase64Alphabet[i] = (char) ('A' + i);
36 | }
37 |
38 | for (int i = 26, j = 0; i <= 51; i++, j++) {
39 | lookUpBase64Alphabet[i] = (char) ('a' + j);
40 | }
41 |
42 | for (int i = 52, j = 0; i <= 61; i++, j++) {
43 | lookUpBase64Alphabet[i] = (char) ('0' + j);
44 | }
45 | lookUpBase64Alphabet[62] = (char) '+';
46 | lookUpBase64Alphabet[63] = (char) '/';
47 |
48 | }
49 |
50 | private static boolean isWhiteSpace(char octect) {
51 | return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
52 | }
53 |
54 | private static boolean isPad(char octect) {
55 | return (octect == PAD);
56 | }
57 |
58 | private static boolean isData(char octect) {
59 | return (octect < BASELENGTH && base64Alphabet[octect] != -1);
60 | }
61 |
62 | /**
63 | * Encodes hex octects into Base64
64 | *
65 | * @param binaryData
66 | * Array containing binaryData
67 | * @return Encoded Base64 array
68 | */
69 | public static String encode(byte[] binaryData) {
70 |
71 | if (binaryData == null) {
72 | return null;
73 | }
74 |
75 | int lengthDataBits = binaryData.length * EIGHTBIT;
76 | if (lengthDataBits == 0) {
77 | return "";
78 | }
79 |
80 | int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
81 | int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
82 | int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1
83 | : numberTriplets;
84 | char encodedData[] = null;
85 |
86 | encodedData = new char[numberQuartet * 4];
87 |
88 | byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
89 |
90 | int encodedIndex = 0;
91 | int dataIndex = 0;
92 |
93 | for (int i = 0; i < numberTriplets; i++) {
94 | b1 = binaryData[dataIndex++];
95 | b2 = binaryData[dataIndex++];
96 | b3 = binaryData[dataIndex++];
97 |
98 | l = (byte) (b2 & 0x0f);
99 | k = (byte) (b1 & 0x03);
100 |
101 | byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2)
102 | : (byte) ((b1) >> 2 ^ 0xc0);
103 | byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4)
104 | : (byte) ((b2) >> 4 ^ 0xf0);
105 | byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6)
106 | : (byte) ((b3) >> 6 ^ 0xfc);
107 |
108 | encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
109 | encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
110 | encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
111 | encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
112 | }
113 |
114 | // form integral number of 6-bit groups
115 | if (fewerThan24bits == EIGHTBIT) {
116 | b1 = binaryData[dataIndex];
117 | k = (byte) (b1 & 0x03);
118 |
119 | byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2)
120 | : (byte) ((b1) >> 2 ^ 0xc0);
121 | encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
122 | encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
123 | encodedData[encodedIndex++] = PAD;
124 | encodedData[encodedIndex++] = PAD;
125 | } else if (fewerThan24bits == SIXTEENBIT) {
126 | b1 = binaryData[dataIndex];
127 | b2 = binaryData[dataIndex + 1];
128 | l = (byte) (b2 & 0x0f);
129 | k = (byte) (b1 & 0x03);
130 |
131 | byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2)
132 | : (byte) ((b1) >> 2 ^ 0xc0);
133 | byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4)
134 | : (byte) ((b2) >> 4 ^ 0xf0);
135 |
136 | encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
137 | encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
138 | encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
139 | encodedData[encodedIndex++] = PAD;
140 | }
141 |
142 | return new String(encodedData);
143 | }
144 |
145 | /**
146 | * Decodes Base64 data into octects
147 | *
148 | * @param encoded
149 | * string containing Base64 data
150 | * @return Array containind decoded data.
151 | */
152 | public static byte[] decode(String encoded) {
153 |
154 | if (encoded == null) {
155 | return null;
156 | }
157 |
158 | char[] base64Data = encoded.toCharArray();
159 | // remove white spaces
160 | int len = removeWhiteSpace(base64Data);
161 |
162 | if (len % FOURBYTE != 0) {
163 | return null;// should be divisible by four
164 | }
165 |
166 | int numberQuadruple = (len / FOURBYTE);
167 |
168 | if (numberQuadruple == 0) {
169 | return new byte[0];
170 | }
171 |
172 | byte decodedData[] = null;
173 | byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
174 | char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
175 |
176 | int i = 0;
177 | int encodedIndex = 0;
178 | int dataIndex = 0;
179 | decodedData = new byte[(numberQuadruple) * 3];
180 |
181 | for (; i < numberQuadruple - 1; i++) {
182 |
183 | if (!isData((d1 = base64Data[dataIndex++]))
184 | || !isData((d2 = base64Data[dataIndex++]))
185 | || !isData((d3 = base64Data[dataIndex++]))
186 | || !isData((d4 = base64Data[dataIndex++]))) {
187 | return null;
188 | }// if found "no data" just return null
189 |
190 | b1 = base64Alphabet[d1];
191 | b2 = base64Alphabet[d2];
192 | b3 = base64Alphabet[d3];
193 | b4 = base64Alphabet[d4];
194 |
195 | decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
196 | decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
197 | decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
198 | }
199 |
200 | if (!isData((d1 = base64Data[dataIndex++]))
201 | || !isData((d2 = base64Data[dataIndex++]))) {
202 | return null;// if found "no data" just return null
203 | }
204 |
205 | b1 = base64Alphabet[d1];
206 | b2 = base64Alphabet[d2];
207 |
208 | d3 = base64Data[dataIndex++];
209 | d4 = base64Data[dataIndex++];
210 | if (!isData((d3)) || !isData((d4))) {// Check if they are PAD characters
211 | if (isPad(d3) && isPad(d4)) {
212 | if ((b2 & 0xf) != 0)// last 4 bits should be zero
213 | {
214 | return null;
215 | }
216 | byte[] tmp = new byte[i * 3 + 1];
217 | System.arraycopy(decodedData, 0, tmp, 0, i * 3);
218 | tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
219 | return tmp;
220 | } else if (!isPad(d3) && isPad(d4)) {
221 | b3 = base64Alphabet[d3];
222 | if ((b3 & 0x3) != 0)// last 2 bits should be zero
223 | {
224 | return null;
225 | }
226 | byte[] tmp = new byte[i * 3 + 2];
227 | System.arraycopy(decodedData, 0, tmp, 0, i * 3);
228 | tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
229 | tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
230 | return tmp;
231 | } else {
232 | return null;
233 | }
234 | } else { // No PAD e.g 3cQl
235 | b3 = base64Alphabet[d3];
236 | b4 = base64Alphabet[d4];
237 | decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
238 | decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
239 | decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
240 |
241 | }
242 |
243 | return decodedData;
244 | }
245 |
246 | /**
247 | * remove WhiteSpace from MIME containing encoded Base64 data.
248 | *
249 | * @param data
250 | * the byte array of base64 data (with WS)
251 | * @return the new length
252 | */
253 | private static int removeWhiteSpace(char[] data) {
254 | if (data == null) {
255 | return 0;
256 | }
257 |
258 | // count characters that's not whitespace
259 | int newSize = 0;
260 | int len = data.length;
261 | for (int i = 0; i < len; i++) {
262 | if (!isWhiteSpace(data[i])) {
263 | data[newSize++] = data[i];
264 | }
265 | }
266 | return newSize;
267 | }
268 | }
269 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/BaseUIListener.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.os.Handler;
6 | import android.os.Message;
7 |
8 | import com.dyf.utils.SysoUtils;
9 | import com.dyf.utils.Util;
10 | import com.tencent.tauth.IUiListener;
11 | import com.tencent.tauth.UiError;
12 |
13 | import org.json.JSONObject;
14 |
15 | public class BaseUIListener implements IUiListener {
16 | private Context mContext;
17 | private String mScope;
18 | private boolean mIsCaneled;
19 | private static final int ON_COMPLETE = 0;
20 | private static final int ON_ERROR = 1;
21 | private static final int ON_CANCEL = 2;
22 | private Handler mHandler = new Handler() {
23 | @Override
24 | public void handleMessage(Message msg) {
25 | switch (msg.what) {
26 | case ON_COMPLETE:
27 | JSONObject response = (JSONObject)msg.obj;
28 | SysoUtils.print("sys login response:"+response.toString());
29 | Util.showResultDialog(mContext, response.toString(), "onComplete");
30 | Util.dismissDialog();
31 | break;
32 | case ON_ERROR:
33 | UiError e = (UiError)msg.obj;
34 | Util.showResultDialog(mContext, "errorMsg:" + e.errorMessage
35 | + "errorDetail:" + e.errorDetail, "onError");
36 | Util.dismissDialog();
37 | break;
38 | case ON_CANCEL:
39 | Util.toastMessage((Activity)mContext, "onCancel");
40 | break;
41 | }
42 | }
43 | };
44 |
45 | public BaseUIListener(Context mContext) {
46 | super();
47 | this.mContext = mContext;
48 | }
49 |
50 |
51 | public BaseUIListener(Context mContext, String mScope) {
52 | super();
53 | this.mContext = mContext;
54 | this.mScope = mScope;
55 | }
56 |
57 | public void cancel() {
58 | mIsCaneled = true;
59 | }
60 |
61 |
62 | @Override
63 | public void onComplete(Object response) {
64 | if (mIsCaneled) return;
65 | Message msg = mHandler.obtainMessage();
66 | msg.what = ON_COMPLETE;
67 | msg.obj = response;
68 | mHandler.sendMessage(msg);
69 | }
70 |
71 | @Override
72 | public void onError(UiError e) {
73 | if (mIsCaneled) return;
74 | Message msg = mHandler.obtainMessage();
75 | msg.what = ON_ERROR;
76 | msg.obj = e;
77 | mHandler.sendMessage(msg);
78 | }
79 |
80 | @Override
81 | public void onCancel() {
82 | if (mIsCaneled) return;
83 | Message msg = mHandler.obtainMessage();
84 | msg.what = ON_CANCEL;
85 | mHandler.sendMessage(msg);
86 | }
87 |
88 | public Context getmContext() {
89 | return mContext;
90 | }
91 |
92 | public void setmContext(Context mContext) {
93 | this.mContext = mContext;
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/BindPlateNumActivity.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.app.AlertDialog;
4 | import android.content.DialogInterface;
5 | import android.content.Intent;
6 | import android.content.SharedPreferences;
7 | import android.os.Handler;
8 | import android.os.Message;
9 | import android.support.v7.app.AppCompatActivity;
10 | import android.os.Bundle;
11 | import android.view.View;
12 | import android.widget.Button;
13 | import android.widget.EditText;
14 | import android.widget.TextView;
15 |
16 | import com.dyf.utils.SendRequest;
17 |
18 | public class BindPlateNumActivity extends AppCompatActivity implements View.OnClickListener {
19 |
20 | private EditText et_plateNum;
21 | private Button btn_bind;
22 |
23 | SharedPreferences shareData;
24 | String nickname,openid;
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.activity_bind_plate_num);
30 |
31 | initView();
32 | // 获取sharedpreferences的数据(nickname)
33 | getShareData();
34 | // 查找数据库中是否已经有车牌号,显示在界面中
35 | getPlateNum();
36 |
37 | }
38 | // 查找数据库中是否已经有车牌号,显示在界面中
39 | private void getPlateNum() {
40 | new Thread(){
41 | @Override
42 | public void run() {
43 | Message msg = new Message();
44 | msg.what = 2;
45 | msg.obj = SendRequest.selectPlateNum(openid);
46 | mHandler.sendMessage(msg);
47 | }
48 | }.start();
49 | }
50 |
51 | private void initView() {
52 | et_plateNum = (EditText) findViewById(R.id.id_et_platenum);
53 | btn_bind = (Button) findViewById(R.id.id_btn_bind);
54 |
55 | btn_bind.setOnClickListener(this);
56 | }
57 |
58 | @Override
59 | public void onClick(View view) {
60 | switch (view.getId()) {
61 | case R.id.id_btn_bind :
62 | String plateNum = et_plateNum.getText().toString();
63 | bindPlateNum(openid,plateNum);
64 | }
65 |
66 | }
67 |
68 | // 进行绑定操作
69 | private void bindPlateNum(final String openid, final String plateNum) {
70 | new Thread(){
71 | @Override
72 | public void run() {
73 | Message msg = new Message();
74 | msg.what = 1;
75 | msg.obj = SendRequest.updatePlateNum(openid,plateNum);
76 | mHandler.sendMessage(msg);
77 | }
78 | }.start();
79 | }
80 |
81 |
82 | private Handler mHandler = new Handler(){
83 | @Override
84 | public void handleMessage(Message msg) {
85 | switch (msg.what) {
86 | // 绑定车牌号
87 | case 1:
88 | int i = Integer.parseInt(msg.obj.toString());
89 | if (i == 1) {
90 | AlertDialog.Builder alertDialog = new AlertDialog.Builder(BindPlateNumActivity.this);
91 | alertDialog.setTitle("提示");
92 | alertDialog.setMessage("绑定成功");
93 | alertDialog.show();
94 | Intent intent = new Intent(BindPlateNumActivity.this,MainActivity.class);
95 | startActivity(intent);
96 | }
97 | break;
98 |
99 | // 查询数据库中如果存在指定账号的车牌号,则显示在界面中
100 | case 2:
101 | String plateNum = msg.obj.toString();
102 | et_plateNum.setText(plateNum);
103 | break;
104 |
105 | default:
106 | break;
107 | }
108 |
109 | }
110 | };
111 |
112 | // 获取sharedpreferences的数据(nickname)
113 | private void getShareData() {
114 | shareData = getSharedPreferences("data", 0);
115 | nickname = shareData.getString("nickname", "未登录");
116 | openid = shareData.getString("openid","未登录");
117 |
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/EvaluateActivity.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.app.AlertDialog;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.SharedPreferences;
7 | import android.os.Handler;
8 | import android.os.Message;
9 | import android.support.v7.app.AppCompatActivity;
10 | import android.os.Bundle;
11 | import android.view.View;
12 | import android.widget.Button;
13 | import android.widget.EditText;
14 | import android.widget.RadioButton;
15 | import android.widget.RadioGroup;
16 | import android.widget.TextView;
17 |
18 | import com.dyf.utils.SendRequest;
19 | import com.dyf.utils.SysoUtils;
20 |
21 | public class EvaluateActivity extends AppCompatActivity {
22 |
23 | private Context context;
24 | private EditText etEvaluateContent;
25 | private Button mBtnSubmit;
26 | private TextView tv_nickname;
27 | private String nickName,openid,evaluateScore; // 分别是昵称,openid,评价分数
28 | private RadioGroup rg_evaluatenum;
29 | private RadioButton rb_one;
30 | private RadioButton rb_two;
31 | private RadioButton rb_three;
32 | private RadioButton rb_four;
33 | private RadioButton rb_five;
34 | private RadioButton rb_checked;
35 |
36 | SharedPreferences shareData;
37 |
38 | @Override
39 | protected void onCreate(Bundle savedInstanceState) {
40 | super.onCreate(savedInstanceState);
41 | setContentView(R.layout.activity_evaluate);
42 | context = this;
43 |
44 | // 初始化控件
45 | initView();
46 | // 获取sharedpreferences的数据(nickname)
47 | getShareData();
48 |
49 | // 提交按钮点击
50 | mBtnSubmit.setOnClickListener(new btnSubmitOnClickListener());
51 | }
52 |
53 | // 初始化控件
54 | private void initView() {
55 | tv_nickname = (TextView) findViewById(R.id.id_tv_nickname);
56 | mBtnSubmit = (Button) findViewById(R.id.id_btn_evaluatesubmit);
57 | etEvaluateContent = (EditText) findViewById(R.id.id_et_evaluatecontent);
58 | rg_evaluatenum = (RadioGroup) findViewById(R.id.rg_evaluatenum);
59 | rb_one = (RadioButton) findViewById(R.id.rb_one);
60 | rb_two = (RadioButton) findViewById(R.id.rb_two);
61 | rb_three = (RadioButton) findViewById(R.id.rb_three);
62 | rb_four = (RadioButton) findViewById(R.id.rb_four);
63 | rb_five = (RadioButton) findViewById(R.id.rb_five);
64 | }
65 |
66 | // 获取sharedpreferences的数据(nickname)
67 | private void getShareData() {
68 | shareData = getSharedPreferences("data", 0);
69 | nickName = shareData.getString("nickname", "未登录");
70 | openid = shareData.getString("openid","未登录");
71 | tv_nickname.setText(nickName);
72 | }
73 |
74 | // 提交评价按钮
75 | private class btnSubmitOnClickListener implements View.OnClickListener {
76 | @Override
77 | public void onClick(View view) {
78 | rb_checked = (RadioButton) findViewById(rg_evaluatenum.getCheckedRadioButtonId());
79 | evaluateScore = rb_checked.getText().toString();
80 | SysoUtils.print("sys evaluateScore:" + evaluateScore);
81 | final String evaluateContent = etEvaluateContent.getText().toString();
82 |
83 | new Thread(){
84 | @Override
85 | public void run() {
86 | Message msg = new Message();
87 | msg.what =1;
88 | msg.obj = SendRequest.submitEvaluate(openid,evaluateScore,evaluateContent);
89 | mHandler.sendMessage(msg);
90 | }
91 | }.start();
92 | }
93 | }
94 |
95 | private Handler mHandler = new Handler(){
96 | @Override
97 | public void handleMessage(Message msg) {
98 | switch (msg.what) {
99 | case 1:
100 | int i = Integer.parseInt(msg.obj.toString());
101 | if (i == 1) {
102 | AlertDialog.Builder alertDialog = new AlertDialog.Builder(EvaluateActivity.this);
103 | alertDialog.setTitle("提示");
104 | alertDialog.setMessage("提交成功");
105 | alertDialog.show();
106 | // Intent intent = new Intent(EvaluateActivity.this,MainActivity.class);
107 | // startActivity(intent);
108 | } else {
109 | AlertDialog.Builder alertDialog = new AlertDialog.Builder(EvaluateActivity.this);
110 | alertDialog.setTitle("提示");
111 | alertDialog.setMessage("提交失败");
112 | alertDialog.show();
113 | }
114 | break;
115 | }
116 |
117 | }
118 | };
119 | }
120 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/Info.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @deprecated 用来保存覆盖物信息的bean类
7 | * Created by diy on 2017-11-06.
8 | */
9 |
10 | public class Info implements Serializable
11 | {
12 |
13 | private static final long serialVersionUID = 7883466441142792991L;
14 | private int imgId; //图片ID,实际项目中,图片这里应该是URL
15 | private String parklotName; //停车场名称
16 | private int distance;//车辆距离停车场的距离,单位 米
17 | private int time; //车辆行驶到停车场所需的时间 单位秒
18 | private int zan; //点赞数量
19 | private int noParkNum; //停车场的未停车数
20 | private double noParkRate; //停车场的未停车率
21 | private int parklotAmount; // 停车场车位数量
22 | private String parklotLng; // 停车场位置精度
23 | private String parklotLat; // 停车场位置纬度
24 | private String parklotDescription; // 停车场描述
25 |
26 | //public static List infos = new ArrayList();
27 |
28 |
29 | /**
30 | * 没有赞,未停车率和图片id
31 | * @param parklotName
32 | * @param distance
33 | * @param time
34 | * @param noParkNum
35 | * @param parklotAmount
36 | * @param parklotLng
37 | * @param parklotLat
38 | * @param parklotDescription
39 | */
40 | public Info(String parklotName, int distance, int time, int noParkNum, int parklotAmount, String parklotLng, String parklotLat, String parklotDescription)
41 | {
42 | this.parklotName = parklotName;
43 | this.distance = distance;
44 | this.time = time;
45 | this.noParkNum = noParkNum;
46 | this.parklotAmount = parklotAmount;
47 | this.parklotLng = parklotLng;
48 | this.parklotLat = parklotLat;
49 | this.parklotDescription = parklotDescription;
50 | }
51 |
52 | public int getImgId()
53 | {
54 | return imgId;
55 | }
56 |
57 | public void setImgId(int imgId)
58 | {
59 | this.imgId = imgId;
60 | }
61 |
62 | public String getParklotName()
63 | {
64 | return parklotName;
65 | }
66 |
67 | public void setParklotName(String parklotName)
68 | {
69 | this.parklotName = parklotName;
70 | }
71 |
72 | public int getDistance()
73 | {
74 | return distance;
75 | }
76 |
77 | public void setDistance(int distance)
78 | {
79 | this.distance = distance;
80 | }
81 |
82 | public int getTime()
83 | {
84 | return time;
85 | }
86 |
87 | public void setTime(int time)
88 | {
89 | this.time = time;
90 | }
91 |
92 | public int getZan()
93 | {
94 | return zan;
95 | }
96 |
97 | public void setZan(int zan)
98 | {
99 | this.zan = zan;
100 | }
101 |
102 | public int getNoParkNum()
103 | {
104 | return noParkNum;
105 | }
106 |
107 | public void setNoParkNum(int noParkNum)
108 | {
109 | this.noParkNum = noParkNum;
110 | }
111 |
112 | public double getNoParkRate()
113 | {
114 | return noParkRate;
115 | }
116 |
117 | public void setNoParkRate(double noParkRate)
118 | {
119 | this.noParkRate = noParkRate;
120 | }
121 |
122 | public int getParklotAmount()
123 | {
124 | return parklotAmount;
125 | }
126 |
127 | public void setParklotAmount(int parklotAmount)
128 | {
129 | this.parklotAmount = parklotAmount;
130 | }
131 |
132 | public String getParklotLng()
133 | {
134 | return parklotLng;
135 | }
136 |
137 | public void setParklotLng(String parklotLng)
138 | {
139 | this.parklotLng = parklotLng;
140 | }
141 |
142 | public String getParklotLat()
143 | {
144 | return parklotLat;
145 | }
146 |
147 | public void setParklotLat(String parklotLat)
148 | {
149 | this.parklotLat = parklotLat;
150 | }
151 |
152 | public String getParklotDescription()
153 | {
154 | return parklotDescription;
155 | }
156 |
157 | public void setParklotDescription(String parklotDescription)
158 | {
159 | this.parklotDescription = parklotDescription;
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/MyOrientationListener.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.content.Context;
4 | import android.hardware.Sensor;
5 | import android.hardware.SensorEvent;
6 | import android.hardware.SensorEventListener;
7 | import android.hardware.SensorManager;
8 |
9 | import static android.hardware.Sensor.TYPE_ORIENTATION;
10 |
11 | /**
12 | * @deprecated 使用手机的方向传感器
13 | * Created by diy on 2017-11-05.
14 | */
15 |
16 | public class MyOrientationListener extends Object implements SensorEventListener
17 | {
18 | //使用传感器需要先获得传感器的管理者
19 | private SensorManager mSensorManager;
20 | private Context mContext;
21 | private Sensor mSensor;
22 | //方向传感器关心三个轴的坐标,xyz
23 | private float lastX;
24 |
25 | public MyOrientationListener(Context context)
26 | {
27 | this.mContext = context;
28 | }
29 |
30 | //开始监听
31 | public void start()
32 | {
33 | mSensorManager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
34 | if (mSensorManager!=null)
35 | {
36 | //获得方向传感器
37 | mSensor = mSensorManager.getDefaultSensor(TYPE_ORIENTATION);
38 | }
39 | if(mSensor != null)
40 | {
41 | mSensorManager.registerListener(this,mSensor,SensorManager.SENSOR_DELAY_UI);
42 |
43 | }
44 | }
45 |
46 | //结束监听
47 | public void stop()
48 | {
49 | mSensorManager.unregisterListener(this);
50 | }
51 |
52 | @Override
53 | public void onSensorChanged(SensorEvent event)
54 | {
55 | //当检测到的是方向传感器
56 | if ((event.sensor.getType() == Sensor.TYPE_ORIENTATION))
57 | {
58 | float x = event.values[SensorManager.DATA_X];
59 | //方向改变之后,和原来做对比,如果大于1度的话
60 | if (Math.abs(x-lastX) > 1.0)
61 | {
62 | //通知主界面去更新
63 | if (mOnOrientationListener != null)
64 | {
65 | //进行一个回调
66 | mOnOrientationListener.onOrientationChanged(x);
67 | }
68 | }
69 | lastX = x;
70 | }
71 | }
72 |
73 | private OnOrientationListener mOnOrientationListener;
74 |
75 | public void setOnOrientationListener(OnOrientationListener mOnOrientationListener)
76 | {
77 | this.mOnOrientationListener = mOnOrientationListener;
78 | }
79 |
80 | public interface OnOrientationListener
81 | {
82 | void onOrientationChanged(float x);
83 | }
84 |
85 | //经度改变
86 | @Override
87 | public void onAccuracyChanged(Sensor sensor, int accuracy)
88 | {
89 |
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/PayResult.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
import android.text.TextUtils;
import java.util.Map;
public class PayResult {
private String resultStatus;
private String result;
private String memo;
public PayResult(Map rawResult) {
if (rawResult == null) {
return;
}
for (String key : rawResult.keySet()) {
if (TextUtils.equals(key, "resultStatus")) {
resultStatus = rawResult.get(key);
} else if (TextUtils.equals(key, "result")) {
result = rawResult.get(key);
} else if (TextUtils.equals(key, "memo")) {
memo = rawResult.get(key);
}
}
}
@Override
public String toString() {
return "resultStatus={" + resultStatus + "};memo={" + memo
+ "};result={" + result + "}";
}
/**
* @return the resultStatus
*/
public String getResultStatus() {
return resultStatus;
}
/**
* @return the memo
*/
public String getMemo() {
return memo;
}
/**
* @return the result
*/
public String getResult() {
return result;
}
}
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/ReChargeActivity.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.app.Activity;
5 |
6 | import android.app.AlertDialog;
7 | import android.content.DialogInterface;
8 | import android.content.SharedPreferences;
9 | import android.os.Bundle;
10 | import android.os.Handler;
11 | import android.os.Message;
12 | import android.support.v4.app.FragmentActivity;
13 | import android.text.TextUtils;
14 | import android.util.Log;
15 | import android.view.View;
16 | import android.widget.Button;
17 | import android.widget.RadioButton;
18 | import android.widget.RadioGroup;
19 | import android.widget.TextView;
20 | import android.widget.Toast;
21 |
22 | import com.dyf.utils.AlipayConstants;
23 | import com.dyf.utils.Convert;
24 | import com.dyf.utils.OrderInfoUtil2_0;
25 | import com.dyf.utils.SendRequest;
26 | import com.dyf.utils.SysoUtils;
27 | import com.dyf.utils.ToastShow;
28 |
29 | import com.alipay.sdk.app.EnvUtils;
30 | import com.alipay.sdk.app.PayTask;
31 |
32 | import java.util.Map;
33 |
34 | /**
35 | * 充值界面
36 | */
37 | public class ReChargeActivity extends FragmentActivity {
38 |
39 | private TextView tv_balance;
40 | private RadioGroup rg_rechargenuml;
41 | private RadioButton rb_ten;
42 | private RadioButton rb_twenty;
43 | private RadioButton rb_thirty;
44 | private RadioButton rb_fifty;
45 | private RadioButton rb_hundred;
46 | private Button btn_recharge;
47 | private RadioButton rb_checked;
48 |
49 | // 支付相关
50 | /**
51 | * 支付宝支付业务:入参app_id
52 | */
53 | public static final String APPID = AlipayConstants.APPID;
54 | /**
55 | * 支付宝账户登录授权业务:入参pid值
56 | */
57 | public static final String PID = "";
58 | /**
59 | * 支付宝账户登录授权业务:入参target_id值
60 | */
61 | public static final String TARGET_ID = AlipayConstants.TARGET_ID;
62 |
63 | /** 商户私钥,pkcs8格式 */
64 | /** 如下私钥,RSA2_PRIVATE 或者 RSA_PRIVATE 只需要填入一个 */
65 | /** 如果商户两个都设置了,优先使用 RSA2_PRIVATE */
66 | /** RSA2_PRIVATE 可以保证商户交易在更加安全的环境下进行,建议使用 RSA2_PRIVATE */
67 | /** 获取 RSA2_PRIVATE,建议使用支付宝提供的公私钥生成工具生成, */
68 | /**
69 | * 工具地址:https://doc.open.alipay.com/docs/doc.htm?treeId=291&articleId=106097&docType=1
70 | */
71 | public static final String RSA2_PRIVATE = AlipayConstants.RSA2_PRIVATE;
72 | public static final String RSA_PRIVATE = "";
73 |
74 | private static final int SDK_PAY_FLAG = 1;
75 | private static final int SDK_AUTH_FLAG = 2;
76 | private String reChargeNum = "";
77 |
78 | private String openid = "";
79 |
80 | @Override
81 | protected void onCreate(Bundle savedInstanceState) {
82 | super.onCreate(savedInstanceState);
83 | setContentView(R.layout.activity_re_charge);
84 |
85 | // 初始化控件
86 | tv_balance = (TextView) findViewById(R.id.tv_balance);
87 | rg_rechargenuml = (RadioGroup) findViewById(R.id.rg_rechargenum);
88 | rb_ten = (RadioButton) findViewById(R.id.rb_ten);
89 | rb_twenty = (RadioButton) findViewById(R.id.rb_twenty);
90 | rb_thirty = (RadioButton) findViewById(R.id.rb_thirty);
91 | rb_fifty = (RadioButton) findViewById(R.id.rb_fifty);
92 | rb_hundred = (RadioButton) findViewById(R.id.rb_hundred);
93 | btn_recharge = (Button) findViewById(R.id.btn_recharge);
94 |
95 | // 界面一打开,需要查询余额
96 | getbalance();
97 |
98 | btn_recharge.setOnClickListener(new btnReChargeOnClickListener());
99 | }
100 |
101 |
102 | // 界面一打开,需要查询余额
103 | private void getbalance() {
104 | SharedPreferences sharedata = getSharedPreferences("data", 0);
105 | openid = sharedata.getString("openid", "未登陆");
106 | if (openid.equals("未登陆")) {
107 | ToastShow.showToastMsg(ReChargeActivity.this, "请先登陆");
108 | return;
109 | } else {
110 | new Thread() {
111 | @Override
112 | public void run() {
113 | {
114 | Message message = new Message();
115 | message.what = 0;
116 | message.obj = SendRequest.getBalance(openid);
117 | Log.i("getBalance:", message.obj.toString());
118 | mHandler.sendMessage(message);
119 | }
120 | }
121 | }.start();
122 | }
123 | }
124 |
125 |
126 | @SuppressLint("HandlerLeak")
127 | private Handler mHandler = new Handler() {
128 | @SuppressWarnings("unused")
129 | public void handleMessage(Message msg) {
130 | switch (msg.what) {
131 | case SDK_PAY_FLAG: {
132 | @SuppressWarnings("unchecked")
133 | PayResult payResult = new PayResult((Map) msg.obj);
134 | /**
135 | 对于支付结果,请商户依赖服务端的异步通知结果。同步通知结果,仅作为支付结束的通知。
136 | */
137 | String resultInfo = payResult.getResult();// 同步返回需要验证的信息
138 | String resultStatus = payResult.getResultStatus();
139 | // 判断resultStatus 为9000则代表支付成功
140 | if (TextUtils.equals(resultStatus, "9000")) {
141 | // 该笔订单是否真实支付成功,需要依赖服务端的异步通知。
142 | Toast.makeText(ReChargeActivity.this, "支付成功", Toast.LENGTH_SHORT).show();
143 | tv_balance.setText(Convert.doubleToString(Double.parseDouble(reChargeNum)+Double.parseDouble(tv_balance.getText().toString())));
144 | new Thread(new Runnable() {
145 | @Override
146 | public void run() {
147 | SendRequest.insertReChargeOption(openid,reChargeNum,"充值");
148 | }
149 | }).start();
150 |
151 | } else {
152 | // 该笔订单真实的支付结果,需要依赖服务端的异步通知。
153 | Toast.makeText(ReChargeActivity.this, "支付失败", Toast.LENGTH_SHORT).show();
154 | }
155 | break;
156 | }
157 |
158 | case 0:
159 | // 获取余额之后,界面显示余额
160 | String str_bal = msg.obj.toString();
161 | tv_balance.setText(str_bal);
162 | break;
163 |
164 | default:
165 | break;
166 | }
167 | }
168 |
169 | ;
170 | };
171 |
172 | // 充值按钮点击事件
173 | private class btnReChargeOnClickListener implements View.OnClickListener {
174 | @Override
175 | public void onClick(View view) {
176 | rb_checked = (RadioButton) findViewById(rg_rechargenuml.getCheckedRadioButtonId());
177 | reChargeNum = rb_checked.getText().toString();
178 | SysoUtils.print("sys reChargeNum:" + reChargeNum);
179 | if (reChargeNum.equals("")) {
180 | ToastShow.showToastMsg(getApplicationContext(), "请先选择金额");
181 | return;
182 | } else {
183 | // 启动支付业务
184 | payV2();
185 | }
186 |
187 | }
188 | }
189 |
190 | /**
191 | * 支付宝支付业务
192 | */
193 | public void payV2() {
194 | EnvUtils.setEnv(EnvUtils.EnvEnum.SANDBOX);
195 | if (TextUtils.isEmpty(APPID) || (TextUtils.isEmpty(RSA2_PRIVATE) && TextUtils.isEmpty(RSA_PRIVATE))) {
196 | new AlertDialog.Builder(this).setTitle("警告").setMessage("需要配置APPID | RSA_PRIVATE")
197 | .setPositiveButton("确定", new DialogInterface.OnClickListener() {
198 | public void onClick(DialogInterface dialoginterface, int i) {
199 | //
200 | finish();
201 | }
202 | }).show();
203 | return;
204 | }
205 |
206 | /**
207 | * 这里只是为了方便直接向商户展示支付宝的整个支付流程;所以Demo中加签过程直接放在客户端完成;
208 | * 真实App里,privateKey等数据严禁放在客户端,加签过程务必要放在服务端完成;
209 | * 防止商户私密数据泄露,造成不必要的资金损失,及面临各种安全风险;
210 | *
211 | * orderInfo的获取必须来自服务端;
212 | */
213 | boolean rsa2 = (RSA2_PRIVATE.length() > 0);
214 | Map params = OrderInfoUtil2_0.buildOrderParamMap(APPID, rsa2,reChargeNum);
215 | String orderParam = OrderInfoUtil2_0.buildOrderParam(params);
216 |
217 | String privateKey = rsa2 ? RSA2_PRIVATE : RSA_PRIVATE;
218 | String sign = OrderInfoUtil2_0.getSign(params, privateKey, rsa2);
219 | final String orderInfo = orderParam + "&" + sign;
220 |
221 |
222 | Runnable payRunnable = new Runnable() {
223 |
224 | @Override
225 | public void run() {
226 | PayTask alipay = new PayTask(ReChargeActivity.this);
227 | Map result = alipay.payV2(orderInfo, true);
228 | Log.i("msp", result.toString());
229 |
230 | Message msg = new Message();
231 | msg.what = SDK_PAY_FLAG;
232 | msg.obj = result;
233 | mHandler.sendMessage(msg);
234 | }
235 | };
236 |
237 | Thread payThread = new Thread(payRunnable);
238 | payThread.start();
239 | }
240 | }
241 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/ReserveActivity.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.app.AlertDialog;
4 | import android.content.Context;
5 | import android.content.DialogInterface;
6 | import android.content.Intent;
7 | import android.content.SharedPreferences;
8 | import android.os.Bundle;
9 | import android.os.Handler;
10 | import android.os.Message;
11 | import android.support.v7.app.AppCompatActivity;
12 | import android.view.View;
13 | import android.widget.Button;
14 | import android.widget.DatePicker;
15 | import android.widget.LinearLayout;
16 | import android.widget.TextView;
17 | import android.widget.TimePicker;
18 |
19 | import com.dyf.utils.SendRequest;
20 |
21 | import java.util.Calendar;
22 |
23 | public class ReserveActivity extends AppCompatActivity implements View.OnClickListener, DatePicker.OnDateChangedListener, TimePicker.OnTimeChangedListener {
24 |
25 | private Context context;
26 | private LinearLayout llstarttime, llendtime, llstartdate, llenddate;
27 | private TextView tv_startdate, tv_enddate, tv_starttime, tv_endtime, tv_username, tv_parklotName;
28 | private Button btn_reserve;
29 | private int year, month, day, hour, minute; // 当前时间
30 | private StringBuffer date, time; // 创建两个StringBuffer变量,用于拼接获取到的时间数据
31 | String nickname,openid,parklotName;
32 |
33 | SharedPreferences shareData;
34 |
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 | setContentView(R.layout.activity_reserve);
40 | context = this;
41 |
42 | date = new StringBuffer();
43 | time = new StringBuffer();
44 |
45 | // 初始化获取当前的日期和时间
46 | initDateTime();
47 | // 初始化控件
48 | initView();
49 | // 获取从上一个页面传过来的数据
50 | getIntentData();
51 | // 获取sharedpreferences的数据(nickname)
52 | getShareData();
53 |
54 | }
55 |
56 | @Override
57 | public void onClick(View view) {
58 | switch (view.getId()) {
59 | // 开始停车日期
60 | case R.id.id_ll_startdate:
61 | setDate(tv_startdate);
62 | break;
63 | // 结束停车日期
64 | case R.id.id_ll_enddate:
65 | setDate(tv_enddate);
66 | break;
67 | // 开始停车时间
68 | case R.id.id_ll_starttime:
69 | setTime(tv_starttime);
70 | break;
71 | // 结束停车时间
72 | case R.id.id_ll_endtime:
73 | setTime(tv_endtime);
74 | break;
75 | // 预定按钮
76 | case R.id.btn_reserve:
77 | btnReserveOnClickListener();
78 | break;
79 |
80 |
81 | default:
82 | break;
83 | }
84 |
85 |
86 | }
87 |
88 | // 点击预定按钮
89 | private void btnReserveOnClickListener() {
90 | final String startTime = tv_starttime.getText().toString();
91 | final String endTime = tv_endtime.getText().toString();
92 | final String startDate = tv_startdate.getText().toString();
93 | final String endDate = tv_enddate.getText().toString();
94 | new Thread(){
95 | @Override
96 | public void run() {
97 | Message msg = new Message();
98 | msg.what =1;
99 | msg.obj = SendRequest.insertReserveOption(openid,parklotName,startTime,endTime,startDate,endDate);
100 | mHandler.sendMessage(msg);
101 | }
102 | }.start();
103 | }
104 |
105 | private Handler mHandler = new Handler(){
106 | @Override
107 | public void handleMessage(Message msg) {
108 | switch (msg.what) {
109 | case 1:
110 | int i = Integer.parseInt(msg.obj.toString());
111 | if (i == 1) {
112 | AlertDialog.Builder alertDialog = new AlertDialog.Builder(ReserveActivity.this);
113 | alertDialog.setTitle("提示");
114 | alertDialog.setMessage("预定成功");
115 | alertDialog.show();
116 | // Intent intent = new Intent(ReserveActivity.this,MainActivity.class);
117 | // startActivity(intent);
118 | }else {
119 | AlertDialog.Builder alertDialog = new AlertDialog.Builder(ReserveActivity.this);
120 | alertDialog.setTitle("提示");
121 | alertDialog.setMessage("预定失败");
122 | alertDialog.show();
123 | }
124 | break;
125 | }
126 | }
127 | };
128 |
129 | public void setDate(final TextView view) {
130 | AlertDialog.Builder builder = new AlertDialog.Builder(context);
131 | builder.setPositiveButton("设置", new DialogInterface.OnClickListener() {
132 | @Override
133 | public void onClick(DialogInterface dialog, int which) {
134 | if (date.length() > 0) { //清除上次记录的日期
135 | date.delete(0, date.length());
136 | }
137 | view.setText(date.append(String.valueOf(year)).append("-").append(String.valueOf(month + 1)).append("-").append(String.valueOf(day)));
138 | dialog.dismiss();
139 | }
140 | });
141 | builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
142 | @Override
143 | public void onClick(DialogInterface dialog, int which) {
144 | dialog.dismiss();
145 | }
146 | });
147 | final AlertDialog dialog = builder.create();
148 | View dialogView = View.inflate(context, R.layout.dialog_date, null);
149 | final DatePicker datePicker = (DatePicker) dialogView.findViewById(R.id.datePicker);
150 |
151 | dialog.setTitle("设置日期");
152 | dialog.setView(dialogView);
153 | dialog.show();
154 | //初始化日期监听事件
155 | datePicker.init(year, month, day, this);
156 | }
157 |
158 | public void setTime(final TextView view) {
159 | AlertDialog.Builder builder2 = new AlertDialog.Builder(context);
160 | builder2.setPositiveButton("设置", new DialogInterface.OnClickListener() {
161 | @Override
162 | public void onClick(DialogInterface dialog, int which) {
163 | if (time.length() > 0) { //清除上次记录的日期
164 | time.delete(0, time.length());
165 | }
166 | view.setText(time.append(String.valueOf(hour)).append(":").append(String.valueOf(minute)));
167 | dialog.dismiss();
168 | }
169 | });
170 | builder2.setNegativeButton("取消", new DialogInterface.OnClickListener() {
171 | @Override
172 | public void onClick(DialogInterface dialog, int which) {
173 | dialog.dismiss();
174 | }
175 | });
176 | AlertDialog dialog2 = builder2.create();
177 | View dialogView2 = View.inflate(context, R.layout.dialog_time, null);
178 | TimePicker timePicker = (TimePicker) dialogView2.findViewById(R.id.timePicker);
179 | timePicker.setCurrentHour(hour);
180 | timePicker.setCurrentMinute(minute);
181 | timePicker.setIs24HourView(true); //设置24小时制
182 | timePicker.setOnTimeChangedListener(this);
183 | dialog2.setTitle("设置时间");
184 | dialog2.setView(dialogView2);
185 | dialog2.show();
186 | }
187 |
188 |
189 | @Override
190 | public void onDateChanged(DatePicker datePicker, int year, int monthOfYear, int dayOfMonth) {
191 | this.year = year;
192 | this.month = monthOfYear;
193 | this.day = dayOfMonth;
194 | }
195 |
196 | @Override
197 | public void onTimeChanged(TimePicker timePicker, int hourOfDay, int minute) {
198 | this.hour = hourOfDay;
199 | this.minute = minute;
200 | }
201 |
202 | // 初始化获取当前的日期和时间
203 | private void initDateTime() {
204 | Calendar calendar = Calendar.getInstance();
205 | year = calendar.get(Calendar.YEAR);
206 | month = calendar.get(Calendar.MONTH);
207 | day = calendar.get(Calendar.DAY_OF_MONTH);
208 | hour = calendar.get(Calendar.HOUR_OF_DAY);
209 | minute = calendar.get(Calendar.MINUTE);
210 | }
211 |
212 | // 获取sharedpreferences的数据(nickname)
213 | private void getShareData() {
214 | shareData = getSharedPreferences("data", 0);
215 | nickname = shareData.getString("nickname", "未登录");
216 | openid = shareData.getString("openid","未登录");
217 | tv_username.setText(nickname);
218 | }
219 |
220 | // 获取从上一个页面传过来的数据
221 | private void getIntentData() {
222 | Intent intent = getIntent();
223 | parklotName = intent.getStringExtra("parklotName");
224 | tv_parklotName.setText(parklotName);
225 | }
226 |
227 | // 初始化控件
228 | private void initView() {
229 | llstartdate = (LinearLayout) findViewById(R.id.id_ll_startdate);
230 | llenddate = (LinearLayout) findViewById(R.id.id_ll_enddate);
231 | llstarttime = (LinearLayout) findViewById(R.id.id_ll_starttime);
232 | llendtime = (LinearLayout) findViewById(R.id.id_ll_endtime);
233 | tv_startdate = (TextView) findViewById(R.id.id_tv_startdate);
234 | tv_enddate = (TextView) findViewById(R.id.id_tv_enddate);
235 | tv_starttime = (TextView) findViewById(R.id.id_tv_starttime);
236 | tv_endtime = (TextView) findViewById(R.id.id_tv_endtime);
237 | tv_username = (TextView) findViewById(R.id.id_tv_nickname);
238 | tv_parklotName = (TextView) findViewById(R.id.id_tv_parklotname);
239 | btn_reserve = (Button) findViewById(R.id.btn_reserve);
240 |
241 | tv_starttime.setText(hour+":"+minute);
242 | tv_endtime.setText(hour+":"+minute);
243 | tv_startdate.setText(year+"-"+(month+1)+"-"+day);
244 | tv_enddate.setText(year+"-"+(month+1)+"-"+day);
245 |
246 | llstartdate.setOnClickListener(this);
247 | llenddate.setOnClickListener(this);
248 | llstarttime.setOnClickListener(this);
249 | llendtime.setOnClickListener(this);
250 | btn_reserve.setOnClickListener(this);
251 | }
252 | }
253 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/ReturnActivity.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.view.Menu;
6 |
7 | public class ReturnActivity extends Activity {
8 |
9 | @Override
10 | public void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.activity_return);
13 | }
14 |
15 | @Override
16 | public boolean onCreateOptionsMenu(Menu menu) {
17 | //getMenuInflater().inflate(R.menu.activity_return, menu);
18 | return true;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/ShowPlateNumActivity.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | public class ShowPlateNumActivity extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_show_plate_num);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/baidumap/wxapi/WXEntryActivity.java:
--------------------------------------------------------------------------------
1 | package com.dyf.baidumap.wxapi;
2 |
3 | import android.app.Activity;
4 | import android.widget.Toast;
5 |
6 | import com.dyf.baidumap.R;
7 | import com.tencent.mm.sdk.openapi.BaseReq;
8 | import com.tencent.mm.sdk.openapi.BaseResp;
9 | import com.tencent.mm.sdk.openapi.IWXAPIEventHandler;
10 |
11 | /**
12 | * Created by diy on 2018-01-15.
13 | */
14 |
15 | public class WXEntryActivity extends Activity implements IWXAPIEventHandler
16 | {
17 |
18 | //APP向微信发请求之后,这个方法接收从微信返回的消息
19 | @Override
20 | public void onResp(BaseResp baseResp)
21 | {
22 | int result = 0;
23 |
24 | Toast.makeText(this, "baseresp.getType = " + baseResp.getType(), Toast.LENGTH_SHORT).show();
25 |
26 | switch (baseResp.errCode) {
27 | case BaseResp.ErrCode.ERR_OK:
28 | result = R.string.errcode_ok;
29 | break;
30 | case BaseResp.ErrCode.ERR_USER_CANCEL:
31 | result = R.string.errcode_cancel;
32 | break;
33 | case BaseResp.ErrCode.ERR_AUTH_DENIED:
34 | result = R.string.errcode_deny;
35 | break;
36 | case BaseResp.ErrCode.ERR_UNSUPPORT:
37 | result = R.string.errcode_unsupported;
38 | break;
39 | case BaseResp.ErrCode.ERR_SENT_FAILED:
40 | result = R.string.errcode_sentfailed;
41 | break;
42 |
43 | case BaseResp.ErrCode.ERR_COMM:
44 | result = R.string.errcode_comm;
45 | break;
46 | default:
47 | result = R.string.errcode_unknown;
48 | break;
49 | }
50 |
51 | Toast.makeText(this, "微信请求登录返回的值:"+result, Toast.LENGTH_LONG).show();
52 | }
53 |
54 | @Override
55 | public void onReq(BaseReq baseReq)
56 | {
57 |
58 | }
59 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/model/ResultParklotInfo.java:
--------------------------------------------------------------------------------
1 | package com.dyf.model;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * 从服务器返回的停车场信息实体类
7 | * Created by diy on 2018-01-13.
8 | */
9 |
10 | public class ResultParklotInfo implements Serializable
11 | {
12 | private static final long serialVersionUID = -1537235388599053145L;
13 | private String parklotName; // 停车场名称
14 | private int distance; // 车辆距离停车场的距离,单位 米
15 | private int time;// 车辆行驶到停车场所需的时间
16 | private int noParkNum; //停车场的未停车数
17 | private double noParkRate; //停车场的未停车率
18 | private int parklotAmount; // 停车场车位数量
19 | private String parklotLng; // 停车场位置精度
20 | private String parklotLat; // 停车场位置纬度
21 | private String parklotDescription; // 停车场描述
22 |
23 | public ResultParklotInfo()
24 | {
25 | }
26 |
27 | /**
28 | * 不包含未停车率
29 | * @param parklotName
30 | * @param distance
31 | * @param time
32 | * @param noParkNum
33 | * @param parklotAmount
34 | * @param parklotLng
35 | * @param parklotLat
36 | * @param parklotDescription
37 | */
38 | public ResultParklotInfo(String parklotName, int distance, int time, int noParkNum, int parklotAmount, String parklotLng, String parklotLat, String parklotDescription)
39 | {
40 | this.parklotName = parklotName;
41 | this.distance = distance;
42 | this.time = time;
43 | this.noParkNum = noParkNum;
44 | this.parklotAmount = parklotAmount;
45 | this.parklotLng = parklotLng;
46 | this.parklotLat = parklotLat;
47 | this.parklotDescription = parklotDescription;
48 | }
49 |
50 | /**
51 | * 全部参数
52 | * @param parklotName
53 | * @param distance
54 | * @param time
55 | * @param noParkNum
56 | * @param noParkRate
57 | * @param parklotAmount
58 | * @param parklotLng
59 | * @param parklotLat
60 | * @param parklotDescription
61 | */
62 | public ResultParklotInfo(String parklotName, int distance, int time, int noParkNum, double noParkRate, int parklotAmount, String parklotLng, String parklotLat, String parklotDescription)
63 | {
64 | this.parklotName = parklotName;
65 | this.distance = distance;
66 | this.time = time;
67 | this.noParkNum = noParkNum;
68 | this.noParkRate = noParkRate;
69 | this.parklotAmount = parklotAmount;
70 | this.parklotLng = parklotLng;
71 | this.parklotLat = parklotLat;
72 | this.parklotDescription = parklotDescription;
73 | }
74 |
75 | @Override
76 | public String toString()
77 | {
78 | return "ResultParklotInfo{" +
79 | "parklotName='" + parklotName + '\'' +
80 | ", distance=" + distance +
81 | ", time=" + time +
82 | ", noParkNum=" + noParkNum +
83 | ", noParkRate=" + noParkRate +
84 | ", parklotAmount=" + parklotAmount +
85 | ", parklotLng='" + parklotLng + '\'' +
86 | ", parklotLat='" + parklotLat + '\'' +
87 | ", parklotDescription='" + parklotDescription + '\'' +
88 | '}';
89 | }
90 |
91 | public String getParklotName()
92 | {
93 | return parklotName;
94 | }
95 |
96 | public void setParklotName(String parklotName)
97 | {
98 | this.parklotName = parklotName;
99 | }
100 |
101 | public int getDistance()
102 | {
103 | return distance;
104 | }
105 |
106 | public void setDistance(int distance)
107 | {
108 | this.distance = distance;
109 | }
110 |
111 | public int getTime()
112 | {
113 | return time;
114 | }
115 |
116 | public void setTime(int time)
117 | {
118 | this.time = time;
119 | }
120 |
121 | public int getNoParkNum()
122 | {
123 | return noParkNum;
124 | }
125 |
126 | public void setNoParkNum(int noParkNum)
127 | {
128 | this.noParkNum = noParkNum;
129 | }
130 |
131 | public double getNoParkRate()
132 | {
133 | return noParkRate;
134 | }
135 |
136 | public void setNoParkRate(double noParkRate)
137 | {
138 | this.noParkRate = noParkRate;
139 | }
140 |
141 | public int getParklotAmount()
142 | {
143 | return parklotAmount;
144 | }
145 |
146 | public void setParklotAmount(int parklotAmount)
147 | {
148 | this.parklotAmount = parklotAmount;
149 | }
150 |
151 | public String getParklotLng()
152 | {
153 | return parklotLng;
154 | }
155 |
156 | public void setParklotLng(String parklotLng)
157 | {
158 | this.parklotLng = parklotLng;
159 | }
160 |
161 | public String getParklotLat()
162 | {
163 | return parklotLat;
164 | }
165 |
166 | public void setParklotLat(String parklotLat)
167 | {
168 | this.parklotLat = parklotLat;
169 | }
170 |
171 | public String getParklotDescription()
172 | {
173 | return parklotDescription;
174 | }
175 |
176 | public void setParklotDescription(String parklotDescription)
177 | {
178 | this.parklotDescription = parklotDescription;
179 | }
180 | }
181 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/utils/AlipayConstants.java:
--------------------------------------------------------------------------------
1 | package com.dyf.utils;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by diy on 2018/4/18.
7 | * 支付相关的constants
8 | */
9 |
10 | public class AlipayConstants {
11 |
12 | // 2018011501876399
13 | public static String APPID = "2016081500253471";
14 |
15 | public static String RSA2_PRIVATE = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCfVgaGAPIFyP2L\n" +
16 | "RmlYvHrXj6l++8qRvncGddrSy2xIdAeojWLJYMo6hcoCH+tZzaP9A6Owyd2Vjq1p\n" +
17 | "eucrjxLg5keR96Y7zgF9i6ihBoeqoGdHMcE+z+M+zruN0qG4SYeeMrjRSBUxqCM0\n" +
18 | "Vp+1jhTDQr3SBFgwZ4uRtmXLe78oxPwXFyz1TBloKwVNwb6aGxGBne5ZtD9+8uOk\n" +
19 | "oYw/stjGI10C2VkuWo4EeegZEsR/jMamiupgJKGmIcH5pfInXaIJKlfFmDCx93Oc\n" +
20 | "M584Xv/euhjYR3OPc+F3pz10HdoVWETI1w9SkqOXL1y7PVBWMjfaDbUTngZY3/uP\n" +
21 | "qet0J1IvAgMBAAECggEAd2hmtyIaPk+kAy4fYMrPXKBjK7DS3GpalNLZzMN6QMoD\n" +
22 | "u0NJ1xTcOQNuoiz9mW1NCh4iHCkMEDq+pp/egnxUb4rj8/Yd9A+sekOhehuErFBN\n" +
23 | "VcNpyQLOkJEpaV2CqLMiGWJ1sxFMIMyapWyNf+gck0B/NNbgqFXQ+MAyhU4VshzO\n" +
24 | "9HK5C4xNQ5z7dfy++BNb0BAzRURuq4CEqZ8u39ZIAF4uSIebYEPNV4il6aDd+Scg\n" +
25 | "JLqJuZF+LM3ghndOWBSwMyz5MEt9zDZFMu2Ko+drGZ6OMpZ1KmrDiU8zcaQs0vP3\n" +
26 | "WFVPv4MFXqqNQUQ73OBnbdo3+7RG+X07XbIk3VqhwQKBgQDNiJXRQ2bOF1G1Sixn\n" +
27 | "jO8Os0YDQYpqJ6fipaiIp3mbS6hliy7BnpRw3JVSuMtZWrpS73Nc1/qZyK89eJpv\n" +
28 | "SiGOlpxquC6O+2eL4sbX8GZgkV/H8q0ZoRuVBrv965N70i53l7e10nAQUCsEBR1u\n" +
29 | "XL4Kh1oYqWdYgOqBnmyuP/rF/wKBgQDGdY+EgZyb2OaT37iiGEMaMRNxGLpXW8ek\n" +
30 | "HGcLYGdReugkNOgxNlrYcy4qAqkvBjruqklxd80rKV7O1KGc0zC2KEWo7j04zNw6\n" +
31 | "SCq1coOhebuPDba/4VsnvDkrSL4/6Pw7xpwPaF+DfvoxeUSFDZUjcGdK3NeveJeo\n" +
32 | "5qEgOcZT0QKBgQCzPXbx3ObNudZe1EWvNF/SIRNgiYqtEtI9PJyiN/M8NBmyHFP1\n" +
33 | "NFddqXBriI6F6TJuWzXu9Mctz67LW97KSQrEr6HPC7pGpQZjHqyr6pFNi9nMpFzC\n" +
34 | "6hYEu6+8O/INXHl7gAsM/G0QPOmWguNsuGJfCjTPJwTiUOKxkThUKaWHfwKBgFdF\n" +
35 | "DQZUxJxXxhVStOs6xg83c3gxSoftyR2mi72Z9/UBmiGJzm0NnOc/xxYcM2+FStb2\n" +
36 | "tPMbnnITcCh9ok/HIs2HahJ+KRfYJiPO5lEB+VZBpLOkcS9xltcjUvRwuZB7EKfs\n" +
37 | "j2XLHO1DIhwtWm8z6Ng7roBiGsqDuhVAzavRHCBxAoGAQxA+u0UPXJvTRjVnrsxp\n" +
38 | "swQQ1WqF91rx55sRc3MXVGuDZqihY8w0MyS1xg0Z+XSjyY6CBbiNy4ZJ/qYXpiEA\n" +
39 | "hMnB5N1/7Fu6CComXg7/i8ujngZKgzyvCZ5TZfxTwmFPcmqzzm2lsMmnrzTtBv0O\n" +
40 | "kHwIMeDlqUOfEipJ3nxEBdI=";
41 | public static String RSA_PRIVATE = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCnwI4G8DE4rCIlXsS6OMFv3FKxaAyF5ONLVSB3KS9TyQGlhYPZw1TSN1UVBOdFJ2O0P6Xw0PRBvn+igjeeky8UxJtU+uhqBpP4pqzs9KpifkAiczJPjnvzhE18ZyrWHVCic+K9MxDfOoDiiEMJ3iw+FanKt/f3g9F+b86VjD7qEHuFFMCpVhcYr8sHmdHSPrOOjtGR1/vZk7oe3W+OHFDfnwdKNth5BnBdKfbHHxt4IzYnFnu1UC3Q9D/BhtxMl+ffITxBE5xnMqhEPiZMMeS75eG+rkBIdWoY/pREn+6PDGIe1XaJdKHGpAfwi8X+Zkgbe5tq6sDM8pXThg7+OPb1AgMBAAECggEBAIJP5ISjRbk+jm/1RGFdAXdB8cL6ju/cNG0qvcOTbL5rYSoRo7EgOd3rOd7QJk/kH2HAJ8oAqB4CO+gju80ljOdXK0tCdhUW8w+vepnAHjPQ20Vns2d1yfgLiJ3hDrexohfwaeyLpMmkCsbvDxS1UC0SawmdC7Vs4uqTNCmb/quXy8I+dzivak0EenbWVO/bEJo/3/u3r6OnULu5bxxYfrcLMtpgLp+/PIaxfAElRI4grAk3onXGtWTD/rMnFksXIRWF0mH6R8kb5Ke93fFzRKvQVTk7bZ3bbfzIZrWKTh+8e3eZ0QuHjvzrR73gVMLfrQFBTHeXraXZZdsSyPOSfcECgYEA20J8TiEGH3FreLy7AUPc5TquVoC49/oRHUQaW+KykoVdiio06nk86zW5JyAOZ/uIHoOREMm2mB03S1Um9yWvJPi5nX55hJEcy5ioSbuI4DFid4HO+Ugvm4nj1vf7b5qglceFMb9fLxPUoeuhOmlkS3EZZkLmfLVaosDqeo9iDF0CgYEAw9yRBJqknKVP2W5q8IGW70HxYqP8EgbMRyyN8RMh6+SPQoFQQiLWHsEhkZ46lG8SsvBeOi/uXoCH96LDgxsTOJAujrNAbSmhVUkGR6ex07gYtJS/JB33M9JNmZ4ZTynzhVvNdFyzgr86qaqk/4XRzf8fP/FlhUilatGOWtMrq3kCgYEAlSjdt6jvqWRXYIPEFFA+bhNFlsNrEgekrOwvomLOaK8hu2SLKxffQYQCuYMtSb/sEhYfEfSnq0P04eLD505ToCs02te3g1/U3wyzL7XMn/f4rKQ6UYuyF3Xu8ccx3fKrXDmnevhdoIE1HhJWVI5uFISUauUIN76IMkBbQ5VXdmECgYAPoJCdim0p5nK5iXrU17IgQuWsliLtmUdBQofMvVcOiDz59HFf5YGqEITKJpLL9xTJ3C3YfKyLM7wlgQISet2MvMxKLHkufIzXzizHGNUybFTkS534lr97jgMNB7VDQLiiYlHBQAg+nV1j3i6uCJJV2k42/t63xLUWEcRG8ORiGQKBgGq0cufP9deqyVLpB4sxcBb2E4DSre7NmLbdtkMrnjDCANMucwpwCbOxqsNq4bL/7SCExLTeugqm9c1SrOSu6RwfI3Wo8Rg1/gc+p9KnGPIJ5AJONA3hf95Ps5Bx1tj34fxXqbXrbHjrxW9IkQ4VSAIMdzUwyYQMXTqCUzw/AN3v";
42 |
43 | public static String TARGET_ID = new Date().toString();
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/utils/Constant.java:
--------------------------------------------------------------------------------
1 | package com.dyf.utils;
2 |
3 | /**
4 | * Created by diy on 2018-01-13.
5 | */
6 |
7 | public class Constant
8 | {
9 |
10 |
11 | /**
12 | * 命名空间
13 | */
14 | public static String NAMESPACE="http://service.dyf.com";
15 | /**
16 | * 请求的serviceURL
17 | */
18 | //二教的无线IP地址
19 | //public static String SERVICEURL = "http://192.168.43.195:8081/parkservice";
20 | //毕设室无线IP地址,两个
21 | //public static String SERVICEURL = "http://10.201.128.111:8081/parkservice";
22 | //public static String SERVICEURL = "http://10.201.23.19:8081/parkservice";
23 | //public static String SERVICEURL = "http://"+Inet.getIP()+"/parkservice";
24 | //public static String SERVICEURL = "http://192.168.191.1:8081/parkservice";
25 | //public static String SERVICEURL = "http://119.28.138.30:8081/parkservice";
26 | //public static String SERVICEURL = "http://192.168.1.5:8081/parkservice";
27 | public static String SERVICEURL = "http://192.168.206.132:8081/parkservice";
28 | //public static String SERVICEURL = "http://192.168.23.1:8081/parkservice";
29 | // 腾讯云服务器地址
30 | //public static String SERVICEURL = "http://119.28.138.30:8081/parkservice";
31 | /**
32 | * 向服务器发送的方法名称,根据条件获取合适的停车场信息
33 | */
34 | public static String GET_BEST_PARKLOTINFO_METHOD_NAME = "getBestParklot";
35 |
36 | /**
37 | * 向服务器发送的方法名称,根据条件获取所有的停车场信息
38 | */
39 | public static String GET_All_PARKLOTINFO_METHOD_NAME = "getAllParklot";
40 |
41 | /**
42 | * 向服务器发送方法名称,将QQ登录用户信息保存在数据库
43 | */
44 | public static String INSERT_QQUSER_INFO = "insertQQUserInfo";
45 |
46 | /**
47 | * 向服务器发送的方法名称,根据openid获得余额
48 | */
49 | public static String GET_BALANCE = "getBalance";
50 |
51 | /**
52 | * 向服务器发送的方法名称,将充值操作保存进数据库
53 | */
54 | public static String INSERT_RECHARGEOPTION = "insertReChargeOption";
55 |
56 | /**
57 | * 向服务器发送的方法名称,将预定车位操作保存进数据库
58 | */
59 | public static final String INSERT_RESERVEOPTION = "insertReserveOption";
60 |
61 | /**
62 | * 向服务器发送的方法名称,将绑定的车牌号信息保存进数据库
63 | */
64 | public static final String UPDATE_PLATENUM = "updatePlateNum";
65 |
66 | /**
67 | * 向服务器发送的方法名称,将评价内容保存进数据库
68 | */
69 | public static final String INSERT_EVALUATE = "insertEvaluate";
70 |
71 | /**
72 | * 向服务器发送的方法名称,查询数据库中是否有指定的车牌号
73 | */
74 | public static final String SELECT_PLATENUM = "selectPlateNum";
75 |
76 | /**
77 | * 设置地图的初始放大比例和点击我在哪按钮时的地图放大比例
78 | */
79 | public static float BASIC_ZOOM = 16;
80 |
81 | /**
82 | * 微信的APP_ID
83 | */
84 | public static String WEIXIN_APP_ID = "";
85 |
86 | /**
87 | * QQ的APP_ID
88 | */
89 | public static String QQ_APP_ID = "1106834232";
90 |
91 | }
92 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dyf/utils/Convert.java:
--------------------------------------------------------------------------------
1 | package com.dyf.utils;
2 |
3 | import org.ksoap2.serialization.SoapObject;
4 |
5 | import java.text.NumberFormat;
6 | import java.util.ArrayList;
7 | import java.util.HashMap;
8 | import java.util.List;
9 | import java.util.Map;
10 |
11 | /**
12 | * Created by diy on 2018-01-13.
13 | */
14 |
15 | public class Convert
16 | {
17 | /**
18 | * 将double转换为string
19 | * @param dou 传过来的double类型参数
20 | * @return
21 | */
22 | public static String doubleToString(double dou) {
23 | Double dou_obj = new Double(dou);
24 | NumberFormat nf = NumberFormat.getInstance();
25 | nf.setGroupingUsed(false);
26 | String dou_str = nf.format(dou_obj);
27 | SysoUtils.print("转换后的double:"+dou_str);
28 | return dou_str;
29 | }
30 |
31 | /**
32 | * 将服务器返回的soapObject结果转换为List