Skip to content

Commit fe6981e

Browse files
committed
Baidu地图的简单显示
0 parents  commit fe6981e

File tree

60 files changed

+501
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+501
-0
lines changed

README.md

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "24.0.0"
6+
7+
8+
9+
defaultConfig {
10+
applicationId "com.example.baidumaptest"
11+
minSdkVersion 15
12+
targetSdkVersion 23
13+
versionCode 1
14+
versionName "1.0"
15+
}
16+
buildTypes {
17+
release {
18+
minifyEnabled false
19+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20+
}
21+
}
22+
}
23+
24+
dependencies {
25+
compile fileTree(include: ['*.jar'], dir: 'libs')
26+
testCompile 'junit:junit:4.12'
27+
compile 'com.android.support:appcompat-v7:23.4.0'
28+
compile files('libs/BaiduLBS_Android.jar')
29+
compile files('libs/httpmime-4.1.2.jar')
30+
}

app/libs/BaiduLBS_Android.jar

1.49 MB
Binary file not shown.

app/libs/IndoorscapeAlbumPlugin.jar

21.2 KB
Binary file not shown.

app/libs/httpmime-4.1.2.jar

26.3 KB
Binary file not shown.

app/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in C:\Users\18359_000\AppData\Local\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+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.example.baidumaptest;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

app/src/main/AndroidManifest.xml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.baidumaptest">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme">
11+
<activity android:name=".MainActivity">
12+
<intent-filter>
13+
<action android:name="android.intent.action.MAIN" />
14+
15+
<category android:name="android.intent.category.LAUNCHER" />
16+
</intent-filter>
17+
</activity>
18+
<meta-data
19+
android:name="com.baidu.lbsapi.API_KEY"
20+
android:value="SO1qG54dUHWE5HKYQPMmBR0KxTS3Flct" />
21+
</application>
22+
23+
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
24+
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
25+
<uses-permission android:name="android.permission.ACCOUNT_MANAGER" />
26+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
27+
<uses-permission android:name="android.permission.INTERNET" />
28+
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
29+
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
30+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
31+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
32+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
33+
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
34+
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
35+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
36+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
37+
38+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.example.baidumaptest;
2+
3+
import android.support.v7.app.AppCompatActivity;
4+
import android.os.Bundle;
5+
6+
import com.baidu.mapapi.SDKInitializer;
7+
import com.baidu.mapapi.map.MapView;
8+
9+
public class MainActivity extends AppCompatActivity {
10+
11+
private MapView mapView;
12+
@Override
13+
protected void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
SDKInitializer.initialize(getApplicationContext());
16+
setContentView(R.layout.activity_main);
17+
mapView=(MapView)findViewById(R.id.map_view);
18+
}
19+
20+
protected void onDestroy(){
21+
super.onDestroy();
22+
mapView.onDestroy();
23+
}
24+
25+
protected void onPause(){
26+
super.onPause();
27+
mapView.onPause();
28+
}
29+
30+
protected void onResume(){
31+
super.onResume();
32+
mapView.onResume();
33+
}
34+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:paddingBottom="@dimen/activity_vertical_margin"
7+
android:paddingLeft="@dimen/activity_horizontal_margin"
8+
android:paddingRight="@dimen/activity_horizontal_margin"
9+
android:paddingTop="@dimen/activity_vertical_margin"
10+
tools:context="com.example.baidumaptest.MainActivity">
11+
12+
<com.baidu.mapapi.map.MapView
13+
android:id="@+id/map_view"
14+
android:layout_height="match_parent"
15+
android:layout_width="match_parent"
16+
android:clickable="true"
17+
/>
18+
</LinearLayout>
3.34 KB
2.15 KB
4.73 KB
7.54 KB
10.2 KB
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
3+
(such as screen margins) for screens with more than 820dp of available width. This
4+
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
5+
<dimen name="activity_horizontal_margin">64dp</dimen>
6+
</resources>

app/src/main/res/values/colors.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="colorPrimary">#3F51B5</color>
4+
<color name="colorPrimaryDark">#303F9F</color>
5+
<color name="colorAccent">#FF4081</color>
6+
</resources>

app/src/main/res/values/dimens.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
<!-- Default screen margins, per the Android Design guidelines. -->
3+
<dimen name="activity_horizontal_margin">16dp</dimen>
4+
<dimen name="activity_vertical_margin">16dp</dimen>
5+
</resources>

app/src/main/res/values/strings.xml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">BaiduMapTest</string>
3+
</resources>

app/src/main/res/values/styles.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5+
<!-- Customize your theme here. -->
6+
<item name="colorPrimary">@color/colorPrimary</item>
7+
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
8+
<item name="colorAccent">@color/colorAccent</item>
9+
</style>
10+
11+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.example.baidumaptest;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.*;
6+
7+
/**
8+
* To work on unit tests, switch the Test Artifact in the Build Variants view.
9+
*/
10+
public class ExampleUnitTest {
11+
@Test
12+
public void addition_isCorrect() throws Exception {
13+
assertEquals(4, 2 + 2);
14+
}
15+
}

build.gradle

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:2.1.2'
9+
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
jcenter()
18+
}
19+
}
20+
21+
task clean(type: Delete) {
22+
delete rootProject.buildDir
23+
}

gradle.properties

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true

gradle/wrapper/gradle-wrapper.jar

52.4 KB
Binary file not shown.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Mon Dec 28 10:00:20 PST 2015
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

0 commit comments

Comments
 (0)