Skip to content

Commit

Permalink
🎉 adding app
Browse files Browse the repository at this point in the history
  • Loading branch information
farhanroy committed Mar 2, 2021
1 parent e47b218 commit 09db318
Show file tree
Hide file tree
Showing 96 changed files with 2,139 additions and 0 deletions.
15 changes: 15 additions & 0 deletions DetectMe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions DetectMe/.idea/.gitignore

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

1 change: 1 addition & 0 deletions DetectMe/.idea/.name

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

6 changes: 6 additions & 0 deletions DetectMe/.idea/compiler.xml

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

22 changes: 22 additions & 0 deletions DetectMe/.idea/gradle.xml

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

25 changes: 25 additions & 0 deletions DetectMe/.idea/jarRepositories.xml

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

9 changes: 9 additions & 0 deletions DetectMe/.idea/misc.xml

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

6 changes: 6 additions & 0 deletions DetectMe/.idea/vcs.xml

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

46 changes: 46 additions & 0 deletions DetectMe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## MLKit with CameraX

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``.

link download ======> https://dply.me/toowxj

## Fitur
- Barcode Scanner
- Face Detection
- Object Detection
- OCR (Text Classifier)


## ☝🏼 how to use this project ?

Clone repo ini, kemudian project ada di file mlkit
```bash
git clone https://github.com/farhanroy/android-research/
```
## 📱 Screenshots

<table>
<tr>
<td>
<img src="./screenshot/Screenshot_2021-01-06-11-12-14-68.jpg" width="250">
</td>
<td>
<img src="./screenshot/Screenshot_2021-01-06-11-11-54-72.jpg" width="250">
</td>
<td>
<img src="./screenshot/Screenshot_2021-01-06-11-13-42-74.jpg" width="250">
</td>
<td>
<img src="./screenshot/Screenshot_2021-01-06-11-11-32-40.jpg" width="250">
</td>
</tr>
</table>


## Author

👤 **Farhan Roy**

- Facebook: [Broding Camel](https://web.facebook.com/farhansekargadung)
- Github: [Farhan Roy](https://github.com/farhanroy)

1 change: 1 addition & 0 deletions DetectMe/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
78 changes: 78 additions & 0 deletions DetectMe/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}


android {
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
applicationId "com.detect.me"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
viewBinding true
}

buildTypes {
debug {
minifyEnabled true
}
release {
minifyEnabled true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
aaptOptions {
noCompress "tflite"
}
}

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

implementation "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycle}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}"

// Navigation component
implementation "androidx.navigation:navigation-fragment-ktx:$versions.navigation"
implementation "androidx.navigation:navigation-ui-ktx:$versions.navigation"

// MLKIT
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.2'
implementation 'com.google.android.gms:play-services-mlkit-face-detection:16.1.2'
implementation 'com.google.mlkit:barcode-scanning:16.1.0'
implementation 'com.google.mlkit:object-detection:16.2.2'

// CameraX
implementation "androidx.camera:camera-camera2:${versions.cameraX}"
implementation "androidx.camera:camera-core:${versions.cameraX}"
implementation "androidx.camera:camera-lifecycle:${versions.cameraX}"
implementation "androidx.camera:camera-view:1.0.0-alpha20"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
21 changes: 21 additions & 0 deletions DetectMe/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Binary file added DetectMe/app/release/app-release.aab
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.android.mlkit

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.android.mlkit", appContext.packageName)
}
}
28 changes: 28 additions & 0 deletions DetectMe/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.detect.me">

<uses-feature android:name="android.hardware.camera.any" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Mlkit">
<activity
android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"/>
</application>

</manifest>
Binary file added DetectMe/app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions DetectMe/app/src/main/java/com/detect/me/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package com.detect.me

import android.content.pm.PackageManager
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.NavigationUI
import com.detect.me.databinding.ActivityMainBinding


// Main Class for app
class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

checkPermission()
}

override fun onRequestPermissionsResult(
requestCode: Int, permissions: Array<String>, grantResults:
IntArray
) {
if (requestCode == REQUEST_CODE_PERMISSIONS) {
if (allPermissionsGranted()) {
setupNavigation()
} else finish()
}
}

private fun checkPermission() {
if (allPermissionsGranted()) {
setupNavigation()
} else {
ActivityCompat.requestPermissions(
this,
REQUIRED_PERMISSIONS,
REQUEST_CODE_PERMISSIONS
)
}
}

private fun setupNavigation() {
val navHostFragment =
supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
val navController = navHostFragment.navController
val bottomNavigationView = binding.bottomNavigationView
NavigationUI.setupWithNavController(bottomNavigationView, navController)
}

private fun allPermissionsGranted() = REQUIRED_PERMISSIONS.all {
ContextCompat.checkSelfPermission(this, it) == PackageManager.PERMISSION_GRANTED
}

companion object {
private const val REQUEST_CODE_PERMISSIONS = 10
private val REQUIRED_PERMISSIONS = arrayOf(
android.Manifest.permission.CAMERA
)
}




}
Loading

0 comments on commit 09db318

Please sign in to comment.