-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add android example app #32
Add android example app #32
Conversation
eb2cb96
to
26393da
Compare
android-example/build.gradle
Outdated
implementation 'androidx.activity:activity:1.9.0' | ||
|
||
implementation 'io.xconn:cryptology:1.1.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation 'io.xconn:cryptology:1.1.2' | |
implementation project(path: ':cryptology') |
@@ -0,0 +1,27 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xmlns:app="http://schemas.android.com/apk/res-auto" |
android:id="@+id/enterPassword" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="30dp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
android:layout_marginLeft="30dp" |
<!-- TODO: Remove or change this placeholder text --> | ||
<string name="hello_blank_fragment">Hello blank fragment</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<!-- TODO: Remove or change this placeholder text --> | |
<string name="hello_blank_fragment">Hello blank fragment</string> |
<string name="password1">Password:</string> | ||
<string name="enter_password1">Enter password...</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use already defined strings
<string name="select_photo">Select Photo</string> | ||
<string name="capture">Capture</string> | ||
<string name="password">Password:</string> | ||
<string name="enter_password">Enter password...</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<string name="enter_password">Enter password...</string> | |
<string name="enter_password">Enter password…</string> |
assert bitmap != null; | ||
byte[] imageData = bitmapToByteArray(bitmap); | ||
|
||
byte[] publicKey = hexToBytes(App.getString("public_key")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
byte[] publicKey = hexToBytes(App.getString("public_key")); | |
byte[] publicKey = hexToBytes(App.getString(App.PREF_PUBLIC_KEY)); |
private void dispatchTakePictureIntent() { | ||
if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.CAMERA) | ||
!= PackageManager.PERMISSION_GRANTED) { | ||
requestCameraPermission(); | ||
} else { | ||
startCamera(); | ||
} | ||
} | ||
|
||
private void requestCameraPermission() { | ||
cameraPermissionLauncher.launch(Manifest.permission.CAMERA); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private void dispatchTakePictureIntent() { | |
if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.CAMERA) | |
!= PackageManager.PERMISSION_GRANTED) { | |
requestCameraPermission(); | |
} else { | |
startCamera(); | |
} | |
} | |
private void requestCameraPermission() { | |
cameraPermissionLauncher.launch(Manifest.permission.CAMERA); | |
} | |
private void dispatchTakePictureIntent() { | |
if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.CAMERA) | |
!= PackageManager.PERMISSION_GRANTED) { | |
requestCameraPermission(); | |
} else { | |
cameraPermissionLauncher.launch(Manifest.permission.CAMERA); | |
} | |
} |
closes #26