PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → iOS app having trouble with photo count & deletion
iOS app having trouble with photo count & deletion
Started by Claire, Nov., 21 2017 5:10 PM - 3 replies
Posted on November, 21 2017 - 5:10 PM
Hello,

I have been in the process of updating some of our apps and I've come across an issue on one of them that I am not quite sure how to proceed and if it is something that can be corrected. I will preface this with the fact that I have experience with the WinDev Mobile software, but I am not a master coder.

We have an app that is a citizen science project that collects information on mast (fruits,acorns,etc) and allows users to submit observations along with photos. This app sends and received data so I am assuming it utilizes the HFSQL functionality, which only 2 of our apps currently do this - so to try and find another example in a different app has not worked.

While testing the app, I noticed that on the observation window, where you can attach photos, it is experiencing some issues when you try to delete a photo and update/manage the photo count. Tapping on the photo icon allows me to take a photo with a camera or use the gallery - but for the gallery, it asks for permission only after selected the photo from the gallery versus up front before taking you to your phones gallery. Once you added 2 photos, you can view or delete them by tapping on the thumbnail . For some reason when you try to delete one it will give you an error that the observation does not exist but the photo count at the bottom of the screen go down by 1. If I try to delete the image multiple times, the photo count eventually goes down to -1, -2 and so on but the images still appear in the photo box. If I exit out of the app and completely shut down the app, then return, the photo count ends up reading 1, 2 and so. If I start a new observation or edit a previously saved observation everything works fine and it allows you to delete photos properly and the photo count remains correct within the data manager.

I am thinking that the observation needs to be saved first in order to capture a record ID number or objectID in the database, then the photos can link to the record and there are no issues with editing or deleting the images. I am not quite sure how to proceed with this. Hope that made sense!
Posted on November, 21 2017 - 6:39 PM
Hi Claire,

it seems that you have a bug in your code. However, without seeing that
code, it is impossible to tell you what's wrong...

Anyway, one way of debugging such a process is to add checks in your
code, and trace the result of all the checks in a text file that you can
assess afterward.

One observation, though... It seems that you are deleting things in the
gallery (ie an outside app)... If that is correct, then HFSQL has
nothing to do with the problem...

Now, if what you call the gallery is part of your program, then you are
really not giving us enough to work with

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 11/21/2017 à 11:10 AM, Claire a écrit :
Hello,

I have been in the process of updating some of our apps and I've come
across an issue on one of them that I am not quite sure how to proceed
and if it is something that can be corrected. I will preface this with
the fact that I have experience with the WinDev Mobile software, but I
am not a master coder.
We have an app that is a citizen science project that collects
information on mast (fruits,acorns,etc) and allows users to submit
observations along with photos. This app sends and received data so I am
assuming it utilizes the HFSQL functionality, which only 2 of our apps
currently do this - so to try and find another example in a different
app has not worked.
While testing the app, I noticed that on the observation window, where
you can attach photos, it is experiencing some issues when you try to
delete a photo and update/manage the photo count. Tapping on the photo
icon allows me to take a photo with a camera or use the gallery - but
for the gallery, it asks for permission only after selected the photo
from the gallery versus up front before taking you to your phones
gallery. Once you added 2 photos, you can view or delete them by tapping
on the thumbnail . For some reason when you try to delete one it will
give you an error that the observation does not exist but the photo
count at the bottom of the screen go down by 1. If I try to delete the
image multiple times, the photo count eventually goes down to -1, -2 and
so on but the images still appear in the photo box. If I exit out of the
app and completely shut down the app, then return, the photo count ends
up reading 1, 2 and so. If I start a new observation or edit a
previously saved observation everything works fine and it allows you to
delete photos properly and the photo count remains correct within the
data manager.
I am thinking that the observation needs to be saved first in order to
capture a record ID number or objectID in the database, then the photos
can link to the record and there are no issues with editing or deleting
the images. I am not quite sure how to proceed with this. Hope that made
sense!
Posted on November, 28 2017 - 2:36 PM
Hi Fabrice,

I will have to research how to do the checks - Unfortunately, the person who wrote the code for all of our apps left a few years ago and I have been updating them when necessary but this is the first time that the update will involve something more than just layout changes.

As for the gallery, my apologies, I was referring to the Gallery that stores all the phones on an iPhone (you can select gallery and then choose a photo that you've already taken). In order to take a photo, a window pops up asking if you would like to use the camera to take a picture or access your photo gallery/library to select a photo.

At the moment, I haven't been able to figure out the exact steps of how things are being handled within the app when it comes to taking and deleting photos within the app.

After deleting a record and going in to add a new one, it shows that there are still 2 photos:




Gallery/Camera options:




Took a picture, tapped on it and deleted it - yet it still shows the thumbnail:




Not sure these screenshots help but I thought I would include them.
Posted on November, 28 2017 - 3:45 PM
Hi Claire

you will have to look in the code in order to find out where the photos
are saved. It can be inside the DB, or in a directory, and in that case
it can be the directory the external gallery is working on or not.

Once you know that, you will have to check what the deletion of a
picture is doing, and what it SHOULD be doing instead...


Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com

Le 11/28/2017 à 8:36 AM, Claire a écrit :
Hi Fabrice,

I will have to research how to do the checks - Unfortunately, the person
who wrote the code for all of our apps left a few years ago and I have
been updating them when necessary but this is the first time that the
update will involve something more than just layout changes.

As for the gallery, my apologies, I was referring to the Gallery that
stores all the phones on an iPhone (you can select gallery and then
choose a photo that you've already taken). In order to take a photo, a
window pops up asking if you would like to use the camera to take a
picture or access your photo gallery/library to select a photo.
At the moment, I haven't been able to figure out the exact steps of how
things are being handled within the app when it comes to taking and
deleting photos within the app.

After deleting a record and going in to add a new one, it shows that
there are still 2 photos:





Gallery/Camera options:





Took a picture, tapped on it and deleted it - yet it still shows the
thumbnail:





Not sure these screenshots help but I thought I would include them.