Boris Boris - 3 months ago 32
Android Question

Using ksoap2 in Android project

I would like to start a project with ksoap2 in Android Studio. I have set up the project using the Andoid Studio wizard. But how can I add ksoap2?

All the ksoap website says is:


Gradle: The same coordinates for the JAR and the release repository URL
as used for Apache Maven can be used.


But that does not help much. I assume I have to modify one or more of the Gradle scripts Android Studio has generated for me. Or is there some sort of automatism (like Nuget does with Visual Studio and C# projects).

Answer

You should add below lines to your app level build.gradle

    buildTypes {
            repositories {
                maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases' }
            }
         }

        dependencies {
            compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1' 
}