'How to import Azure Computer Vision Library in Android Studio

I'm having some trouble importing Azure Computer Vision Library in Android Studio. I'm coding in Java, I'm kind of new to it. On the Microsoft quickstart tutorial there is some Java code sample they use, but I can't figure out how to adapt it in the Android Studio environment. This is the page https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts-sdk/image-analysis-client-library?pivots=programming-language-java&tabs=visual-studio I don't know how to add the implementation to the dependencies in my build.gradle(:app).

I get this error : Cannot set the value of read-only property 'name' for project ':app' of type org.gradle.api.Project.

I would like to know how to turn this implementation into a more Androidish version : implementation(group = "com.microsoft.azure.cognitiveservices", name = "azure-cognitiveservices-computervision", version = "1.0.6-beta")

Thanks in advance !



Solution 1:[1]

How to import Azure Computer Vision Library in Android Studio?

The easiest way to consume the client library is to add com.microsoft.projectoxford.vision package from Maven Central Repository.

To find the latest version of client library, go to http://search.maven.org, and search for "com.microsoft.projectoxford".

To add the client library dependency from build.gradle file, add the following line in dependencies.

dependencies {
    //
    // Use the following line to include client library from Maven Central Repository
    // Change the version number from the search.maven.org result
    //
    compile 'com.microsoft.projectoxford:vision:1.0.394'

    // Your other Dependencies...
}

To do add the client library dependency from Android Studio follow the below steps:

  1. From Menu, Choose File > Project Structure

  2. Click on your app module

  3. Click on Dependencies tab

  4. Click "+" sign to add new dependency

  5. Pick "Library dependency" from the drop down list

  6. Type "com.microsoft.projectoxford" and hit the search icon from "Choose Library Dependency" dialog

  7. Pick the Project Oxford client library that you intend to use.

  8. Click "OK" to add the new dependency.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RajkumarMamidiChettu-MT