Skip to content

Commit f799004

Browse files
author
Kalyan Reddy
committed
Added starter project for ML Kit custom model codelab
1 parent 9fa7ec0 commit f799004

File tree

38 files changed

+2235
-1
lines changed

38 files changed

+2235
-1
lines changed

mlkit-android/custom-model/final/app/src/main/java/com/google/firebase/codelab/mlkit_custommodel/MainActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
import java.util.AbstractMap;
5757
import java.util.ArrayList;
5858
import java.util.Comparator;
59-
import java.util.HashMap;
6059
import java.util.List;
6160
import java.util.Map;
6261
import java.util.PriorityQueue;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 27
5+
defaultConfig {
6+
applicationId "com.google.firebase.codelab.mlkit_custommodel"
7+
minSdkVersion 19
8+
targetSdkVersion 27
9+
versionCode 1
10+
versionName "1.0"
11+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
}
13+
buildTypes {
14+
release {
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
aaptOptions {
20+
noCompress "tflite"
21+
}
22+
}
23+
24+
dependencies {
25+
implementation fileTree(dir: 'libs', include: ['*.jar'])
26+
implementation 'com.android.support:appcompat-v7:27.1.1'
27+
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
28+
testImplementation 'junit:junit:4.12'
29+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
30+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
31+
32+
implementation 'com.google.firebase:firebase-core:15.0.1'
33+
// TODO: Add ML Kit for Firebase dependencies here.
34+
}
35+
apply plugin: 'com.google.gms.google-services'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.google.firebase.codelab.mlkit_custommodel;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumented test, which will execute on an Android device.
14+
*
15+
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.google.firebase.codelab.mlkit_custommodel", appContext.getPackageName());
25+
}
26+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.google.firebase.codelab.mlkit_custommodel">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity android:name=".MainActivity"
13+
android:screenOrientation="portrait"
14+
android:configChanges="keyboardHidden|orientation|screenSize">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
17+
18+
<category android:name="android.intent.category.LAUNCHER" />
19+
intent-filter>
20+
activity>
21+
application>
22+
23+
manifest>

0 commit comments

Comments
 (0)