Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versions update & use API key. #13

Merged
merged 5 commits into from
Sep 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ android:
components:
- tools
- platform-tools
- build-tools-24.0.2
- build-tools-25.0.0
- extra-android-m2repository
- android-24
- sys-img-armeabi-v7a-android-24

jdk:
- oraclejdk8

before_script:
# Create and start an emulator for instrumentation tests.
- echo no | android create avd --force -n test -t android-18 --abi armeabi-v7a
- emulator -avd test -no-audio -no-window &
- echo no | android create avd --force -n test -t android-24 --abi armeabi-v7a
- emulator -avd test -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82
- adb shell input keyevent 82 &

notifications:
email: false
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ To set your environment up for Android development, you'll need to install the
[Java SE Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
and [Android Studio](https://developer.android.com/studio/index.html).

This project will compile in the standard manner through Android Studio or `./gradlew clean build` in your terminal. You just need to provide `clarifai_id` and `clarifai_secret` string resources
where it says `TODO` in [`strings.xml`](app/src/main/res/values/strings.xml).
Replace `YOUR_API_KEY_HERE` with your [Clarifai API Key](http://blog.clarifai.com/introducing-api-keys-a-safer-way-to-authenticate-your-applications/) in [`strings.xml`](app/src/main/res/values/strings.xml).

This project will compile in the standard manner through Android Studio or `./gradlew clean build` in your terminal.

## Where to look

Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
}
dependencies {
classpath(
"com.android.tools.build:gradle:2.2.0",
'com.android.tools.build:gradle:2.3.3',
"com.neenbedankt.gradle.plugins:android-apt:1.8",
)
}
Expand All @@ -19,7 +19,7 @@ repositories {

android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.clarifai.android.starter.api.v2"
minSdkVersion 15
Expand All @@ -36,7 +36,7 @@ dependencies {
"com.android.support:recyclerview-v7:24.2.1",
"com.android.support:design:24.2.1",

"com.clarifai.clarifai-api2:core:2.0.2",
"com.clarifai.clarifai-api2:core:2.2.+",


// For logging our HTTP outbound + inbound data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static App get() {
@Override
public void onCreate() {
INSTANCE = this;
client = new ClarifaiBuilder(getString(R.string.clarifai_id), getString(R.string.clarifai_secret))
client = new ClarifaiBuilder(getString(R.string.clarifai_api_key))
// Optionally customize HTTP client via a custom OkHttp instance
.client(new OkHttpClient.Builder()
.readTimeout(30, TimeUnit.SECONDS) // Increase timeout for poor mobile networks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import butterknife.BindView;
import butterknife.OnClick;
import clarifai2.api.ClarifaiResponse;
import clarifai2.dto.input.ClarifaiImage;
import clarifai2.dto.input.ClarifaiInput;
import clarifai2.dto.input.image.ClarifaiImage;
import clarifai2.dto.model.ConceptModel;
import clarifai2.dto.model.output.ClarifaiOutput;
import clarifai2.dto.prediction.Concept;
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<resources>
<string name="clarifai_id">TODO</string>
<string name="clarifai_secret">TODO</string>
<string name="clarifai_api_key">YOUR_API_KEY_HERE</string>

<string name="app_name">Clarifai v2 API Starter</string>

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Mon Sep 11 13:17:45 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip