Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Fix #449 - Targeted latest API version and updated looks using new API o... #460

Open
wants to merge 14 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
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ before_script:

script:
- ./wait_for_emulator
- ./gradlew connectedCheck -PdisablePreDex
- ./gradlew connectedCheck -PdisablePreDex

# Integration with Gitter (https://gitter.im/CUTR-at-USF/OpenTripPlanner-for-Android)
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/92762176661b63005621
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
OpenTripPlanner for Android [![Build Status](https://travis-ci.org/CUTR-at-USF/OpenTripPlanner-for-Android.svg?branch=master)](https://travis-ci.org/CUTR-at-USF/OpenTripPlanner-for-Android)
OpenTripPlanner for Android [![Build Status](https://travis-ci.org/CUTR-at-USF/OpenTripPlanner-for-Android.svg?branch=master)](https://travis-ci.org/CUTR-at-USF/OpenTripPlanner-for-Android) [![Join the chat at https://gitter.im/CUTR-at-USF/OpenTripPlanner-for-Android](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/CUTR-at-USF/OpenTripPlanner-for-Android?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
===========================

[![Join the chat at https://gitter.im/CUTR-at-USF/OpenTripPlanner-for-Android](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/CUTR-at-USF/OpenTripPlanner-for-Android?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

An Android app for multi-modal trip planning and navigation using any OpenTripPlanner server.

Download the app via the [Google Play store](https://play.google.com/store/apps/details?id=edu.usf.cutr.opentripplanner.android).
Expand Down
12 changes: 6 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Mar 06 10:05:36 EST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
#Mon Dec 22 22:23:08 CET 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
19 changes: 12 additions & 7 deletions opentripplanner-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'android'

repositories {
mavenCentral()
Expand All @@ -37,14 +37,14 @@ repositories {
}

android {
compileSdkVersion 21
compileSdkVersion 23
buildToolsVersion "21.1.2"

defaultConfig {
versionCode 15
versionName "2.1.2"
minSdkVersion 8
targetSdkVersion 13
minSdkVersion 9
targetSdkVersion 23
}

// http://stackoverflow.com/questions/20673625/gradle-0-7-0-duplicate-files-during-packaging-of-apk
Expand Down Expand Up @@ -111,13 +111,18 @@ tasks.whenTaskAdded { theTask ->
}

dependencies {
compile 'com.android.support:support-v4:19.1.+'
compile 'com.google.android.gms:play-services:3.2.65'
compile 'com.android.support:support-v4:23.1.1'
// Only include Google Play Services maps and location libraries
compile 'com.google.android.gms:play-services-maps:7.8.0'
compile 'com.google.android.gms:play-services-location:7.8.0'
// Jackson is used for parsing JSON REST API responses
compile 'com.fasterxml.jackson.core:jackson-core:2.4.1'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.4.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.1.1'
// POJOs used for full data-binding via Jackson
compile 'edu.usf.cutr.opentripplanner.android:opentripplanner-pojos:1.0.0-SNAPSHOT'
// OpenCSV, for parsing the OTP Server Directory Google Doc
compile 'net.sf.opencsv:opencsv:2.3'
// Map util (point in bounding box)
compile 'com.google.maps.android:android-maps-utils:0.4'
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public class BoundsTest extends AndroidTestCase {

public static final String TAG = "BoundsTest";

public static final int ACCEPTABLE_ERROR = 10; // meters

Server serverTampa = new Server();

Server serverPortland = new Server();
Expand All @@ -41,6 +39,8 @@ public class BoundsTest extends AndroidTestCase {

Server serverChukotkaPeninsulaIDL = new Server();

Server serverUnitedStates = new Server();

@Override
protected void setUp() throws Exception {
// Tampa server
Expand Down Expand Up @@ -112,103 +112,115 @@ protected void setUp() throws Exception {
serverChukotkaPeninsulaIDL.setContactName("Unknown");
serverChukotkaPeninsulaIDL.setContactEmail("Unknown");

// United States
serverUnitedStates.setRegion("United States");
serverUnitedStates.setBaseURL("http://us-server.com");
serverUnitedStates.setBounds("24.5454892,-124.16933,49.273757,-69.965541");
serverUnitedStates.setLanguage("en_US");
serverUnitedStates.setContactName("Unknown");
serverUnitedStates.setContactEmail("Unknown");

super.setUp();
}

public void testBoundsEvaluation() {
// Tampa server
LatLng pointInTampa1 = new LatLng(27.9710, -82.4650);
Assert.assertTrue(
LocationUtil.checkPointInBoundingBox(pointInTampa1, serverTampa, ACCEPTABLE_ERROR));
LocationUtil.checkPointInBoundingBox(pointInTampa1, serverTampa));

LatLng pointOutOfTampa1 = new LatLng(45.416, -122.839);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfTampa1, serverTampa, ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointOutOfTampa1, serverTampa));

// Portland server
LatLng pointInPortland1 = new LatLng(45.518, -122.6800);
Assert.assertTrue(LocationUtil
.checkPointInBoundingBox(pointInPortland1, serverPortland, ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointInPortland1, serverPortland));

LatLng pointOutOfPortland1 = new LatLng(45.416, -122.939);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfPortland1, serverPortland, ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointOutOfPortland1, serverPortland));

// Greenville server
LatLng pointInGreenville1 = new LatLng(34.84733, -82.39693);
Assert.assertTrue(LocationUtil
.checkPointInBoundingBox(pointInGreenville1, serverGreenville, ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointInGreenville1, serverGreenville));

LatLng pointOutOfGreenville1 = new LatLng(45.416, -122.839);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfGreenville1, serverGreenville,
ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointOutOfGreenville1, serverGreenville));

// Calgary server
LatLng pointInCalgary1 = new LatLng(50.7100302, -114.6108674);
Assert.assertTrue(LocationUtil
.checkPointInBoundingBox(pointInCalgary1, serverCalgary, ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointInCalgary1, serverCalgary));

LatLng pointOutOfCalgary1 = new LatLng(45.416, -122.839);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfCalgary1, serverCalgary, ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointOutOfCalgary1, serverCalgary));

// Porto server
LatLng pointInPorto1 = new LatLng(41.1554, -8.6078);
Assert.assertTrue(
LocationUtil.checkPointInBoundingBox(pointInPorto1, serverPorto, ACCEPTABLE_ERROR));
LocationUtil.checkPointInBoundingBox(pointInPorto1, serverPorto));

LatLng pointOutOfPorto1 = new LatLng(45.416, -122.839);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfPorto1, serverPorto, ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointOutOfPorto1, serverPorto));

// Portland big bounds server
LatLng pointInPortlandBigBounds1 = new LatLng(45.518, -122.6800);
Assert.assertTrue(LocationUtil
.checkPointInBoundingBox(pointInPortlandBigBounds1, serverPortlandBigBounds,
ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointInPortlandBigBounds1, serverPortlandBigBounds));

LatLng pointOutOfPortlandBigBounds1 = new LatLng(27.9710, -82.4650);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfPortlandBigBounds1, serverPortlandBigBounds,
ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointOutOfPortlandBigBounds1, serverPortlandBigBounds));

// FijiIDL server
LatLng pointInFijiIDLPositive = new LatLng(-16.407, -179.8141);
Assert.assertTrue(LocationUtil
.checkPointInBoundingBox(pointInFijiIDLPositive, serverFijiIDL, ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointInFijiIDLPositive, serverFijiIDL));

LatLng pointOutOfFijiIDLPositive = new LatLng(-17.6995, 175.6581);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfFijiIDLPositive, serverFijiIDL,
ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointOutOfFijiIDLPositive, serverFijiIDL));

LatLng pointInFijiIDLNegative = new LatLng(-16.9089, -179.8151);
Assert.assertTrue(LocationUtil
.checkPointInBoundingBox(pointInFijiIDLNegative, serverFijiIDL, ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointInFijiIDLNegative, serverFijiIDL));

LatLng pointOutOfFijiIDLNegative = new LatLng(-16.5907, -178.8570);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfFijiIDLNegative, serverFijiIDL,
ACCEPTABLE_ERROR));
.checkPointInBoundingBox(pointOutOfFijiIDLNegative, serverFijiIDL));

// ChukotkaPeninsulaIDL server
LatLng pointInChukotkaPeninsulaIDLPositive = new LatLng(66.8878, 179.1520);
Assert.assertTrue(LocationUtil.checkPointInBoundingBox(pointInChukotkaPeninsulaIDLPositive,
serverChukotkaPeninsulaIDL, ACCEPTABLE_ERROR));
serverChukotkaPeninsulaIDL));

LatLng pointOutOfChukotkaPeninsulaIDLPositive = new LatLng(-17.6995, 175.6581);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfChukotkaPeninsulaIDLPositive,
serverChukotkaPeninsulaIDL, ACCEPTABLE_ERROR));
serverChukotkaPeninsulaIDL));

LatLng pointInChukotkaPeninsulaIDLNegative = new LatLng(67.2878, -179.7276);
Assert.assertTrue(LocationUtil.checkPointInBoundingBox(pointInChukotkaPeninsulaIDLNegative,
serverChukotkaPeninsulaIDL, ACCEPTABLE_ERROR));
serverChukotkaPeninsulaIDL));

LatLng pointOutOfChukotkaPeninsulaIDLNegative = new LatLng(67.2878, -178.7276);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfChukotkaPeninsulaIDLNegative,
serverChukotkaPeninsulaIDL, ACCEPTABLE_ERROR));
serverChukotkaPeninsulaIDL));

// USA server
LatLng pointInUsaPositive = new LatLng(28.05866283764341, -82.41802878677845);
Assert.assertTrue(LocationUtil.checkPointInBoundingBox(pointInUsaPositive,
serverUnitedStates));

LatLng pointOutOfUsaPositive = new LatLng(67.2878, -178.7276);
Assert.assertFalse(LocationUtil
.checkPointInBoundingBox(pointOutOfUsaPositive, serverUnitedStates));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ public class OTPApp extends Application {

public static final double BIKE_PARAMETERS_MAX_VALUE = 1.0;

public static final int CHECK_BOUNDS_ACCEPTABLE_ERROR = 1000;

public static final float COORDINATES_IMPORTANT_DIFFERENCE = 2000f;

public static final int ADDRESS_MAX_LINES_TO_SHOW = 5;
Expand Down Expand Up @@ -181,6 +179,14 @@ public class OTPApp extends Application {

public static final int COLOR_ROUTE_LINE = 0x7F0000FF;

public static final int OPTIMIZATION_QUICK = 0;

public static final int OPTIMIZATION_SAFE = 1;

public static final int OPTIMIZATION_TRANSFERS = 2;

public static final int OPTIMIZATION_TRIANGLE = 3;

/**
* Preference keys
*/
Expand Down
Loading