Skip to content

Commit

Permalink
Updating dependencies and compileSdkVersions, Closes LOC-9 (#128)
Browse files Browse the repository at this point in the history
* Updating versions of dependencies and compileSdkVersions

* Fixes compilation warnings
  • Loading branch information
Sébastien Roger authored May 25, 2022
1 parent 8914b02 commit d0fc530
Show file tree
Hide file tree
Showing 19 changed files with 82 additions and 75 deletions.
36 changes: 18 additions & 18 deletions FantasmoDemoApp/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ android {
keyPassword 'fantasmo'
}
}
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
applicationId "com.example.fantasmo_android"
minSdkVersion 19
targetSdkVersion 30
targetSdkVersion 31
versionCode 2
versionName "2.0"
multiDexEnabled = true
Expand Down Expand Up @@ -73,36 +73,36 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.aar'])

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

// Fragment Navigation
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'

// Google ARCore
implementation 'com.google.ar:core:1.29.0'
implementation 'com.google.ar:core:1.31.0'

// Location Services
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'com.google.android.gms:play-services-maps:18.0.2'

// Barcode model dependencies
implementation 'com.google.mlkit:barcode-scanning:17.0.0'
implementation 'com.google.mlkit:barcode-scanning:17.0.2'

//GSON for JSON parse
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.android.volley:volley:1.2.0'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.android.volley:volley:1.2.1'

// Tensor
implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0'
implementation 'org.tensorflow:tensorflow-lite-support:0.4.0'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.4.0'

implementation 'org.tensorflow:tensorflow-lite-gpu:2.3.0'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.8.0'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
3 changes: 2 additions & 1 deletion FantasmoDemoApp/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
android:value="@string/google_maps_key"/>
<activity
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize">
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import com.fantasmo.sdk.views.FMParkingViewProtocol
import com.fantasmo.sdk.views.FMQRScanningViewProtocol

import com.google.android.gms.maps.MapView
import com.google.mlkit.vision.barcode.Barcode
import com.google.mlkit.vision.barcode.common.Barcode
import java.util.*

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import com.fantasmo.sdk.FMResultConfidence
import com.fantasmo.sdk.models.ErrorResponse
import com.fantasmo.sdk.views.FMParkingView
import com.fantasmo.sdk.views.FMParkingViewProtocol
import com.google.mlkit.vision.barcode.Barcode
import com.google.mlkit.vision.barcode.common.Barcode
import java.util.*

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ class MainActivity : AppCompatActivity() {
private fun setStartDestination() {
if (arcoreCompatibility) {
if (SimulationUtils.useDemoFragment) {
graph.startDestination = R.id.arcore_fragment
graph.setStartDestination(R.id.arcore_fragment)
} else {
graph.startDestination = R.id.custom_arcore_fragment
graph.setStartDestination(R.id.custom_arcore_fragment)
}
} else {
graph.startDestination = R.id.noarcore_fragment
graph.setStartDestination(R.id.noarcore_fragment)
}
navController.graph = graph
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class SystemLocationManager(

private val TAG = SystemLocationManager::class.java.simpleName
private var locationManager: LocationManager =
context?.getSystemService(Context.LOCATION_SERVICE) as LocationManager
context!!.getSystemService(Context.LOCATION_SERVICE) as LocationManager
private var fusedLocationClient: FusedLocationProviderClient =
LocationServices.getFusedLocationProviderClient(context)
LocationServices.getFusedLocationProviderClient(context!!)
private var currentLocation: Location = Location("")
private val locationInterval = 300L
private var firstLocation = false
Expand Down
4 changes: 2 additions & 2 deletions FantasmoDemoApp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.31"
ext.kotlin_version = '1.6.21'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// Navigation
Expand Down
4 changes: 2 additions & 2 deletions FantasmoDemoApp/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Nov 22 16:38:05 WET 2021
#Wed May 18 16:35:46 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
2 changes: 1 addition & 1 deletion FantasmoSDK/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions FantasmoSDK/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion FantasmoSDK/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 23 additions & 23 deletions FantasmoSDK/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ plugins {
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdkVersion 31
buildToolsVersion "31.0.0"

testOptions {
unitTests {
Expand All @@ -19,7 +19,7 @@ android {

defaultConfig {
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 31
versionCode 68
versionName "3.3.1"

Expand Down Expand Up @@ -105,36 +105,36 @@ android {
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'com.android.volley:volley:1.2.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1-native-mt'
implementation 'com.google.code.gson:gson:2.9.0'

// ARCore
implementation 'com.google.ar:core:1.29.0'
implementation 'com.google.ar:core:1.31.0'

// Location Manager
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.google.android.gms:play-services-location:19.0.1'

// Barcode model dependencies
implementation 'com.google.mlkit:barcode-scanning:17.0.0'
implementation 'com.google.mlkit:barcode-scanning:17.0.2'

// TensorFlow Lite
implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.3.0'
implementation 'org.tensorflow:tensorflow-lite-support:0.4.0'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.4.0'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.8.0'

// Layouts
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'

testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.1-native-mt'
testImplementation 'junit:junit:4.13.2'
testImplementation "org.robolectric:robolectric:4.5.1"
testImplementation "org.mockito:mockito-core:3.8.0"
testImplementation 'org.mockito:mockito-inline:2.13.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
testImplementation 'org.robolectric:robolectric:4.8.1'
testImplementation 'org.mockito:mockito-core:4.5.1'
testImplementation 'org.mockito:mockito-inline:4.5.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
4 changes: 3 additions & 1 deletion FantasmoSDK/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<!-- "AR Optional" app, contains non-AR features that can be used when
"Google Play Services for AR" (ARCore) is not available. -->
<meta-data android:name="com.google.ar.core" android:value="optional" />

<uses-native-library
android:name="libOpenCL.so"
android:required="false"/>
</application>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ class ImageQualityModelUpdater(val context: Context) {
{ response ->
try {
Log.d(TAG, "Model Network Response received, writing to file...")
val fileOutputStream = FileOutputStream(File(context.filesDir, fileName))
val fileOutputStream = FileOutputStream(fileName?.let {
File(context.filesDir,
it
)
})
fileOutputStream.write(response)
fileOutputStream.close()
Log.d(TAG, "Model File Successfully Downloaded.")
Expand Down Expand Up @@ -115,8 +119,8 @@ class ImageQualityModelUpdater(val context: Context) {
if(fileName == null) {
return null
}
val file = File(context.filesDir, fileName)
if (!file.exists()) {
val file = fileName?.let { File(context.filesDir, it) }
if (file == null || !file.exists()) {
if (!hasRequestedModel) {
if (hasRequestedUpdate) {
Log.d(TAG, "New Model version: $modelVersion. Downloading it...")
Expand Down Expand Up @@ -144,7 +148,7 @@ class ImageQualityModelUpdater(val context: Context) {
Log.e(TAG, "Error on reading the model.")
null
} catch (e: Error) {
Log.e(TAG, e.localizedMessage)
e.localizedMessage?.let { Log.e(TAG, it) }
null
} catch (ex: Exception) {
//could be delegate problem, trying again with CPU
Expand All @@ -158,11 +162,11 @@ class ImageQualityModelUpdater(val context: Context) {
firstRead = false
interpreter
} catch(ex: Exception) {
Log.e(TAG, ex.localizedMessage)
ex.localizedMessage?.let { Log.e(TAG, it) }
null
}
} else {
Log.e(TAG, ex.localizedMessage)
ex.localizedMessage?.let { Log.e(TAG, it) }
null
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import android.util.Log
import com.fantasmo.sdk.models.FMFrame
import com.fantasmo.sdk.views.FMParkingViewProtocol
import com.fantasmo.sdk.views.FMQRScanningViewProtocol
import com.google.mlkit.vision.barcode.Barcode
import com.google.mlkit.vision.barcode.common.Barcode
import com.google.mlkit.vision.barcode.BarcodeScanner
import com.google.mlkit.vision.barcode.BarcodeScannerOptions
import com.google.mlkit.vision.barcode.BarcodeScanning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class FMARCoreView(
config.cloudAnchorMode = Config.CloudAnchorMode.DISABLED
config.lightEstimationMode = Config.LightEstimationMode.DISABLED
config.depthMode = Config.DepthMode.DISABLED
config.augmentedImageDatabase = null
config.augmentedImageDatabase = AugmentedImageDatabase(arSession!!)

var selectedSize = Size(0, 0)
var selectedCameraConfig = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.fantasmo.sdk.views
import com.fantasmo.sdk.FMBehaviorRequest
import com.fantasmo.sdk.FMLocationResult
import com.fantasmo.sdk.models.ErrorResponse
import com.google.mlkit.vision.barcode.Barcode
import com.google.mlkit.vision.barcode.common.Barcode

interface FMParkingViewProtocol {

Expand Down
9 changes: 6 additions & 3 deletions FantasmoSDK/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.31"
ext.kotlin_version = '1.6.21'
repositories {
google()
mavenCentral()
maven {
url 'https://storage.googleapis.com/r8-releases/raw'
}
}
dependencies {
classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

classpath 'com.android.tools:r8:3.0.77'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
4 changes: 2 additions & 2 deletions FantasmoSDK/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Nov 22 16:40:21 WET 2021
#Wed May 18 17:22:33 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit d0fc530

Please sign in to comment.