Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bastinagual committed Jun 2, 2022
2 parents 0d59efd + 8647488 commit 7397cfa
Show file tree
Hide file tree
Showing 68 changed files with 736 additions and 370 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'
}
Binary file removed FantasmoDemoApp/app/libs/FantasmoSDK_3.3.1.aar
Binary file not shown.
Binary file added FantasmoDemoApp/app/libs/FantasmoSDK_3.4.0.aar
Binary file not shown.
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 @@ -7,13 +7,16 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.Toast
import androidx.fragment.app.Fragment
import com.example.fantasmo_android.helpers.SimulationUtils
import com.example.fantasmo_android.helpers.SystemLocationListener
import com.example.fantasmo_android.helpers.SystemLocationManager
import com.fantasmo.sdk.FMLocationListener
import com.fantasmo.sdk.FMLocationManager
import com.fantasmo.sdk.FMLocationResult
import com.fantasmo.sdk.models.ErrorResponse
import com.fantasmo.sdk.views.FMParkingView

class NoARCoreFragment : Fragment() {

Expand All @@ -28,6 +31,8 @@ class NoARCoreFragment : Fragment() {
// Host App location Manager to exemplify how to set Location
private lateinit var systemLocationManager: SystemLocationManager

private var deviceLocation: Location? = null

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
Expand All @@ -54,22 +59,31 @@ class NoARCoreFragment : Fragment() {
// depending on which SDK flavor it's being used (Paris, Munich, Miami)
//fmLocationManager.isSimulation = true

// Connect the FMLocationManager from Fantasmo SDK
fmLocationManager.connect(
"API_KEY",
fmLocationListener
)

checkParkingButton.setOnClickListener {
Log.d(TAG, "CheckPark Pressed")
/*
fmLocationManager.isZoneInRadius(FMZone.ZoneType.PARKING, 23) {
Toast.makeText(
activity?.applicationContext,
"Is Zone In Radius Response: $it",
Toast.LENGTH_LONG
).show()
}*/
val myLocation = getMyLocation()
if(myLocation != null) {
FMParkingView.isParkingAvailable(
requireContext(),
SimulationUtils.API_KEY,
myLocation
){
Toast.makeText(
activity?.applicationContext,
"Is Zone In Radius Response: $it",
Toast.LENGTH_LONG
).show()
}
}
}
}

private fun getMyLocation(): Location? {
return if(deviceLocation != null) {
deviceLocation
} else Location("").apply{
this.latitude = SimulationUtils.latitude
this.longitude = SimulationUtils.longitude
}
}

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.

51 changes: 26 additions & 25 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,9 +19,10 @@ android {

defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionCode 68
versionName "3.3.1"
targetSdkVersion 31
versionCode 69
versionName "3.4.0"
renderscriptTargetApi 24

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down Expand Up @@ -105,36 +106,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
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.fantasmo.sdk.fantasmosdk.BuildConfig
/**
* Class to load configuration values like coordinates or server URLs.
*/
class FMConfiguration {
internal class FMConfiguration {

companion object {
/**
Expand Down
Loading

0 comments on commit 7397cfa

Please sign in to comment.