@@ -96,33 +96,36 @@ SDK having multiple flows as follows :
9696
9797``` java
9898// JAVA
99+
99100// Set CaptureMode as CAMERA_CAPTURE_REVIEW
100101Config . CaptureSupport . CaptureMode = Config . CaptureSupport . CaptureModes . CAMERA_CAPTURE_REVIEW ;
101- // set ppermission for output path that set in config.
102+ // set permission for output path that set in config.
102103UriphotoURI = Uri . parse(Config . CaptureSupport . OutputPath );
103104this . grantUriPermission(this . getPackageName(),photoURI,Intent . FLAG_GRANT_WRITE_URI_PERMISSION | Intent . FLAG_GRANT_READ_URI_PERMISSION );
104105
105106// Create CameraIntent for CameraHelper activity call.
106107Intent CameraIntent = new Intent (this ,Class . forName(" com.extrieve.quickcapture.sdk.CameraHelper" ));
107- if (Build . VERSION. SDK_INT <= Build . VERSION_CODES. LOLLIPOP ) {
108+ if (Build . VERSION. SDK_INT <= Build . VERSION_CODES. LOLLIPOP ) {
108109 CameraIntent . addFlags(Intent . FLAG_GRANT_WRITE_URI_PERMISSION );
109110}
110111// Call the Activity.
111112startActivityForResult(CameraIntent ,REQUEST_CODE_FILE_RETURN );
112113
113- // On activity result, recieve the captured, reviewed, cropped, optimised & compressed image colletion as array.
114+ // On activity result,recieve the captured, reviewed, cropped, optimised & compressed image colletion as array.
114115@Override
115- protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
116+ protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
116117{
117118 super . onActivityResult(requestCode, resultCode, data);
118- if (requestCode == REQUEST_CODE_FILE_RETURN && resultCode == Activity . RESULT_OK )
119+ if (requestCode == REQUEST_CODE_FILE_RETURN && resultCode == Activity . RESULT_OK )
119120 {
120- Boolean Status = (Boolean ) data. getExtras(). get(" STATUS" );
121- String Description = (String ) data. getExtras(). get(" DESCRIPTION" );
122- if (Status == false ){ // Failed to capture
123- finishActivity(REQUEST_CODE_FILE_RETURN ); return ;
121+ Boolean Status = (Boolean )data. getExtras(). get(" STATUS" );
122+ String Description = (String )data. getExtras(). get(" DESCRIPTION" );
123+ if (Status == false ){
124+ // Failed to capture
125+ }
126+ finishActivity(REQUEST_CODE_FILE_RETURN ); return ;
124127 }
125- FileCollection = (ArrayList<String > ) data. getExtras(). get(" fileCollection" );
128+ FileCollection = (ArrayList<String > )data. getExtras(). get(" fileCollection" );
126129 // FileCollection //: will contains all capture images path as string
127130 finishActivity(REQUEST_CODE_FILE_RETURN );
128131}
@@ -151,26 +154,36 @@ try {
151154
152155``` java
153156// JAVA
154- Intent CameraIntent = new Intent (this ,Class . forName(" com.extrieve.quickcapture.sdk.CameraHelper" ));
157+
158+ // Set CaptureMode as SYSTEM_CAMERA_CAPTURE_REVIEW
159+ Config . CaptureSupport . CaptureMode = Config . CaptureSupport . CaptureModes . SYSTEM_CAMERA_CAPTURE_REVIEW ;
160+ // set permission for output path that set in config.
155161UriphotoURI = Uri . parse(Config . CaptureSupport . OutputPath );
156162this . grantUriPermission(this . getPackageName(),photoURI,Intent . FLAG_GRANT_WRITE_URI_PERMISSION | Intent . FLAG_GRANT_READ_URI_PERMISSION );
157- if (Build . VERSION. SDK_INT <= Build . VERSION_CODES. LOLLIPOP ) {
163+
164+ // Create CameraIntent for CameraHelper activity call.
165+ Intent CameraIntent = new Intent (this ,Class . forName(" com.extrieve.quickcapture.sdk.CameraHelper" ));
166+ if (Build . VERSION. SDK_INT <= Build . VERSION_CODES. LOLLIPOP ) {
158167 CameraIntent . addFlags(Intent . FLAG_GRANT_WRITE_URI_PERMISSION );
159168}
169+ // Call the Activity.
160170startActivityForResult(CameraIntent ,REQUEST_CODE_FILE_RETURN );
161171
172+ // On activity result,recieve the captured, reviewed, cropped, optimised & compressed image colletion as array.
162173@Override
163- protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
174+ protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
164175{
165176 super . onActivityResult(requestCode, resultCode, data);
166- if (requestCode == REQUEST_CODE_FILE_RETURN && resultCode == Activity . RESULT_OK )
177+ if (requestCode == REQUEST_CODE_FILE_RETURN && resultCode == Activity . RESULT_OK )
167178 {
168- Boolean Status = (Boolean ) data. getExtras(). get(" STATUS" );
169- String Description = (String ) data. getExtras(). get(" DESCRIPTION" );
170- if (Status == false ){ // Failed to capture
171- finishActivity(REQUEST_CODE_FILE_RETURN ); return ;
179+ Boolean Status = (Boolean )data. getExtras(). get(" STATUS" );
180+ String Description = (String )data. getExtras(). get(" DESCRIPTION" );
181+ if (Status == false ){
182+ // Failed to capture
183+ }
184+ finishActivity(REQUEST_CODE_FILE_RETURN ); return ;
172185 }
173- FileCollection = (ArrayList<String > ) data. getExtras(). get(" fileCollection" );
186+ FileCollection = (ArrayList<String > )data. getExtras(). get(" fileCollection" );
174187 // FileCollection //: will contains all capture images path as string
175188 finishActivity(REQUEST_CODE_FILE_RETURN );
176189}
@@ -199,32 +212,40 @@ try {
199212
200213``` java
201214// JAVA
202- Intent CameraIntent = new Intent (this ,Class . forName(" com.extrieve.quickcapture.sdk.CameraHelper" ));
203- UriphotoURI = Uri . parse(Config . CaptureSupport . OutputPath );
204- this . grantUriPermission(this . getPackageName(),photoURI,Intent . FLAG_GRANT_WRITE_URI_PERMISSION | Intent . FLAG_GRANT_READ_URI_PERMISSION );
205- if (Build . VERSION. SDK_INT <= Build . VERSION_CODES. LOLLIPOP ) {
206- CameraIntent . addFlags(Intent . FLAG_GRANT_WRITE_URI_PERMISSION );
207- }
208- startActivityForResult(CameraIntent ,REQUEST_CODE_FILE_RETURN );
209215
216+ // Set CaptureMode as IMAGE_ATTACH_REVIEW
217+ Config . CaptureSupport . CaptureMode = Config . CaptureSupport . CaptureModes . IMAGE_ATTACH_REVIEW ;
218+ // Create/Convert/ get Image URI from image source.
219+ Uri ImgUri = data. getData();
220+ // Create ReviewIntent for CameraHelper activity call.
221+ Intent ReviewIntent = new Intent (this ,Class . forName(" com.extrieve.quickcapture.sdk.CameraHelper" ));
222+ // Add the image URI to intent request with a key : ATTACHED_IMAGE.
223+ ReviewIntent . putExtra(" ATTACHED_IMAGE" , ImUri );
224+ // Call the Activity.
225+ startActivityForResult(ReviewIntent ,REQUEST_CODE_FILE_RETURN );
226+
227+ // On activity result,recieve the captured, reviewed, cropped, optimised & compressed image colletion as array.
210228@Override
211- protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
229+ protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
212230{
213231 super . onActivityResult(requestCode, resultCode, data);
214- if (requestCode == REQUEST_CODE_FILE_RETURN && resultCode == Activity . RESULT_OK )
232+ if (requestCode == REQUEST_CODE_FILE_RETURN && resultCode == Activity . RESULT_OK )
215233 {
216- Boolean Status = (Boolean ) data. getExtras(). get(" STATUS" );
217- String Description = (String ) data. getExtras(). get(" DESCRIPTION" );
218- if (Status == false ){ // Failed to capture
219- finishActivity(REQUEST_CODE_FILE_RETURN ); return ;
234+ Boolean Status = (Boolean )data. getExtras(). get(" STATUS" );
235+ String Description = (String )data. getExtras(). get(" DESCRIPTION" );
236+ if (Status == false ){
237+ // Failed to capture
238+ }
239+ finishActivity(REQUEST_CODE_FILE_RETURN ); return ;
220240 }
221- FileCollection = (ArrayList<String > ) data. getExtras(). get(" fileCollection" );
241+ FileCollection = (ArrayList<String > )data. getExtras(). get(" fileCollection" );
222242 // FileCollection //: will contains all capture images path as string
223243 finishActivity(REQUEST_CODE_FILE_RETURN );
224244}
225245```
226246``` kotlin
227247// Kotlin
248+
228249try {
229250 /* DEV_HELP :redirecting to camera*/
230251 val captureIntent = Intent (this , Class .forName(" com.extrieve.quickcapture.sdk.CameraHelper" ))
0 commit comments