Mobile Development 11/21/2020 Work Session

 Right now, I am trying to perform facial recognition using an android API and the Google Camera. I hope to get this working at the end of this 4-5-hour session. My mom watches me and tells me to not go on the computer past a certain time, so unfortunately this work session might be much shorter than this. 


This link tells how to perform facial recognition using Mobile Vision.

I will perform Mobile Vision using my own face, as follows: 




I'm not sure what to do with the code yet, but I think the best first choice is to use the ID for the button capture and this is called"@+id/btn_capture".

An intent is like a segue. New plan, I am going to use this tutorial instead.

I first create a project on the firebase.



The thermometer is initializing here. I then go to the build.gradle app script in order to get the package name. I then get the application id, which is "com.example.digitalthermometer". I now have my app registered, and am going to download the google-services.json. I then drag and drop the googleservices.json inside the folder. 

I then added the line classpath 'com.google.gms:google-services:4.3.4' to the SDK. 

Here is the link for the firebase dependencies.


I apply the com.google.firebase:firebase-analytics implementation and then, then get the CameraKit implementation. With the line implementation 'com.wonderkiln.cameraKit:0.13.1'. I finally want to add the MLVision APIs by applying the correponding API call. Now, I want to implement the dialog box. To do this I go to this link. and I added the line implementation 'com.github.d-max:spots-dialog:1.1@aar'. 

I then add the following line to the Android Manifest:

<meta-data>

android:name="com.google.firebase:firebase-ml-vision.DEPENDENCIES"

android:value = "face"   

</meta-data>

I then subsequently implement a graphic overlay variable, with this link. I create a new package with a Helper class nested and copy past the rect overlay class inside of it.


The Rect Overlay ideally extends the GraphicOverlay.Graphic class. I get mRectPaint and mRectColor and set both the stroke and style


I assume cameradevice is mCameraDevice here?


Right now, I will comment the lines of code and implement them if the work. 


Oh no, this didn't work.

I'm going back to mobile vision, because the video is wayyy too outdated and a waste of my time. Back to mobile vision.


I first download the Github App Project. I know the real reason why nothing is working is that I didn't start my getting started project. 


I recieved the following error: 

Execution failed for task ':app:checkDebugAarMetadata'. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Could not find com.android.support:appcompat-v7:24.2.1. Searched in the following locations: - https://jcenter.bintray.com/com/android/support/appcompat-v7/24.2.1/appcompat-v7-24.2.1.pom If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration. Required by: project :app > Could not find com.google.android.gms:play-services-vision:9.4.0. Searched in the following locations: - https://jcenter.bintray.com/com/google/android/gms/play-services-vision/9.4.0/play-services-vision-9.4.0.pom If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration. Required by: project :app Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html


So as a result, I know that I need to update my Android Studio. 


Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.

   > Could not find com.wonderkiln.cameraKit:0.13.1:.

     Required by:

         project :app


Possible solution:

 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html


This is a new error, so now I am trying to find a new camera kit. 


I add the repo:


maven { url 'https://camerakit.bintray.com/camerakit-android-prereleases' }

and run the code again.


I attempt to update Android Studio Again.  Once I add the line, this method error code: 

Build file 'C:\Users\cchu3\OneDrive\Documents\DigitalThermometer\build.gradle' line: 10


A problem occurred evaluating root project 'Digital Thermometer'.

> Could not find method maven() for arguments [build_dlskn0bldrd47ejapfszgf1kn$_run_closure1$_closure3$_closure4@4881ce8d] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

 is invoked again. I perform a stack overflow search. 

https://stackoverflow.com/questions/54308077/solution-for-could-not-find-method-maven

This answer asked me to add the repository.

To solve this, I need to get the bintray to approve the maven packages.

maven { url 'https://wonderkiln.bintray.com/maven' } is the line of code that I should use.

That didn't work, so I try to add maven { url 'https://camerakit.bintray.com/camerakit-android-prereleases' } to the all-projects repositories instead in the gradle (or yaml or whatever) file.

And now I have a new error: 

Execution failed for task ':app:checkDebugAarMetadata'. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Could not find com.android.support:appcompat-v7:24.2.1. Searched in the following locations: - https://jcenter.bintray.com/com/android/support/appcompat-v7/24.2.1/appcompat-v7-24.2.1.pom - https://camerakit.bintray.com/camerakit-android-prereleases/com/android/support/appcompat-v7/24.2.1/appcompat-v7-24.2.1.pom Required by: project :app > Could not find com.google.android.gms:play-services-vision:9.4.0. Searched in the following locations: - https://jcenter.bintray.com/com/google/android/gms/play-services-vision/9.4.0/play-services-vision-9.4.0.pom - https://camerakit.bintray.com/camerakit-android-prereleases/com/google/android/gms/play-services-vision/9.4.0/play-services-vision-9.4.0.pom Required by: project :app Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
/

I then try adding the google and the mavenLocal repository. 

Finally the app works, but now I need to move to the next step after getting the scarlet Johannsen lookalike.

Comments

Popular Posts