Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MYID Public Code
MyID Sample Android
Commits
0cafa8a3
Commit
0cafa8a3
authored
Apr 09, 2024
by
Javokhir
Browse files
2.3.0
parent
161ca419
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/uz/myid/sdk/sample/ExampleJavaFragment.java
deleted
100644 → 0
View file @
161ca419
package
uz.myid.sdk.sample
;
import
static
uz
.
myid
.
android
.
sdk
.
capture
.
MyIdResultKt
.
takeUserResult
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
androidx.activity.result.ActivityResultLauncher
;
import
androidx.annotation.NonNull
;
import
androidx.fragment.app.Fragment
;
import
java.util.Locale
;
import
uz.myid.android.sdk.capture.MyIdClient
;
import
uz.myid.android.sdk.capture.MyIdConfig
;
import
uz.myid.android.sdk.capture.MyIdException
;
import
uz.myid.android.sdk.capture.MyIdResult
;
import
uz.myid.android.sdk.capture.MyIdResultListener
;
import
uz.myid.android.sdk.capture.model.MyIdBuildMode
;
import
uz.myid.android.sdk.capture.model.MyIdCameraShape
;
import
uz.myid.android.sdk.capture.model.MyIdEntryType
;
import
uz.myid.android.sdk.capture.model.MyIdImageFormat
;
import
uz.myid.android.sdk.capture.model.MyIdResidentType
;
import
uz.myid.android.sdk.capture.model.MyIdResolution
;
public
class
ExampleJavaFragment
extends
Fragment
implements
MyIdResultListener
{
private
final
MyIdClient
client
=
new
MyIdClient
();
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
startMyId
();
}
@Override
public
void
onSuccess
(
@NonNull
MyIdResult
result
)
{
// Get face bitmap, result code, comparison value
}
@Override
public
void
onError
(
@NonNull
MyIdException
e
)
{
// Get error message and code
}
@Override
public
void
onUserExited
()
{
// User exited sdk
}
private
void
startMyId
()
{
String
clientId
=
"client_id"
;
String
clientHash
=
"client_hash"
;
String
clientHashId
=
"client_hash_id"
;
String
passportData
=
"passport_data"
;
String
dateOfBirth
=
"date_of_birth"
;
MyIdConfig
config
=
new
MyIdConfig
.
Builder
(
clientId
)
.
withClientHash
(
clientHash
,
clientHashId
)
.
withPassportData
(
passportData
)
.
withBirthDate
(
dateOfBirth
)
.
withBuildMode
(
MyIdBuildMode
.
PRODUCTION
)
.
build
();
Intent
intent
=
client
.
createIntent
(
requireActivity
(),
config
);
result
.
launch
(
intent
);
}
private
final
ActivityResultLauncher
<
Intent
>
result
=
takeUserResult
(
this
,
this
);
}
app/src/main/java/uz/myid/sdk/sample/ExampleKotlinFragment.kt
deleted
100644 → 0
View file @
161ca419
package
uz.myid.sdk.sample
import
android.os.Bundle
import
androidx.fragment.app.Fragment
import
uz.myid.android.sdk.capture.MyIdClient
import
uz.myid.android.sdk.capture.MyIdConfig
import
uz.myid.android.sdk.capture.MyIdException
import
uz.myid.android.sdk.capture.MyIdResult
import
uz.myid.android.sdk.capture.MyIdResultListener
import
uz.myid.android.sdk.capture.model.MyIdBuildMode
import
uz.myid.android.sdk.capture.takeUserResult
class
ExampleKotlinFragment
:
Fragment
(),
MyIdResultListener
{
private
val
client
=
MyIdClient
()
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
startMyId
()
}
override
fun
onSuccess
(
result
:
MyIdResult
)
{
// Get face bitmap and result code
}
override
fun
onError
(
e
:
MyIdException
)
{
// Get error message and code
}
override
fun
onUserExited
()
{
// User exited sdk
}
private
fun
startMyId
()
{
val
clientId
=
"client_id"
val
clientHash
=
"client_hash"
val
clientHashId
=
"client_hash_id"
val
passportData
=
"passport_data"
val
dateOfBirth
=
"date_of_birth"
val
config
=
MyIdConfig
.
Builder
(
clientId
)
.
withClientHash
(
clientHash
,
clientHashId
)
.
withPassportData
(
passportData
)
.
withBirthDate
(
dateOfBirth
)
.
withBuildMode
(
MyIdBuildMode
.
PRODUCTION
)
.
build
()
val
intent
=
client
.
createIntent
(
requireActivity
(),
config
)
result
.
launch
(
intent
)
}
private
val
result
=
takeUserResult
(
this
)
}
\ No newline at end of file
myid-sdk-2.2.8.zip
deleted
100644 → 0
View file @
161ca419
File deleted
myid-sdk-2.3.0.zip
0 → 100644
View file @
0cafa8a3
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment