dodano funkcje sprawdzajaca dzialanie OpenCV, dodano przycisk do aparatu, utworzono wydarzenie onClick
This commit is contained in:
parent
58d1ed04f7
commit
697d10fbeb
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/Pracowania_Programowania-Ben" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -3,12 +3,51 @@ package com.example.filife;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.opencv.android.OpenCVLoader;
|
||||
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
Button OpenCamera_j;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
//Sprawdzenie załadowania biblioteki OPENCV
|
||||
//***************************************************************************************************//
|
||||
|
||||
if(OpenCVLoader.initDebug())
|
||||
{
|
||||
Toast.makeText(getApplicationContext(),"OpenCV zaladowane poprawnie",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else
|
||||
{
|
||||
Toast.makeText(getApplicationContext(),"OpenCV nie zostalo zaladowane", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
//***********************************************************************************************//
|
||||
|
||||
//Przypisanie przycisku Open Camera xml do zmiennej w javie, stworzenie zdarzenia onClick
|
||||
//**************************************************************************************************//
|
||||
|
||||
OpenCamera_j = (Button) findViewById(R.id.OpenCamera);
|
||||
|
||||
OpenCamera_j.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Toast.makeText(MainActivity.this," Otworzyłeś aparat!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -6,11 +6,12 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/OpenCamera"
|
||||
android:layout_width="426dp"
|
||||
android:layout_height="103dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:text="Open Camera"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:layout_editor_absoluteY="621dp" />
|
||||
tools:layout_editor_absoluteX="1dp"
|
||||
tools:layout_editor_absoluteY="686dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -18,3 +18,5 @@ android.useAndroidX=true
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=true
|
||||
|
||||
android.useDeprecatedNDK=true
|
||||
|
||||
|
@ -3,31 +3,60 @@
|
||||
3 package="org.opencv.test" >
|
||||
4
|
||||
5 <uses-sdk
|
||||
5-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:5:5-74
|
||||
5-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:5:5-74
|
||||
6 android:minSdkVersion="15"
|
||||
6-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:5:15-41
|
||||
6-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:5:15-41
|
||||
7 android:targetSdkVersion="29" />
|
||||
7-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:5:42-71
|
||||
7-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:5:42-71
|
||||
8
|
||||
9 <instrumentation
|
||||
9-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:11:5-15:65
|
||||
9-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:11:5-15:65
|
||||
10 android:name="android.test.InstrumentationTestRunner"
|
||||
10-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:11:22-75
|
||||
10-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:11:22-75
|
||||
11 android:functionalTest="false"
|
||||
11-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:14:22-52
|
||||
11-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:14:22-52
|
||||
12 android:handleProfiling="false"
|
||||
12-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:13:22-53
|
||||
12-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:13:22-53
|
||||
13 android:label="Tests for org.opencv.test"
|
||||
13-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:15:22-63
|
||||
13-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:15:22-63
|
||||
14 android:targetPackage="org.opencv.test" />
|
||||
14-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:12:22-61
|
||||
14-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:12:22-61
|
||||
15
|
||||
16 <application android:debuggable="true" >
|
||||
16-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:7:5-9:19
|
||||
16-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:7:18-43
|
||||
17 <uses-library android:name="android.test.runner" />
|
||||
17-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:8:9-60
|
||||
17-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2016417345742097501.xml:8:23-57
|
||||
18 </application>
|
||||
19
|
||||
20</manifest>
|
||||
16 <uses-permission android:name="android.permission.CAMERA" />
|
||||
16-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:11:5-65
|
||||
16-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:11:22-62
|
||||
17
|
||||
18 <uses-feature
|
||||
18-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:13:5-15:36
|
||||
19 android:name="android.hardware.camera"
|
||||
19-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:14:9-47
|
||||
20 android:required="false" />
|
||||
20-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:15:9-33
|
||||
21 <uses-feature
|
||||
21-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:16:5-18:36
|
||||
22 android:name="android.hardware.camera.autofocus"
|
||||
22-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:17:9-57
|
||||
23 android:required="false" />
|
||||
23-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:18:9-33
|
||||
24 <uses-feature
|
||||
24-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:19:5-21:36
|
||||
25 android:name="android.hardware.camera.front"
|
||||
25-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:20:9-53
|
||||
26 android:required="false" />
|
||||
26-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:21:9-33
|
||||
27 <uses-feature
|
||||
27-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:22:5-24:36
|
||||
28 android:name="android.hardware.camera.front.autofocus"
|
||||
28-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:23:9-63
|
||||
29 android:required="false" />
|
||||
29-->[__tested_artifact__::openCVLibrary341] C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\library_manifest\debug\AndroidManifest.xml:24:9-33
|
||||
30
|
||||
31 <application android:debuggable="true" >
|
||||
31-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:7:5-9:19
|
||||
31-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:7:18-43
|
||||
32 <uses-library android:name="android.test.runner" />
|
||||
32-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:8:9-60
|
||||
32-->C:\Users\Benny\Desktop\Filife\openCVLibrary341\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger8178154381274492171.xml:8:23-57
|
||||
33 </application>
|
||||
34
|
||||
35</manifest>
|
||||
|
@ -13,6 +13,21 @@
|
||||
android:label="Tests for org.opencv.test"
|
||||
android:targetPackage="org.opencv.test" />
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera.autofocus"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera.front"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera.front.autofocus"
|
||||
android:required="false" />
|
||||
|
||||
<application android:debuggable="true" >
|
||||
<uses-library android:name="android.test.runner" />
|
||||
</application>
|
||||
|
Loading…
Reference in New Issue
Block a user