|
1 |
| -apply plugin: 'com.android.application' |
| 1 | +package org.opencv.android.facetracker; |
2 | 2 |
|
3 |
| -android { |
4 |
| - signingConfigs { |
5 |
| - config { |
6 |
| - keyAlias 'test' |
7 |
| - keyPassword 'test123321' |
8 |
| - storeFile file('signing/test.jks') |
9 |
| - storePassword 'test123321' |
10 |
| - } |
11 |
| - } |
12 |
| - compileSdkVersion 23 |
13 |
| - buildToolsVersion '27.0.3' |
14 |
| - defaultConfig { |
15 |
| - applicationId "com.google.android.gms.samples.vision.face.facetracker" |
16 |
| - minSdkVersion 15 |
17 |
| - targetSdkVersion 23 |
18 |
| - versionCode 1 |
19 |
| - versionName "1.0" |
20 |
| - externalNativeBuild { |
21 |
| - cmake { |
22 |
| - cppFlags "-frtti -fexceptions" |
23 |
| - // |
24 |
| - // abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a' |
25 |
| - abiFilters 'armeabi-v7a' |
26 |
| - arguments "-DANDROID_STL=gnustl_shared" |
27 |
| - //arguments "-DANDROID_STL=c++_shared" |
28 |
| - // AL: arguments "-DANDROID_STL=c++_shared", "-DBUILD_opencv_apps:BOOL=ON", "-DBUILD_SHARED_LIBS:BOOL=ON" |
29 |
| - // Passes optional arguments to CMake. |
30 |
| - //arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang" |
31 |
| - } |
32 |
| - } |
33 |
| - signingConfig signingConfigs.config |
34 | 3 |
|
35 |
| - // AL ( |
36 |
| - // Specifies the application ID for the test APK. |
37 |
| - testApplicationId "org.opencv.android.facetracker" |
38 |
| - // Specifies the fully-qualified class name of the test instrumentation runner. |
39 |
| - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
40 |
| - // If set to 'true', enables the instrumentation class to start and stop profiling. |
41 |
| - // If set to false (default), profiling occurs the entire time the instrumentation |
42 |
| - // class is running. |
43 |
| - // testHandleProfiling true |
44 |
| - // If set to 'true', indicates that the Android system should run the instrumentation |
45 |
| - // class as a functional test. The default value is 'false' |
46 |
| - // testFunctionalTest true |
47 |
| - // AL ) |
| 4 | +import android.content.Intent; |
48 | 5 |
|
| 6 | +import android.os.Bundle; |
| 7 | +import android.support.v7.app.AppCompatActivity; |
| 8 | +import android.view.View; |
| 9 | +import android.widget.Button; |
49 | 10 |
|
50 |
| - } |
51 | 11 |
|
| 12 | +import com.google.android.gms.samples.vision.face.facetracker.FaceTrackerActivity; |
| 13 | +import com.google.android.gms.samples.vision.face.facetracker.R; |
52 | 14 |
|
53 |
| -// sourceSets { // AL: added |
54 |
| -// main {jniLibs.srcDirs = ['src/main/jniLibs'] |
55 |
| -// jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/'] //jni.srcDirs = [] } } |
| 15 | +import tensorflow.detector.spc.CameraActivityMain; |
56 | 16 |
|
57 |
| -// allprojects { tasks.withType(JavaCompile) { |
58 |
| -// options.compilerArgs << "-Xlint:deprecation" }} |
59 | 17 |
|
| 18 | +public class OpenCvActivity extends AppCompatActivity { |
| 19 | + private static final String TAG = "OpenCvActivity"; |
| 20 | + private Button mBtnDetect; |
60 | 21 |
|
61 |
| - buildTypes { |
62 |
| - release { |
63 |
| - minifyEnabled false |
64 |
| - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
65 |
| - signingConfig signingConfigs.config |
66 |
| - } |
67 |
| - } |
68 | 22 |
|
69 |
| - externalNativeBuild { |
70 |
| - cmake { |
71 |
| - path "CMakeLists.txt" |
72 |
| - } |
73 |
| - } |
| 23 | + @Override |
| 24 | + public void onCreate(Bundle icicle) { |
| 25 | + super.onCreate(icicle); |
| 26 | + setContentView(R.layout.main); |
74 | 27 |
|
75 |
| - testBuildType "release" |
76 |
| - externalNativeBuild { |
77 |
| - cmake { |
78 |
| - path "CMakeLists.txt" |
79 |
| - } |
80 |
| - } |
81 |
| - productFlavors { |
82 |
| - } |
83 |
| - lintOptions { |
84 |
| - abortOnError false |
85 |
| - } |
86 |
| - sourceSets { |
87 |
| - main { jniLibs.srcDirs = ['src/main/jniLibs'] } |
88 |
| - androidTest { // AL |
89 |
| - java.srcDir file('src/androidTest/java') |
90 |
| - resources.srcDir file('src/androidTest/assets') |
91 |
| - } |
92 |
| - //instrumentTest.setRoot('src/androidTest/') |
93 |
| - } |
94 |
| - configurations.all { |
95 |
| - resolutionStrategy.force 'com.android.support:support-annotations:23.4.0' |
96 |
| - } |
97 |
| -} |
| 28 | + mBtnDetect = (Button) findViewById(R.id.btnDetect); |
| 29 | + |
| 30 | + mBtnDetect.setOnClickListener(new View.OnClickListener() { |
| 31 | + @Override |
| 32 | + public void onClick(View v) { |
98 | 33 |
|
99 |
| -dependencies { |
100 |
| - implementation fileTree(include: ['*.jar'], dir: 'libs') |
101 |
| - androidTestImplementation 'junit:junit:4.12' |
102 |
| - implementation 'com.android.support:support-annotations:23.4.0' |
103 |
| - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' |
104 |
| - androidTestImplementation 'com.android.support.test:runner:1.0.2' |
105 |
| - androidTestImplementation 'com.android.support.test:rules:1.0.2' |
106 |
| - androidTestImplementation 'org.hamcrest:hamcrest-library:1.3' |
107 |
| - implementation fileTree(include: ['*.jar'], dir: 'libs') |
108 |
| - implementation 'com.android.support:support-v4:23.4.0' |
109 |
| - implementation 'com.android.support:design:23.4.0' |
110 |
| - implementation 'com.google.android.gms:play-services-vision:9.4.0+' |
111 |
| - implementation 'com.shamanland:xdroid-toaster:0.2.4' |
112 |
| - implementation project(':openCVLibrary330') |
| 34 | + Intent myIntent = new Intent(OpenCvActivity.this, CameraActivityMain.class); |
| 35 | + |
| 36 | + OpenCvActivity.this.startActivity(myIntent); |
| 37 | + } |
| 38 | + }); |
| 39 | + } |
113 | 40 | }
|
0 commit comments