Taking photos is not working on Samsung Tab A7 lite using android version 11 r

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
lmoriba
Posts: 56
Joined: June 10th, 2018, 6:21 pm

Taking photos is not working on Samsung Tab A7 lite using android version 11 r

Post by lmoriba »

Dear CSPRO community,

I don't understand why this is not working for me. I recently acquired Samsung Tab A7 lite. This Samsung was shipped with android version 11R. I developed a photo module in CSPRO but I could take photos. In my application I can only take pictures but I cannot retake or keep photos. In other lower android versions my application worked perfectly fine. I wonder what was the case with android 11.

Attached is my application. I need urgent help and walk around this issue. We bought twenty new Samsungs and we are planning to go to the field right away. The only thing holding us is this issue.
VC-HBR-FIELD.zip
(254.27 KiB) Downloaded 112 times
lmoriba
Posts: 56
Joined: June 10th, 2018, 6:21 pm

Re: Taking photos is not working on Samsung Tab A7 lite using android version 11 r

Post by lmoriba »

Am running CSPRO version 7.7.2. The problem is the setvalvaeset function which is adequately defined in my dictionary appeared not to be working. The logic for the setvalueset is reproduced below.

My application is attached in the first post.

// Show appropriate value set depending on whether
// or not photo exists
if fileexist(photoFilename) then
setvalueset(PP3_PHOTO, PP3_PHOTO_VS_PHOTO_TAKEN);
else
setvalueset(PP3_PHOTO, PP3_PHOTO_VS_NO_PHOTO);
endif;

Is there any walk around this issue? Is the issue related to the version upgrade of the CPRO? Can it be solved by downgrading to a lower version? Or is it the android version? Please I need help urgently as I already bought the tablets and set for the field. My only delay is the tablets.
lmoriba
Posts: 56
Joined: June 10th, 2018, 6:21 pm

Re: Taking photos is not working on Samsung Tab A7 lite using android version 11 r

Post by lmoriba »

Hello CSPRO family,

Am still looking for help. Any help from anybody, please?
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Taking photos is not working on Samsung Tab A7 lite using android version 11 r

Post by sherrell »

Our apologies! Sorry that no one has responded to your post. Have you seen this thread? I am going to guess you need the wait argument. However as Savy mentions, this is a bug that was going to be addressed. 7.7.3 has been released since the below post, and since you are running v7.7.2, you should first see if the updated version works for you.

viewtopic.php?f=10&t=5037&p=15830&hilit ... tem#p15830

Be sure to install the latest CSEntry on your devices too.

Sherrell
lmoriba
Posts: 56
Joined: June 10th, 2018, 6:21 pm

Re: Taking photos is not working on Samsung Tab A7 lite using android version 11 r

Post by lmoriba »

Dear sherrell,

Many thanks for the reply and appologies accepted. I tried to install CSPRO 7.7.3 and also followed the thred you suggested. consequently I ammended the camerara program as is given below. However, the samsung tablet onlu allows you to take photo or refuse /not at home. Only these two options it allows. It doesn't allow you to retake or save or delete the photo. I still need help.
Onfocus
string photoFilename = pathname(application) +

maketext("../Data/PHOTO1/Photos%v-%v-%v-%v-%v-%v: %s.jpg",
VC1,VC2,VC3,VC4,VC6,VC7,strip(VC8_NAME_OF_CHILD));

// Show appropriate value set depending on whether
// or not photo exists
if fileexist(photoFilename) then
setvalueset(PP3_PHOTO, PP3_PHOTO_VS_PHOTO_TAKEN);
else
setvalueset(PP3_PHOTO, PP3_PHOTO_VS_NO_PHOTO);
endif;


postproc
if PP3_PHOTO = 1 then
// Take/retake
//execsystem(maketext("camera:%s", photoFilename));
ExecSystem(MakeText("camera:%s", photoFilename), wait);

reenter;
elseif PP3_PHOTO = 2 then
// View existing photo
execsystem(maketext("view:%s", photoFilename));

reenter;
elseif PP3_PHOTO = 3 then
// Keep photo - move to next field
move TO PP3_1_PHOTO;
elseif PP3_PHOTO = 9 then
// Refusal - delete any existing photo
filedelete(photoFilename);
endif;
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Taking photos is not working on Samsung Tab A7 lite using android version 11 r

Post by aaronw »

I have an Pixel with Android 12 and the value sets were set correctly using the project from 9/6.

Verify the existence and location of the photo on Samsung. Do the photos exist at the paths you expect?
lmoriba
Posts: 56
Joined: June 10th, 2018, 6:21 pm

Re: Taking photos is not working on Samsung Tab A7 lite using android version 11 r

Post by lmoriba »

Dear Aaronw,

With the Samsung version a7 Tab am using pixels did not show anywhere. Perhaps this has more to do with my synthax to acquire the photo. However, if use the example as provided in the thred illustrated by Sherell pixels appeared in the main cspro program folder. However, all dictionary unique identifier variables would show in identifying the pixel exept the name of the child.

The synthax shown in the thred is given below:

OnFocus
String PHOTO1 = MakeText("%sPH-%5s-1.JPG", pathname(Application),RID);
IF fileexist(PHOTO1) then
SetValueSet(Q1, Q1_PHOTO_TAKEN);
$=3;
ELSE
SetValueSet(Q1, Q1_PHOTO_NOT_TAKEN);
$=1;
ENDIF;

POSTPROC
IF $ = 1 then
ExecSystem(MakeText("camera:%s", PHOTO1));
REENTER;
ELSEIF $ = 2 then
ExecSystem(MakeText("view:%s", PHOTO1));
REENTER;
ELSEIF $ = 3 then
PHOTO1=MakeText("PH-%5s-1.JPG",RID);
ELSEIF $ = 9 then
IF fileexist(PHOTO1) then
filedelete(PHOTO1);
ENDIF;
ENDIF;

The sythax I used which didn't show any pixel is this:

Onfocus
string photoFilename = pathname(application) +

maketext("../Data/PHOTO1/Photos%v-%v-%v-%v-%v-%v: %s.jpg",
VC1,VC2,VC3,VC4,VC6,VC7,strip(VC8_NAME_OF_CHILD))
;

// Show appropriate value set depending on whether
// or not photo exists
if fileexist(photoFilename) then
setvalueset(PP3_PHOTO, PP3_PHOTO_VS_PHOTO_TAKEN);
else
setvalueset(PP3_PHOTO, PP3_PHOTO_VS_NO_PHOTO);
endif;


postproc
if PP3_PHOTO = 1 then
// Take/retake
//execsystem(maketext("camera:%s", photoFilename));
ExecSystem(MakeText("camera:%s", photoFilename), wait);

reenter;
elseif PP3_PHOTO = 2 then
// View existing photo
execsystem(maketext("view:%s", photoFilename));

reenter;
elseif PP3_PHOTO = 3 then
// Keep photo - move to next field
move TO PP3_1_PHOTO;
elseif PP3_PHOTO = 9 then
// Refusal - delete any existing photo
filedelete(photoFilename);
endif;

I want to modify the first line shown in the thred with my own shown above but it failed. I want the namew of the child to show in identifying the photo pixel.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Taking photos is not working on Samsung Tab A7 lite using android version 11 r

Post by Gregory Martin »

Two things:

1) Does the "../Data/PHOTO1" directory exist? Sometimes CSPro creates directories automatically, but in the case of taking photos, I don't believe that it does, so your code would fail in this case. You can create directories using dircreate: https://www.csprousers.org/help/CSPro/d ... ction.html

2) You are using a colon in the filename: "Photos%v-%v-%v-%v-%v-%v: %s.jpg." Apparently a colon is allowed on Unix systems (like Android), but it is not allowed for Windows filenames, so in general that is a bad choice of a filename separator.

I would make sure that the directory exists and remove the colon and then see if this works for you.
Post Reply