Skip to content
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

Merged
merged 13 commits into from
May 29, 2024
Merged

Conversation

muteeburrehman
Copy link
Contributor

@muteeburrehman muteeburrehman commented May 23, 2024

closes #26

@muteeburrehman muteeburrehman marked this pull request as draft May 23, 2024 13:46
@muteeburrehman muteeburrehman marked this pull request as ready for review May 27, 2024 13:37
implementation 'androidx.activity:activity:1.9.0'

implementation 'io.xconn:cryptology:1.1.2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
android:layout_marginLeft="30dp"

Comment on lines 6 to 7
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>

Comment on lines 13 to 14
<string name="password1">Password:</string>
<string name="enter_password1">Enter password...</string>
Copy link
Member

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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
byte[] publicKey = hexToBytes(App.getString("public_key"));
byte[] publicKey = hexToBytes(App.getString(App.PREF_PUBLIC_KEY));

Comment on lines 91 to 102
private void dispatchTakePictureIntent() {
if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.CAMERA)
!= PackageManager.PERMISSION_GRANTED) {
requestCameraPermission();
} else {
startCamera();
}
}

private void requestCameraPermission() {
cameraPermissionLauncher.launch(Manifest.permission.CAMERA);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
}
}

@muzzammilshahid muzzammilshahid merged commit 2b4928d into xconnio:main May 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Android Example Project
2 participants