Hi , i would like use Camscanner api from my application.
The CamScanner documentation says how call Camscanner from 3rd Party App :
To call camscanner :
to get the result :
In my Application i try to do this :
what i doing wrong ?
The CamScanner documentation says how call Camscanner from 3rd Party App :
To call camscanner :
B4X:
Intent intent = new Intent("com.intsig.camscanner.ACTION_SCAN");
Uri uri = Uri.fromFile(new File("/sdcard/source.jpg")); //Or content uri picked from gallery
intent.putExtra(Intent.EXTRA_STREAM, uri);
intent.putExtra("scanned_image", “/sdcard/scanned.jpg”);
intent.putExtra("pdf_path", “/sdcard/processed.jpg”); (Optionnal)
intent.putExtra("org_image", “/sdcard/org.jpg”); (Optionnal)
startActivityForResult(intent, REQUEST_CODE);
to get the result :
B4X:
void onActivityResult(int requestCode, int resultCode, Intent data){
If(requestCode == REQUEST_CODE ){
int responseCode=data.getIntExtra(“RESPONSE_CODE”,-1);
If(resultCode==Activity.RESULT_OK){
//Success
}else if(resultCode == Activity.RESULT_FIREST_USER){
//Fail
}else if(resultCode==Activity.RESULT_CANCELED){
// User canceled
}
}
}
In my Application i try to do this :
B4X:
Dim AU As MyActivityUtils
Dim In As Intent
In.Initialize("com.intsig.camscanner.ACTION_SCAN","")
In.putExtra("android.intent.extra.STREAM", "file:///sdcard/imgsourceBis.jpg")
In.putExtra("scanned_image", "file:///sdcard/imgsource.jpg")
AU.startActivitywithResult(In)
B4X:
Sub Activity_OnResult(ResultCode As Int, ReturnIntent As Intent)
Log(ResultCode & " " & ReturnIntent.ExtrasToString)
If ResultCode = 0 Then Return
If ReturnIntent.HasExtra("Path") Then
End If
End Sub
what i doing wrong ?
Last edited: