Add a new photo

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
btri Arjun
Posts: 37
Joined: August 17th, 2018, 6:09 am

Add a new photo

Post by btri Arjun »

Dear team,

I developed a "takephoto" function and its working well. I want to take some photos in a household. But, when I take a new photo, it replaced the previous one (its taking only one photo). How can I take more photos within a case. I have used following photo' name which is my data ID:

photoFileName = pathname(CSEntry) + maketext("App2020/SYS/Images/D%0d-P%02d-W%02d-E%02d-H%03d.jpg",
DISTRICT1,CUR_MINU,CURRENT_WARD,INTERVIEWER,HOUSEHOLD);

Thank you.


Arjun
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Add a new photo

Post by josh »

Since the name of the file is based only the case ids you can only have one photo per case. Add a second photo question and include the question number in the file name. So if you have an item named PHOTO1 and another named PHOTO2 then do something like:

photoFileName = pathname(CSEntry) + maketext("App2020/SYS/Images/D%0d-P%02d-W%02d-E%02d-H%03d-PHOTO1.jpg",
DISTRICT1,CUR_MINU,CURRENT_WARD,INTERVIEWER,HOUSEHOLD);

and similarly for PHOTO2.
Post Reply