In your project's build.gradle file, add the following
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}OR depending on your project settings, in settings.gradle, add the following
dependencyResolutionManagement {
repositories {
maven { url "https://jitpack.io" }
}
}And add the dependency in your app's build.gradle file:
implementation 'com.github.vidinoti:android-template:<latest-release>'- Create a new Android application
- Create a main Activity which extends
VidinotiBaseActivity
import android.app.Application;
import com.vidinoti.vdarsdk.VidinotiAR;
import com.vidinoti.vdarsdk.VidinotiAROptions;
import com.vidinoti.vdarsdk.VidinotiLanguage;
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
String licenseKey = "Paste your V-Director License Key";
VidinotiAROptions options = new VidinotiAROptions.Builder(licenseKey)
.setCodeRecognitionEnabled(true)
.setSynchronizationMode(VidinotiAROptions.SynchronizationMode.DEFAULT_TAG_WITH_ADDITIONAL_CONTENT)
.setMultilingualEnabled(true)
.setDefaultLanguage(VidinotiLanguage.EN)
.setSupportedLanguages(VidinotiLanguage.EN, VidinotiLanguage.ES)
.setDefaultTag("Default")
.build();
VidinotiAR.init(this, options);
// You can call .synchronize() here if wanted.
}
}Then add it to your AndroidManifest.xml
<application
android:name=".MyApplication"
...To handle the device orientation change, add
android:configChanges="orientation|screenSize|keyboardHidden"to your Activity in the AndroidManifest.xml file.
It might also be a good idea to set the launchMode to "singleTask".
android:launchMode="singleTask"It is a good practice to enable only the locale corresponding to your application.
Edit the app/build.gradle and add the resConfigs attribute. For instance, like that:
android {
...
defaultConfig {
...
resConfigs 'en', 'es'
}
}See the app folder for an example. In summary, the steps are:
- Edit your main activity and make it extend the class
ScannerDrawerActivity - Override the method
public int getNavigationMenuId()and return the id for your drawer menu. - Override the method
public Map<Integer, DrawerEntry> getDrawerEntries(). It allows configuring the default menu entry behaviors. - Use the theme
android:theme="@style/VidinotiAppTheme.NoActionBar"for your Activity - Edit the following colors:
vidinotiColorPrimaryvidinotiColorPrimaryDarkvidinotiColorPrimaryLightvidinotiColorAccent
- You can set the string
vidinoti_nav_header_subtitlefor the drawer subtitle.
- Update the version number in
vidinoti-library/build.gradle. - Commit and push the changes.
- Create a new release in GitHub. (see below for doing it with the CLI)
gh release create <tag> --notes "<release notes>"
# For instance
gh release create 1.13.0 --notes "Vidinoti SDK 7.3.3"