Skip to content

Installing

Michał Gasztold edited this page Aug 20, 2021 · 16 revisions

Integration with Android Studio

Starting to use the Ubudu SDK with an Android Studio app is very simple. Have a look at the UbuduSDKDemo project in the directory for a complete example.

Your first need to specify the dependency on the Ubudu SDK:

  1. In the build.gradle file of your application module, add the Ubudu nexus repository:
    repositories {
        mavenCentral()
        maven { url 'https://nexus.ubudu.com/repository/maven-releases/' }
    }
  1. In the build.gradle file of your application module, add the Ubudu SDK dependency:
    dependencies {
        compile('com.ubudu.sdk:ubudu-sdk:2.8.2@aar') {
            transitive = true
        }
        // …
    }
  1. That's it. Click on the "Sync Project with Gradle Files" button, and select "Rebuild Project" in the Build menu, and it should download the Ubudu SDK and its dependencies, and compile them with your application.

Proguard configuration

To build the app with proguard please add the following code to your proguard config file:


	##---------------Begin: proguard configuration for Ubudu  ----------
	-keep class com.ubudu.**
	-keepclassmembers class com.ubudu.** { *; }
	-keep enum com.ubudu.**
	-keepclassmembers enum com.ubudu.** { *; }
	-keep interface com.ubudu.**
	-keepclassmembers interface com.ubudu.** { *; }
	##---------------Begin: proguard configuration for Ubudu  ----------


	##---------------Begin: proguard configuration for Ormlite  ----------
	-keepattributes *DatabaseField*
	-keepattributes *DatabaseTable*
	-keepattributes *SerializedName*
	-keep class com.j256.**
	-keepclassmembers class com.j256.** { *; }
	-keep enum com.j256.**
	-keepclassmembers enum com.j256.** { *; }
	-keep interface com.j256.**
	-keepclassmembers interface com.j256.** { *; }
	##---------------End: proguard configuration for Ormlite  ----------


	##---------------Begin: proguard configuration for Gson  ----------
	# Gson uses generic type information stored in a class file when working with fields. Proguard
	# removes such information by default, so configure it to keep all of it.
	-keepattributes Signature

	# For using GSON @Expose annotation
	-keepattributes *Annotation*

	# Gson specific classes
	-keep class sun.misc.Unsafe { *; }
	#-keep class com.google.gson.stream.** { *; }

	# Application classes that will be serialized/deserialized over Gson
	-keep class com.google.gson.examples.android.model.** { *; }
	##---------------End: proguard configuration for Gson  ----------