Skip to content

Commit 09db318

Browse files
committed
🎉 adding app
1 parent e47b218 commit 09db318

File tree

96 files changed

+2139
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2139
-0
lines changed

DetectMe/.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties

DetectMe/.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DetectMe/.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DetectMe/.idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DetectMe/.idea/gradle.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DetectMe/.idea/jarRepositories.xml

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DetectMe/.idea/misc.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DetectMe/.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DetectMe/README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## MLKit with CameraX
2+
3+
Aplikasi machine lerning yang menggunakan library MLkit dari firebase dan CameraX sebagai library kamera yang ter-include dalam jetpack component. Aplikasi ini dibuat sebagai hasil research saya belajar tentang machine learning di android dan penggunaan kamera menggunakan library ``CameraX``.
4+
5+
link download ======> https://dply.me/toowxj
6+
7+
## Fitur
8+
- Barcode Scanner
9+
- Face Detection
10+
- Object Detection
11+
- OCR (Text Classifier)
12+
13+
14+
## ☝🏼 how to use this project ?
15+
16+
Clone repo ini, kemudian project ada di file mlkit
17+
```bash
18+
git clone https://github.com/farhanroy/android-research/
19+
```
20+
## 📱 Screenshots
21+
22+
<table>
23+
<tr>
24+
<td>
25+
<img src="./screenshot/Screenshot_2021-01-06-11-12-14-68.jpg" width="250">
26+
</td>
27+
<td>
28+
<img src="./screenshot/Screenshot_2021-01-06-11-11-54-72.jpg" width="250">
29+
</td>
30+
<td>
31+
<img src="./screenshot/Screenshot_2021-01-06-11-13-42-74.jpg" width="250">
32+
</td>
33+
<td>
34+
<img src="./screenshot/Screenshot_2021-01-06-11-11-32-40.jpg" width="250">
35+
</td>
36+
</tr>
37+
</table>
38+
39+
40+
## Author
41+
42+
👤 **Farhan Roy**
43+
44+
- Facebook: [Broding Camel](https://web.facebook.com/farhansekargadung)
45+
- Github: [Farhan Roy](https://github.com/farhanroy)
46+

DetectMe/app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

DetectMe/app/build.gradle

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
id 'kotlin-kapt'
5+
}
6+
7+
8+
android {
9+
compileSdkVersion 30
10+
buildToolsVersion "30.0.2"
11+
12+
defaultConfig {
13+
applicationId "com.detect.me"
14+
minSdkVersion 21
15+
targetSdkVersion 30
16+
versionCode 1
17+
versionName "1.0"
18+
19+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
20+
}
21+
buildFeatures {
22+
viewBinding true
23+
}
24+
25+
buildTypes {
26+
debug {
27+
minifyEnabled true
28+
}
29+
release {
30+
minifyEnabled true
31+
debuggable false
32+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
33+
}
34+
}
35+
compileOptions {
36+
sourceCompatibility JavaVersion.VERSION_1_8
37+
targetCompatibility JavaVersion.VERSION_1_8
38+
}
39+
kotlinOptions {
40+
jvmTarget = '1.8'
41+
}
42+
aaptOptions {
43+
noCompress "tflite"
44+
}
45+
}
46+
47+
dependencies {
48+
49+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
50+
implementation 'androidx.core:core-ktx:1.3.2'
51+
implementation 'androidx.appcompat:appcompat:1.2.0'
52+
implementation 'com.google.android.material:material:1.2.1'
53+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
54+
55+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycle}"
56+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}"
57+
58+
// Navigation component
59+
implementation "androidx.navigation:navigation-fragment-ktx:$versions.navigation"
60+
implementation "androidx.navigation:navigation-ui-ktx:$versions.navigation"
61+
62+
// MLKIT
63+
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.2'
64+
implementation 'com.google.android.gms:play-services-mlkit-face-detection:16.1.2'
65+
implementation 'com.google.mlkit:barcode-scanning:16.1.0'
66+
implementation 'com.google.mlkit:object-detection:16.2.2'
67+
68+
// CameraX
69+
implementation "androidx.camera:camera-camera2:${versions.cameraX}"
70+
implementation "androidx.camera:camera-core:${versions.cameraX}"
71+
implementation "androidx.camera:camera-lifecycle:${versions.cameraX}"
72+
implementation "androidx.camera:camera-view:1.0.0-alpha20"
73+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
74+
75+
testImplementation 'junit:junit:4.+'
76+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
77+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
78+
}

DetectMe/app/proguard-rules.pro

+21
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

DetectMe/app/release/app-release.aab

23.1 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.android.mlkit
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.android.mlkit", appContext.packageName)
23+
}
24+
}
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.detect.me">
4+
5+
<uses-feature android:name="android.hardware.camera.any" />
6+
7+
<uses-permission android:name="android.permission.CAMERA" />
8+
<uses-permission android:name="android.permission.INTERNET" />
9+
10+
<application
11+
android:allowBackup="true"
12+
android:icon="@mipmap/ic_launcher"
13+
android:label="@string/app_name"
14+
android:roundIcon="@mipmap/ic_launcher_round"
15+
android:supportsRtl="true"
16+
android:theme="@style/Theme.Mlkit">
17+
<activity
18+
android:name=".SplashActivity">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
<activity android:name=".MainActivity"/>
26+
</application>
27+
28+
</manifest>
10.8 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package com.detect.me
2+
3+
import android.content.pm.PackageManager
4+
import android.os.Bundle
5+
import androidx.appcompat.app.AppCompatActivity
6+
import androidx.core.app.ActivityCompat
7+
import androidx.core.content.ContextCompat
8+
import androidx.navigation.fragment.NavHostFragment
9+
import androidx.navigation.ui.NavigationUI
10+
import com.detect.me.databinding.ActivityMainBinding
11+
12+
13+
// Main Class for app
14+
class MainActivity : AppCompatActivity() {
15+
16+
private lateinit var binding: ActivityMainBinding
17+
18+
override fun onCreate(savedInstanceState: Bundle?) {
19+
super.onCreate(savedInstanceState)
20+
binding = ActivityMainBinding.inflate(layoutInflater)
21+
setContentView(binding.root)
22+
23+
checkPermission()
24+
}
25+
26+
override fun onRequestPermissionsResult(
27+
requestCode: Int, permissions: Array<String>, grantResults:
28+
IntArray
29+
) {
30+
if (requestCode == REQUEST_CODE_PERMISSIONS) {
31+
if (allPermissionsGranted()) {
32+
setupNavigation()
33+
} else finish()
34+
}
35+
}
36+
37+
private fun checkPermission() {
38+
if (allPermissionsGranted()) {
39+
setupNavigation()
40+
} else {
41+
ActivityCompat.requestPermissions(
42+
this,
43+
REQUIRED_PERMISSIONS,
44+
REQUEST_CODE_PERMISSIONS
45+
)
46+
}
47+
}
48+
49+
private fun setupNavigation() {
50+
val navHostFragment =
51+
supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
52+
val navController = navHostFragment.navController
53+
val bottomNavigationView = binding.bottomNavigationView
54+
NavigationUI.setupWithNavController(bottomNavigationView, navController)
55+
}
56+
57+
private fun allPermissionsGranted() = REQUIRED_PERMISSIONS.all {
58+
ContextCompat.checkSelfPermission(this, it) == PackageManager.PERMISSION_GRANTED
59+
}
60+
61+
companion object {
62+
private const val REQUEST_CODE_PERMISSIONS = 10
63+
private val REQUIRED_PERMISSIONS = arrayOf(
64+
android.Manifest.permission.CAMERA
65+
)
66+
}
67+
68+
69+
70+
71+
}

0 commit comments

Comments
 (0)