Trying to import code from GitHub into Android Studio

I feel incredibly stupid asking about this, but I downloaded the Android Mobile Vision API code sample available here: https://github.com/googlesamples/android-vision .

I am trying to import this code into Android Studio so that I can just run sample applications, but no matter how I import (import an existing Android Studio project, import a non-Android Studio Project, Open Project) I cannot import it so that I could just compile and click the game to launch the application.

Since this is the official sample code from Android, I am sure it should not be so difficult. What am I missing?

+4
source share
2 answers

There is a Getting Started page that talks about how to import sample projects:

https://developers.google.com/vision/getting-started

Download and configure the sample application in Android Studio:

  • Download Vision Samples from Github.

You can use the "Download ZIP" button on the Github or clone page at the command line:

git clone https://github.com/googlesamples/android-vision.git

  1. Import photo demonstration project into Android Studio:

Click File> New> Import Project.

In the Select Eclipse or GradleProject to Import section, go to the directory where you downloaded the vision sample repository.

Select the photo demo folder and click OK.

Android Studio may offer to install the latest version of various Android libraries, especially com.android.gms.play-services in this case. Click "Install Repository" and sync the project "and follow the instructions.

  1. Connect the device via USB. You should see a notice saying โ€œUSB Debugging Enabled. If you do not see this notification, follow step 2 here to enable USB debugging on your device, then reconnect your device.

  2. Launch the application by clicking the green arrow in the panel or go to Launch> Launch "application".

+5
source

From what I read, it would be great if you upgraded to the latest version of Android Studio first, remember that these examples are very fresh and therefore the version of the IDE in which they were developed.

Also note that there are three projects in the repository. Their location:

  • [root folder] / face / FaceTracker
  • [root folder] / face / multi-tracker
  • [root folder] / face / photo demo

From there, you can simply import each of them as an existing project.

0
source

All Articles