Adding Android ID to picture name

hello, I propose to use the unique identifier of the smartphone or tablet added in addition to the names of the images taken like on FormEntryActivity.java:

String androidId = Settings.Secure.getString (getContentResolver ().Settings.Secure.ANDROID_ID);
String s = mInstanceFolder + File.separator+ System.currentTimeMillis () + androidId + ".jpg";

it's work for me

Hi @kleos! What problem does this solve for you?

I do a lot of investigation within the company where I work, we survey up to 15000 people in some projects and the neccessite to have the photo of each became a requirement, on odk the photos are named with the time in millisecond from where the probability that photos have the same names is 90%.
so inserting the id of each tablet at the end of each photo allowed me to solve the problem

How is it possible? It's time in milliseconds so from my point of view the probability of receiving two photos with the same name is very very very low. Look here https://www.freeformatter.com/epoch-timestamp-to-date-converter.html it changes very quickly.

Have you really noticed such a case with receiving two photos with the same name?

if you use a single device that makes sense, but when you use 100 devices this kind of problem may have happened, I met him when I was working with a trainee on a project, he did work without connection and unload the data manually failing to have a server sending data and it is by copying all the images in a directory that we found that on 3000 images we had 950 that had the same name

It's hard to believe it must be another issue... even if you use 100 devices at the same time it's not very possible to take two photos at the same time when the time is represented using milliseconds. I could believe it took place maybe once but not for 950 from 3000 cases. Strange, I guess it's something else.

ok in any case my problem is solved with, if you find the origin of this error post me

Agreed with @Grzesiek2010 that it's improbable that a 1/3 of the devices, but there are 30K device deployments of ODK where this might be an issue. I do think this might be an issue we want to address in Collect.

Adding the ANDROID_ID might be bit too Android specific. A 5 digit string from (0-9,a-z) added to then timestamp would generate another 60 million possibilities. Or maybe now is the time to switch to a true UUID.