Hi , i would like use Camscanner api from my application.
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
1. Please use code tags when posting code!
2. Are you using B4A SDKManager and all Items are uptodate?
3. You are using Android.jar from Api 28 downloaded by the SDKManager?
4. You are using targetSdk 24 or Higher in your Manifest?
1. Please use code tags when posting code!
2. Are you using B4A SDKManager and all Items are uptodate?
3. You are using Android.jar from Api 28 downloaded by the SDKManager?
4. You are using targetSdk 24 or Higher in your Manifest?
- I don't have B4A SDK Manager ( my B4A version are 6.80)
- for android.jar, i use API 17 ( C:\Android\Android\android-sdk\platforms\android-17\android.jar )