The current applications using a phone camera and creating a spectrum readout seems to be only useful in graphing the intensities of various wavelengths of light and not very not useful for accurate chemical analysis on it's own. When linked up to a laser and the appropriate lenses, filters and exposure time however we start to get into some very plausable technology that is currently used by law enforcement and pharmicuitical companies in detection of known drugs, fillers, binders and even some indication of quantity. I'm talking here about Raman Spectroscopy and FTIR.
I would encourage people to explore current developing technologies for accurate and portable drug checking. At present I am quite interested in the promising results from users who have built their own Raman Spec machines including one journal article in 2015 I've read about these DIY Raman machines compared to industry models and also some interesting youtube vids. Current models of Raman Spec machines used by law enforcement seem to each have their own specialities and flaws in their database analysing. I am hopeful that one day soon with projects underway such as with the open source RamenPi Project
https://hackaday.io/project/1279-ramanpi-raman-spectrometer that we will have an intelligent open source software linked to a large chemical database of the spectrum graph of each chemical. The reason we need this is because this is because with a technology such as Raman or FTIR a combination of chemicals in a pill (lets say even just lactose as the filler and MDMA as the active compound) are layed over the top of eachother and would need intelligent software to quickly manage matching them up from a known database and separating these out to give you a match.
If anyone has built their own DIY Raman Spectroscopy machine or has knowledge of an open source database that can be calibrated to different wavelength lasers depending on one used please feel free to let us know. Also if you have looked into other technologies that maybe more efficient and less problimatic, I would love to hear. I believe about 10yrs ago Johnboy looked into using the current tech used by customs as a portible pill testing machine. I believe the tech was ion-scanner?? I would love to hear how it compares with Ramen or FTIR which seem to be getting close to the price point and usability for an enthusist to make at home and be portable.