Skip to content

Commit

Permalink
Updated demo app to use latest APIs (#90)
Browse files Browse the repository at this point in the history
* Bump rexml from 3.3.3 to 3.3.6

Bumps [rexml](https://github.com/ruby/rexml) from 3.3.3 to 3.3.6.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](ruby/rexml@v3.3.3...v3.3.6)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump micromatch from 4.0.7 to 4.0.8 in /scripts/translation-script

Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.7 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/micromatch@4.0.7...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump axios from 1.7.2 to 1.7.7 in /scripts/translation-script

Bumps [axios](https://github.com/axios/axios) from 1.7.2 to 1.7.7.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.7.2...v1.7.7)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* Updated to use upload-artifacts/v4 (#82)

* Bump serve-static from 1.15.0 to 1.16.2 in /scripts/translation-script (#81)

Bumps [serve-static](https://github.com/expressjs/serve-static) from 1.15.0 to 1.16.2.
- [Release notes](https://github.com/expressjs/serve-static/releases)
- [Changelog](https://github.com/expressjs/serve-static/blob/v1.16.2/HISTORY.md)
- [Commits](expressjs/serve-static@v1.15.0...v1.16.2)

---
updated-dependencies:
- dependency-name: serve-static
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cookie and aws-amplify in /scripts/translation-script

Removes [cookie](https://github.com/jshttp/cookie). It's no longer used after updating ancestor dependency [aws-amplify](https://github.com/aws-amplify/amplify-js). These dependencies need to be updated together.


Removes `cookie`

Updates `aws-amplify` from 5.3.19 to 6.6.6
- [Release notes](https://github.com/aws-amplify/amplify-js/releases)
- [Commits](https://github.com/aws-amplify/amplify-js/compare/[email protected]@6.6.6)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
- dependency-name: aws-amplify
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* [ALS-1806] Removed amplify libraries, updated dependencies, and added/modified unit and E2E test cases (#84)

* build: SDK versions and dependencies update

* refactor: Remove amplify dependency from the demo app and related code updated
test: Unit test cases added for fetch token and refresh token
test: Existing test cases updated for amplify removal change

ALS-1806

* Merge branch 'refs/heads/main' into ALS-1806

# Conflicts:
#	app/build.gradle
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/com/aws/amazonlocation/ui/main/MainActivity.kt
#	app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt
#	app/src/main/java/com/aws/amazonlocation/ui/main/setting/AWSCloudInformationFragment.kt
#	app/src/main/java/com/aws/amazonlocation/ui/main/setting/SettingFragment.kt
#	app/src/main/java/com/aws/amazonlocation/ui/main/tracking/TrackingUtils.kt
#	app/src/main/java/com/aws/amazonlocation/utils/MapHelper.kt
#	app/src/test/java/com/aws/amazonlocation/mock/Responses.kt
#	build.gradle
#	gradle.properties
#	gradle/wrapper/gradle-wrapper.properties
#	jacoco.gradle

* fix: location engine initalization change with fused location

ALS-1806

* fix: removed java home from gradle.properties

ALS-1806

* fix: tablet design updated for web view sign in
fix: E2E test cases updated

ALS-1806

* refactor: Removed pinpoint/analytics from app

ALS-1806

* fix: workflow fixed for distribution

ALS-1806

* refactor: Removed pinpoint/analytics from the app

ALS-1806

* fix: removed unused variables

ALS-1806

* fix: Simulation restart and from grab map simulation start bug fixed
fix: Sign in fail bug fix

ALS-1806

* fix: Open data Map style selection with Ca-Central Stack bug fix
fix: Grab data map style selection from Southeast Asia Stack bug fix

ALS-1806

* fix: Node js version update for workflow

ALS-1806

* fix: Disconnection from settings bug fix

ALS-1806

* fix: Gemfile updated for github workflow

ALS-1806

* fix: Gemfile updated for github workflow

ALS-1806

* fix: Gemfile updated for github workflow

ALS-1806

* fix: update ruby version for github workflow

ALS-1806

* fix: update ruby version for github workflow

ALS-1806

* fix: update ruby version for github workflow

ALS-1806

* fix: update ruby version for github workflow

ALS-1806

* fix: update ruby version for github workflow

ALS-1806

* fix: update ruby version for github workflow

ALS-1806

* fix: auth credentials refresh from interceptor fix

ALS-1806

* fix: map style clear filter selection bug fix

ALS-1806

* fix: POI card open on geofence tab bug fix

ALS-1806

* fix: E2E test suits renamed
fix: ktlint disable commands removed all over the app
fix: Few grammatical mistakes addressed and methods renamed
fix: unit test cases lat, lng fixes

ALS-1806

* fix: rights label updated

ALS-1806

* refactor: Added pinpoint with aws kotlin SDK

ALS-1869

* fix: session stop and end event fixed

ALS-1869

* fix: Unit test case fix and comment updated on basis of that
ALS-1806

* fix: test case method and strings renamed and lat and lng position issue solved

ALS-1806

---------

Co-authored-by: shah <[email protected]>

* feat: V2 sdk implemented for map, place and routes with unit and E2E tests
fix: unit and E2E test cases updated

ALS-1808

* test: E2E test cases added for V2 map political view
refactor : Unused files removed and strings file updated

ALS-1808

* test: E2E test cases update

ALS-1808

* fix: ap-southeast region removed
fix: PAK country removed from political view
test: Unit test cases updated

ALS-1808

* fix: README file updated
fix: Geofence screen bug fixes
fix: E2E test cases renamed

ALS-1808

* fix: search direction text cutting bug fix and back press in map style bug fix

ALS-1808

* fix: region selection and Webview first time not loading fixes

ALS-1808

* fix: code optimization

ALS-1808

* fix: code optimization

ALS-1808

* fix: code optimization

ALS-1808

* fix: code optimization

ALS-1808

* fix: cty name not showing and toggle disable for satellite and hybrid map fix

ALS-1808

* fix: simulation and suggest fixes

ALS-1808

* fix: simulation arabic fixes

ALS-1808

* Bump rexml from 3.3.7 to 3.3.9

Bumps [rexml](https://github.com/ruby/rexml) from 3.3.7 to 3.3.9.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](ruby/rexml@v3.3.7...v3.3.9)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: removed unnecessary code to change map style

ALS-1808

* fix: dialog show fix

ALS-1808

* fix: routes and places sdk upload

ALS-1808

* fix: routes and places sdk upload

ALS-1808

* fix: PR comment fixes

ALS-1808

* Switched to use public version of GeoPlaces and GeoRoutes.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Mike Balfour <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Juan Lucero <[email protected]>
Co-authored-by: Chris Galvan <[email protected]>
Co-authored-by: wadhawh <[email protected]>
Co-authored-by: shah <[email protected]>
  • Loading branch information
6 people authored Nov 6, 2024
1 parent 627ed57 commit d7b035c
Show file tree
Hide file tree
Showing 288 changed files with 9,612 additions and 32,137 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ concurrency:
on:
workflow_dispatch:
push:
branches: [ develop, main, master ]
branches: [ develop, main ]
jobs:
startSlackNotification:
name: Slack Starting Notification
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test-android-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ jobs:
profile: Nexus 6
script: |
adb emu geo fix 72.58727 23.02579
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.DefaultConnectionFlowSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.DefaultConnectionFlowSuite2
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.MapLoadAndPlaceSearchFlowSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.SearchDirectionFlowSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.MapStylesSettingAndExplorerFlowSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.AWSTrackingAndConnectionTestSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.AWSGeofenceAndConnectionTestSuite
Expand Down
64 changes: 17 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To use this code, you'll need an [AWS account](https://aws.amazon.com/) and reso

Once configured, you can build and run the app locally or execute automated tests. The project includes unit and end-to-end UI tests.

The app supports multiple map styles and providers like [Esri](https://docs.aws.amazon.com/location/latest/developerguide/esri.html), [HERE Technologies](https://docs.aws.amazon.com/location/latest/developerguide/HERE.html), [GrabMaps](https://docs.aws.amazon.com/location/latest/developerguide/grab.html), and [Open Data](https://docs.aws.amazon.com/location/latest/developerguide/open-data.html).
The app supports the following map styles: `Standard`, `Monochrome`, `Hybrid` and `Satellite`

Overall, this repo will help you get started with location-based features on Android using Amazon Location Services.

Expand All @@ -29,14 +29,11 @@ Below are the requirements for development, running and testing.
- `PinPointAppId` value will be added to `custom.properties` file against `ANALYTICS_APP_ID`.
- `WebSocketUrl` value will be added to `custom.properties` file against `SIMULATION_WEB_SOCKET_URL`.
- Take region from IdentityPoolId (Character before ':') that value will be added to `custom.properties` file against `DEFAULT_REGION`.
3. Run the [AWS CloudFormation template](https://ap-southeast-1.console.aws.amazon.com/cloudformation/home?region=ap-southeast-1#/stacks/create?stackName=amazon-location-default-unauth-resources&templateURL=https://amazon-location-demo-resources.s3.us-west-2.amazonaws.com/default-unauth-resources-template.yaml) or use the template from `/extra/default-unauth-resources-template.yaml` to create a cloudformation stack on AWS in `ap-southeast-1` region and get `IdentityPoolId`, `WebSocketUrl` from stack output's tab.
- `IdentityPoolId` value will be added to `custom.properties` file against `DEFAULT_IDENTITY_POOL_ID_AP`.
- `WebSocketUrl` value will be added to `custom.properties` file against `SIMULATION_WEB_SOCKET_URL_AP`.
4. Run the [AWS CloudFormation template](https://eu-west-1.console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/create?stackName=amazon-location-default-unauth-resources&templateURL=https://amazon-location-demo-resources.s3.us-west-2.amazonaws.com/default-unauth-resources-template.yaml) or use the template from `/extra/default-unauth-resources-template.yaml` to create a cloudformation stack on AWS in `eu-west-1` region and get `IdentityPoolId`, `WebSocketUrl` from stack output's tab.
3. Run the [AWS CloudFormation template](https://eu-west-1.console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/create?stackName=amazon-location-default-unauth-resources&templateURL=https://amazon-location-demo-resources.s3.us-west-2.amazonaws.com/default-unauth-resources-template.yaml) or use the template from `/extra/default-unauth-resources-template.yaml` to create a cloudformation stack on AWS in `eu-west-1` region and get `IdentityPoolId`, `WebSocketUrl` from stack output's tab.
- `IdentityPoolId` value will be added to `custom.properties` file against `DEFAULT_IDENTITY_POOL_ID_EU`.
- `WebSocketUrl` value will be added to `custom.properties` file against `SIMULATION_WEB_SOCKET_URL_EU`.
5. After adding all above details in `custom.properties` file in Android studio then open `Build -> Clean project` after this run project.
6. Run the [AWS CloudFormation template](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create?stackName=amazon-location-resources-setup&templateURL=https://amazon-location-resources-setup.s3.amazonaws.com/dev/main-cf-template.yaml) or use the template from `/extra/main-cf-template.yaml` using your own AWS account and get below data.
4. After adding all above details in `custom.properties` file in Android studio then open `Build -> Clean project` after this run project.
5. Run the [AWS CloudFormation template](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create?stackName=amazon-location-resources-setup&templateURL=https://amazon-location-resources-setup.s3.amazonaws.com/dev/main-cf-template.yaml) or use the template from `/extra/main-cf-template.yaml` using your own AWS account and get below data.
- `IdentityPoolId` value will be added to `custom.properties` file against `IDENTITY_POOL_ID`.
- `UserDomain` value will be added to `custom.properties` file against `USER_DOMAIN`.
- `UserPoolClientId` value will be added to `custom.properties` file against `USER_POOL_CLIENT_ID`.
Expand All @@ -54,11 +51,11 @@ Create *`custom.properties`* file inside the project root folder and add the det
|--------------------------------------|--------------------------------------------------------|
| DEFAULT_IDENTITY_POOL_ID | IdentityPoolId |
| DEFAULT_REGION | Take region from IdentityPoolId (Character before ':') |
| DEFAULT_IDENTITY_POOL_ID_EU | IdentityPoolId form eu-west-1 region |
| DEFAULT_IDENTITY_POOL_ID_AP | IdentityPoolId form ap-southeast-1 region |
| DEFAULT_IDENTITY_POOL_ID_EU | IdentityPoolId from eu-west-1 region |
| API_KEY_EU_CENTRAL | API key from eu-west-1 region |
| API_KEY_US_EAST | API key from us-east-1 region |
| SIMULATION_WEB_SOCKET_URL | Simulation WebSocketUrl |
| SIMULATION_WEB_SOCKET_URL_EU | Simulation WebSocketUrl form eu-west-1 region |
| SIMULATION_WEB_SOCKET_URL_AP | Simulation WebSocketUrl form ap-southeast-1 region |
| SIMULATION_WEB_SOCKET_URL_EU | Simulation WebSocketUrl from eu-west-1 region |
| ANALYTICS_APP_ID | AnalyticsAppId |
| IDENTITY_POOL_ID | IdentityPoolId |
| USER_DOMAIN | UserDomain |
Expand All @@ -72,10 +69,10 @@ Create *`custom.properties`* file inside the project root folder and add the det
DEFAULT_IDENTITY_POOL_ID=xx-xxxx-x:xxxx-xxxx-xxxx-xxxx
DEFAULT_REGION=xx-xxxx-x
DEFAULT_IDENTITY_POOL_ID_EU=xx-xxxx-x:xxxx-xxxx-xxxx-xxxx
DEFAULT_IDENTITY_POOL_ID_AP=xx-xxxx-x:xxxx-xxxx-xxxx-xxxx
API_KEY_US_EAST=xx.xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
API_KEY_EU_CENTRAL=xx.xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SIMULATION_WEB_SOCKET_URL=xxxxxxxxxxxx-xxx.xxx.xx-xxxx-x.xxxxxxxxxx.com
SIMULATION_WEB_SOCKET_URL_EU=xxxxxxxxxxxx-xxx.xxx.xx-xxxx-x.xxxxxxxxxx.com
SIMULATION_WEB_SOCKET_URL_AP=xxxxxxxxxxxx-xxx.xxx.xx-xxxx-x.xxxxxxxxxx.com
ANALYTICS_APP_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

Expand Down Expand Up @@ -127,50 +124,23 @@ E2E tests can be executed by the following gradle commands. Test suites are conf
Note:
1. Start the emulator before executing the commands.
2. If working on windows(Powershell/cmd) wrap the argument in double quotes.
eg: ./gradlew app:connectedDebugAndroidTest "-Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.DefaultConnectionFlowSuite"
eg: ./gradlew app:connectedDebugAndroidTest "-Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.MapLoadAndPlaceSearchFlowSuite"
```


./gradlew app:connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.DefaultConnectionFlowSuite
./gradlew app:connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.DefaultConnectionFlowSuite2
./gradlew app:connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.AWSTrackingAndConnectionTestSuite
./gradlew app:connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.AWSGeofenceAndConnectionTestSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.MapLoadAndPlaceSearchFlowSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.SearchDirectionFlowSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.MapStylesSettingAndExplorerFlowSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.AWSTrackingAndConnectionTestSuite
./gradlew app:connectedDebugAndroidTest -i -Pandroid.testInstrumentationRunnerArguments.class=com.aws.amazonlocation.ui.AWSGeofenceAndConnectionTestSuite

## Resources
> Maps (Name - Style)
- location.aws.com.demo.maps.Esri.DarkGrayCanvas - VectorEsriDarkGrayCanvas
- location.aws.com.demo.maps.Esri.Imagery - RasterEsriImagery
- location.aws.com.demo.maps.Esri.Light - VectorEsriTopographic
- location.aws.com.demo.maps.Esri.LightGrayCanvas - VectorEsriLightGrayCanvas
- location.aws.com.demo.maps.Esri.Navigation - VectorEsriNavigation
- location.aws.com.demo.maps.Esri.Streets - VectorEsriStreets
- location.aws.com.demo.maps.HERE.Explore - VectorHereExplore
- location.aws.com.demo.maps.HERE.Contrast - VectorHereContrast
- location.aws.com.demo.maps.HERE.ExploreTruck - VectorHereExploreTruck
- location.aws.com.demo.maps.HERE.Hybrid - HybridHereExploreSatellite
- location.aws.com.demo.maps.HERE.Imagery - RasterHereExploreSatellite
- location.aws.com.demo.maps.Grab.StandardLight - VectorGrabStandardLight
- location.aws.com.demo.maps.Grab.StandardDark - VectorGrabStandardDark
- location.aws.com.demo.maps.OpenData.StandardLight - VectorOpenDataStandardLight
- location.aws.com.demo.maps.OpenData.StandardDark - VectorOpenDataStandardDark
- location.aws.com.demo.maps.OpenData.VisualizationLight - VectorOpenDataVisualizationLight
- location.aws.com.demo.maps.OpenData.VisualizationDark - VectorOpenDataVisualizationDark

> Place indexes (Name)
- location.aws.com.demo.places.Esri.PlaceIndex
- location.aws.com.demo.places.HERE.PlaceIndex
- location.aws.com.demo.places.Grab.PlaceIndex

> Route calculators (Name)
- location.aws.com.demo.routes.Esri.RouteCalculator
- location.aws.com.demo.routes.HERE.RouteCalculator
- location.aws.com.demo.routes.Grab.RouteCalculator

> Geofence collections (Name)
- location.aws.com.demo.geofences.GeofenceCollection

> Trackers (Name)
- location.aws.com.demo.trackers.Tracker

## Contributing

See [CONTRIBUTING](./CONTRIBUTING.md) for more information.
Expand Down
17 changes: 9 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ android {
minSdk 24
targetSdk 34
versionCode 44
versionName "1.0.1"
versionName "1.1.0"
testInstrumentationRunner "com.aws.amazonlocation.AmazonLocationRunner"
buildConfigField 'String', 'ATTRIBUTION_LEARN_MORE_HERE_URL',"\"https://legal.here.com/en-gb/terms/general-content-supplier-terms-and-notices\""
buildConfigField 'String', 'ATTRIBUTION_LEARN_MORE_ESRI_URL',"\"https://www.esri.com/en-us/legal/terms/data-attributions\""
buildConfigField 'String', 'GRAB_LEARN_MORE',"\"https://docs.aws.amazon.com/location/latest/developerguide/grab.html\""
buildConfigField 'String', 'BASE_DOMAIN',"\"https://location.aws.com\""
buildConfigField 'String', 'AWS_TERMS_URL',"\"/demo/terms\""
buildConfigField 'String', 'CLOUD_FORMATION_READ_MORE_URL',"\"/demo/help\""
Expand All @@ -30,6 +29,8 @@ android {
buildConfigField 'String', 'AWS_PRIVACY_NOTICE',"\"https://aws.amazon.com/privacy/\""
buildConfigField 'String', 'AWS_NEAREST_REGION_CHECK_URL',"\"https://dynamodb.%s.amazonaws.com/\""

buildConfigField 'String', 'API_KEY_EU_CENTRAL',"\"${customConfig.getProperty("API_KEY_EU_CENTRAL")}\""
buildConfigField 'String', 'API_KEY_US_EAST',"\"${customConfig.getProperty("API_KEY_US_EAST")}\""
buildConfigField 'String', 'DEFAULT_IDENTITY_POOL_ID',"\"${customConfig.getProperty("DEFAULT_IDENTITY_POOL_ID")}\""
buildConfigField 'String', 'DEFAULT_REGION',"\"${customConfig.getProperty("DEFAULT_REGION")}\""
buildConfigField 'String', 'IDENTITY_POOL_ID',"\"${customConfig.getProperty("IDENTITY_POOL_ID")}\""
Expand All @@ -39,13 +40,11 @@ android {
buildConfigField 'String', 'WEB_SOCKET_URL',"\"${customConfig.getProperty("WEB_SOCKET_URL")}\""
buildConfigField 'String', 'SIMULATION_WEB_SOCKET_URL',"\"${customConfig.getProperty("SIMULATION_WEB_SOCKET_URL")}\""
buildConfigField 'String', 'SIMULATION_WEB_SOCKET_URL_EU',"\"${customConfig.getProperty("SIMULATION_WEB_SOCKET_URL_EU")}\""
buildConfigField 'String', 'SIMULATION_WEB_SOCKET_URL_AP',"\"${customConfig.getProperty("SIMULATION_WEB_SOCKET_URL_AP")}\""
buildConfigField 'String', 'USER_LOGIN_NAME',"\"${customConfig.getProperty("USER_LOGIN_NAME")}\""
buildConfigField 'String', 'USER_LOGIN_PASSWORD',"\"${customConfig.getProperty("USER_LOGIN_PASSWORD")}\""
buildConfigField 'String', 'ANALYTICS_IDENTITY_POOL_ID',"\"${customConfig.getProperty("ANALYTICS_IDENTITY_POOL_ID")}\""
buildConfigField 'String', 'ANALYTICS_APP_ID',"\"${customConfig.getProperty("ANALYTICS_APP_ID")}\""
buildConfigField 'String', 'DEFAULT_IDENTITY_POOL_ID_EU',"\"${customConfig.getProperty("DEFAULT_IDENTITY_POOL_ID_EU")}\""
buildConfigField 'String', 'DEFAULT_IDENTITY_POOL_ID_AP',"\"${customConfig.getProperty("DEFAULT_IDENTITY_POOL_ID_AP")}\""
}
signingConfigs {
release {
Expand Down Expand Up @@ -153,11 +152,13 @@ dependencies {
implementation "androidx.navigation:navigation-ui-ktx:2.7.7"
implementation "androidx.fragment:fragment-ktx:1.8.2"

implementation("aws.sdk.kotlin:iot:1.3.29")
implementation("aws.sdk.kotlin:iot:1.3.65")
implementation("com.amazonaws:aws-iot-device-sdk-java:1.3.9")
implementation("aws.sdk.kotlin:location:1.3.29")
implementation("aws.sdk.kotlin:cognitoidentity:1.3.29")
implementation("aws.sdk.kotlin:pinpoint:1.3.29")
implementation("aws.sdk.kotlin:location:1.3.65")
implementation("aws.sdk.kotlin:cognitoidentity:1.3.65")
implementation("aws.sdk.kotlin:pinpoint:1.3.65")
implementation("aws.sdk.kotlin:geoplaces:1.3.65")
implementation("aws.sdk.kotlin:georoutes:1.3.65")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
// Support for Java 8 features
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
Expand Down
52 changes: 43 additions & 9 deletions app/src/androidTest/java/com/aws/amazonlocation/AppModuleTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import com.aws.amazonlocation.data.repository.LocationSearchImp
import com.aws.amazonlocation.domain.repository.AuthRepository
import com.aws.amazonlocation.domain.repository.GeofenceRepository
import com.aws.amazonlocation.domain.repository.LocationSearchRepository
import com.aws.amazonlocation.utils.AWSLocationHelper
import com.aws.amazonlocation.utils.BottomSheetHelper
import com.aws.amazonlocation.utils.MapHelper
import com.aws.amazonlocation.utils.PreferenceManager
import com.aws.amazonlocation.utils.providers.GeofenceProvider
import com.aws.amazonlocation.utils.providers.LocationProvider
import com.aws.amazonlocation.utils.providers.PlacesProvider
import com.aws.amazonlocation.utils.providers.RoutesProvider
import com.aws.amazonlocation.utils.providers.TrackingProvider
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand All @@ -33,8 +37,8 @@ object AppModuleTest {

@Provides
@Singleton
fun getAWSLocationHelper(mMapHelper: MapHelper, mPreferenceManager: PreferenceManager) =
AWSLocationHelper(mMapHelper, mPreferenceManager)
fun getLocationProvider(mPreferenceManager: PreferenceManager) =
LocationProvider(mPreferenceManager)

@Provides
@Singleton
Expand All @@ -46,27 +50,57 @@ object AppModuleTest {
fun getMapHelper(@ApplicationContext appContext: Context) =
MapHelper(appContext)

@Provides
@Singleton
fun getPlacesProvider(mMapHelper: MapHelper,mPreferenceManager: PreferenceManager) =
PlacesProvider(mMapHelper, mPreferenceManager)

@Provides
@Singleton
fun getRoutesProvider(mPreferenceManager: PreferenceManager) =
RoutesProvider(mPreferenceManager)

@Provides
@Singleton
fun getGeofenceProvider() = GeofenceProvider()

@Provides
@Singleton
fun getTrackingProvider() = TrackingProvider()

@Provides
@Singleton
fun providesCommonRepositoryImp(
@ApplicationContext appContext: Context,
mAWSLocationHelper: AWSLocationHelper
mLocationHelper: LocationProvider,
mPlacesProvider: PlacesProvider,
mRoutesProvider: RoutesProvider,
mGeofenceProvider: GeofenceProvider,
mTrackingProvider: TrackingProvider,
): AuthRepository =
AuthImp(RemoteDataSourceImpl(appContext, mAWSLocationHelper))
AuthImp(RemoteDataSourceImpl(appContext, mLocationHelper, mPlacesProvider, mRoutesProvider, mGeofenceProvider, mTrackingProvider))

@Provides
@Singleton
fun providesLocationSearchRepository(
@ApplicationContext appContext: Context,
mAWSLocationHelper: AWSLocationHelper
mLocationProvider: LocationProvider,
mPlacesProvider: PlacesProvider,
mRoutesProvider: RoutesProvider,
mGeofenceProvider: GeofenceProvider,
mTrackingProvider: TrackingProvider,
): LocationSearchRepository =
LocationSearchImp(RemoteDataSourceImpl(appContext, mAWSLocationHelper))
LocationSearchImp(RemoteDataSourceImpl(appContext, mLocationProvider, mPlacesProvider, mRoutesProvider, mGeofenceProvider, mTrackingProvider))

@Provides
@Singleton
fun providesGeofenceRepository(
@ApplicationContext appContext: Context,
mAWSLocationHelper: AWSLocationHelper
mLocationProvider: LocationProvider,
mPlacesProvider: PlacesProvider,
mRoutesProvider: RoutesProvider,
mGeofenceProvider: GeofenceProvider,
mTrackingProvider: TrackingProvider,
): GeofenceRepository =
GeofenceImp(RemoteDataSourceImpl(appContext, mAWSLocationHelper))
GeofenceImp(RemoteDataSourceImpl(appContext, mLocationProvider, mPlacesProvider, mRoutesProvider, mGeofenceProvider, mTrackingProvider))
}
Loading

0 comments on commit d7b035c

Please sign in to comment.