This library helps you easily upload screenshots of your app that contains localizable strings to your OneSky project.
NOTE: This library is not designed for distribution on Google Play Store so remember to remove before submission.
1) Download .jar file libs
folder
- Locate
OneSkyScreenshotHelper-vX.X.X.jar
in the release tab in this GitHub page and drag it into thelibs
folder of your project. - On Eclipse you are good to go.
- On Android Studio, locate the
build.gradle
file under your app's module and add the following:
dependencies {
compile files("OneSkyScreenshotHelper-vX.X.X.jar")
}
2) Remote Maven Repository
Add the follow code to your pom.xml
<dependencies>
<dependency>
<groupId>com.oneskyapp</groupId>
<artifactId>screenshot</artifactId>
<version>0.5.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>screenshot</id>
<name>OneSkyScreenshotHelper</name>
<url>https://raw.github.com/onesky/auto-screenshot-android/mvn-repo/</url>
</repository>
</repositories>
3) Android Studio/Gradle
Add the follow code to your build.gradle
repositories {
// mavenCentral()
maven {
url "https://raw.github.com/onesky/auto-screenshot-android/mvn-repo/"
}
}
dependencies {
// other dependencies.
compile "com.oneskyapp:screenshot:0.5.1"
}
In your Application
or main Activity
subclass file, import the library:
import com.oneskyapp.screenshot.OneSkyScreenshotHelper;
Add the following code in under onCreate()
:
OneSkyScreenshotHelper.getHelper().setApiKey("ONESKY_API_KEY");
OneSkyScreenshotHelper.getHelper().setApiSecret("ONESKY_API_SECRET");
OneSkyScreenshotHelper.getHelper().setProjectId("ONESKY_PROJECT_ID");
OneSkyScreenshotHelper.getHelper().startCapturing(this); // for Activity subclasses, use startCapturing(this.getApplication())
ONESKY_API_KEY
, ONESKY_API_SECRET
can be found in Site Settings under API Keys & Usage on OneSky Web Admin.
ONESKY_PROJECT_ID
can be found under All Projects page.
NOTE: The above parameters must be set before calling startCapturing()
.
Turn off capture status Toast
updates.
OneSkyScreenshotHelper.getHelper().setShowsCaptureStatus(false);
The default position of the screenshot button is bottom right of the main window, you can adjust using Gravity
.
OneSkyScreenshotHelper.getHelper().setCatpureButtonGravity(Gravity.TOP | Gravity.LEFT);