Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps SDK 2.0.9 Sample app update #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions MQSimpleAndroidMap.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="MQSimpleAndroidMap" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# MQSimpleAndroidMap
Simple map using the MapQuest Android sdk
# MapQuest Maps SDK for Android

This sample application is provided to show off some of the features of MapQuest's Map SDK. Please visit our [Getting Started Guide](https://developer.mapquest.com/documentation/maps-sdk/android/) for instructions on how to get up and running with the SDK. The Getting Started Guide walks you through the basics of getting a MapQuest API key, adding markers, customizing styles, and much more.

This sample app is based off the Getting Started Guide and shows how to:
* Street, Night and Satellite Modes
* Adding Polygons/Polylines
* Adding Markers
* Using Search Ahead to show markers on the map
* Using Follow mode
* Using the Camera
* Toggle traffic
* Customizing styles


173 changes: 86 additions & 87 deletions app/app.iml

Large diffs are not rendered by default.

130 changes: 96 additions & 34 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,96 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.mqbc.simplemap"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'

// added for MapQuest map
compile('com.mapquest:mapping-android-sdk:1.3.18@aar') {
transitive = true
}
}
apply plugin: 'com.android.application'

android {
def getKeystorePropertiesFile = { build ->
return new File("${rootDir}/app/keystore/${build}.properties")
}

def getKeystoreProperties = { propertiesFile ->
def props = new Properties()
props.load(new FileInputStream(propertiesFile))
return props
}

compileSdkVersion 27
buildToolsVersion '27.0.3'

def defaultAppVersionCode = '1'
def appVersionCode = System.getProperty('versionCode', defaultAppVersionCode).toInteger()

applicationVariants.all { variant ->
variant.buildConfigField "String", "API_KEY", getApiKey()
variant.resValue "string", "API_KEY", getApiKey()
}

defaultConfig {
applicationId "com.mapquest.mapping.example"
minSdkVersion 16
targetSdkVersion 27
versionCode appVersionCode
versionName "2.0.9"
multiDexEnabled true
}

signingConfigs {
release {
def properties = getKeystoreProperties(getKeystorePropertiesFile('release'))
storeFile = file(properties['storeFile'])
storePassword = properties['storePassword']
keyAlias = properties['keyAlias']
keyPassword = properties['keyPassword']
}
}

buildTypes {
debug {
applicationIdSuffix '.debug'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/INDEX.LIST'
exclude 'LICENSE.txt'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}


dependencies {
testImplementation 'junit:junit:4.12'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation ('com.mapquest:searchahead:1.3.1') {
transitive = true
}

implementation 'com.android.support:multidex:1.0.3'

implementation("com.mapquest:mapping-android-sdk:2.0.9")
implementation 'com.android.support:design:27.1.1'
}

def getApiKey() {
def props = new Properties()
file("mapquest.properties").withInputStream { props.load(it) }
return "\"" + props.getProperty("api_key") + "\""
}

4 changes: 4 additions & 0 deletions app/keystore/release.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
storeFile=../app/keystore/release.keystore
keyAlias=androidreleasekey
storePassword=android
keyPassword=android
1 change: 1 addition & 0 deletions app/mapquest.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
api_key=<ENTER_YOUR_API_KEY_HERE>
34 changes: 17 additions & 17 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\briancoakley07\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Applications/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
35 changes: 18 additions & 17 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mqbc.simplemap">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.mapquest.mapping.example" xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<application
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Loading