Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For an overview of the existing features, please check the _Developer Guide_ for

> For now, HERE SDK (Navigate) is only available upon request. Please contact your HERE representative to receive access including a set of evaluation credentials.

## List of available example apps (Version 4.27.2.0)
## List of available example apps (Version 4.27.3.0)

- [List of example apps for the HERE SDK for Android](https://www.here.com/docs/bundle/sdk-for-android-developer-guide/page/topics/examples.html).
- [List of example apps for the HERE SDK for iOS](https://www.here.com/docs/bundle/sdk-for-ios-developer-guide/page/topics/examples.html).
Expand Down
2 changes: 1 addition & 1 deletion examples/latest/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This folder contains the HERE SDK examples apps for version: 4.27.2.0
This folder contains the HERE SDK examples apps for version: 4.27.3.0

- HERE SDK for Android ([Explore](explore/android/), [Navigate](navigate/android/))
- HERE SDK for iOS ([Explore](explore/ios/), [Navigate](navigate/ios/))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
2 changes: 1 addition & 1 deletion examples/latest/explore/android/Java/Gestures/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ allprojects {
if (rootProject.ext.HERESDKBuildConfig == "BUNDLE_FROM_ARTIFACTORY") {
maven {
name = 'HERE_SDK_Artifactory_Repository'
url = "https://repo.platform.here.com/artifactory/here-sdk-android"
url = project.findProperty('HERESDKArtifactoryURL') ?: "https://repo.platform.here.com/artifactory/here-sdk-android"
credentials {
// Use the username and token created on https://platform.here.com/access/access-tokens.
username = project.findProperty('HERESDKArtifactoryUsername') ?: "YOUR_USER_NAME"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
2 changes: 1 addition & 1 deletion examples/latest/explore/android/Java/Traffic/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ allprojects {
if (rootProject.ext.HERESDKBuildConfig == "COMPONENTS_FROM_ARTIFACTORY") {
maven {
name = 'HERE_SDK_Artifactory_Repository'
url = "https://repo.platform.here.com/artifactory/here-sdk-android"
url = project.findProperty('HERESDKArtifactoryURL') ?: "https://repo.platform.here.com/artifactory/here-sdk-android"
credentials {
// Use the username and token created on https://platform.here.com/access/access-tokens.
username = project.findProperty('HERESDKArtifactoryUsername') ?: "YOUR_USER_NAME"
Expand Down
13 changes: 7 additions & 6 deletions examples/latest/explore/android/Java/UnitTesting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ The UnitTesting example app shows how the HERE SDK can be mocked in unit tests.

![Map view backing the example app that is covered by mocked unit tests](images/unit_testing.png)

This example uses **HERE SDK Units** to support functionality such as permission handling or buttons that are not essential to the code snippets shown in this app, as the focus is on demonstrating how to use the APIs provided by the HERE SDK. The HERE SDK Units are included as AARs in the app’s `libs` folder. For more details, see the "HERESDKUnits" app to customize or create your own unit libraries. Note that this app is intended exclusively for the HERE SDK (Navigate). You can find it in the `navigate` folder. However, it can be easily adapted for the HERE SDK (Explore) by removing any code that is not supported there. At present, most components are compatible and will compile without issues.

Build instructions:
-------------------

1) Copy the AAR and "heresdk-xxx.jar" mock JAR file of the HERE SDK for Android to your app's `app/libs` folder.
1) Copy the AAR file of the HERE SDK for Android to your app's `app/libs` folder.

2) Copy the "heresdk-xxx.jar" mock JAR file of the HERE SDK for Android to your app's `app/libs` folder.

Note: If your AAR/JAR versions are different than the version shown in the _Developer Guide_, you may need to adapt the source code of the example app.

Note: If your AAR/JAR version are different than the version shown in the _Developer Guide_, you may need to adapt the source code of the example app.
3) Open Android Studio and sync the project.

2) Open Android Studio and sync the project.
3) Open file TestBasicTypes.java and run unit tests from it.
4) Open file `TestBasicTypes.java` and run unit tests from it.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Put the latest AAR file of the HERE SDK for Android and the "heresdk-xxx.jar" mock JAR file to this folder.
This app requires the unit testing mock library for the HERE SDK: Put the latest AAR file of the HERE SDK for Android and the "heresdk-xxx.jar" mock JAR file to this folder.

On top, you need to add the HERE SDK AAR here.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ allprojects {
if (rootProject.ext.HERESDKBuildConfig == "BUNDLE_FROM_ARTIFACTORY") {
maven {
name = 'HERE_SDK_Artifactory_Repository'
url = "https://repo.platform.here.com/artifactory/here-sdk-android"
url = project.findProperty('HERESDKArtifactoryURL') ?: "https://repo.platform.here.com/artifactory/here-sdk-android"
credentials {
// Use the username and token created on https://platform.here.com/access/access-tokens.
username = project.findProperty('HERESDKArtifactoryUsername') ?: "YOUR_USER_NAME"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ public void onItemClick(AdapterView<?> parent, final View view, int position, lo
VenueModel venueModel = venue.getVenueModel();
// Set the selected drawing when a user clicks on the item in the list.
venue.setSelectedDrawing(venueModel.getDrawings().get(position));
// Highlight the selected item.
updateSelectedDrawingPosition();
// Hide the list.
setCollapsed(true);
}
Expand Down Expand Up @@ -158,6 +160,9 @@ private void setVenue(Venue venue) {
final StringArrayAdapter adapter = new StringArrayAdapter(context, drawingNames);
listView.setAdapter(adapter);

// Highlight the currently selected drawing.
updateSelectedDrawingPosition();

// This Runnable gets called after the ListView has been measured
// and laid out. Then we calculate the height of listView.
listView.post(new Runnable() {
Expand Down Expand Up @@ -242,6 +247,27 @@ private void onDrawingSelected(final VenueDrawing selectedDrawing) {
return;
}
String selectedDrawingName = getDrawingName(selectedDrawing);
updateSelectedDrawingPosition();
}

// Updates the adapter's selected position to match the currently selected drawing.
private void updateSelectedDrawingPosition() {
if (venue == null) return;
ListAdapter adapter = listView.getAdapter();
if (!(adapter instanceof StringArrayAdapter)) return;

VenueDrawing selectedDrawing = venue.getSelectedDrawing();

VenueModel venueModel = venue.getVenueModel();
List<VenueDrawing> drawings = venueModel.getDrawings();
int selectedIndex = -1;
for (int i = 0; i < drawings.size(); i++) {
if (drawings.get(i) == selectedDrawing) {
selectedIndex = i;
break;
}
}
((StringArrayAdapter) adapter).setSelectedPosition(selectedIndex);
}

public void setVisible(boolean visible) {
Expand Down
Loading