Android Question Possible for Inline Java?

ThePlankton

Member
Licensed User
Is this possible to do with inline java? My Java skill are pretty lacking.
Source: https://developers.google.com/ml-kit/vision/doc-scanner/android#java

Java:
GmsDocumentScanner scanner = GmsDocumentScanning.getClient(options);
ActivityResultLauncher<IntentSenderRequest> scannerLauncher =
  registerForActivityResult(
    new StartIntentSenderForResult(),
      result -> {
        if (result.getResultCode() == RESULT_OK) {
          GmsDocumentScanningResult result = GmsDocumentScanningResult.fromActivityResultIntent(result.getData());
          for (Page page : result.getPages()) {
            Uri imageUri = pages.get(0).getImageUri();
          }

          Pdf pdf = result.getPdf();
          Uri pdfUri = pdf.getUri();
          int pageCount = pdf.getPageCount();
        }
      });

scanner.getStartScanIntent(activity)
  .addOnSuccessListener(intentSender ->
    scannerLauncher.launch(new IntentSenderRequest.Builder(intentSender).build()))
  .addOnFailureListener(...);
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 2
Cookies are required to use this site. You must accept them to continue using the site. Learn more…