How to write file into DCIM directory exactly where camera does?

后端 未结 5 512
暖寄归人
暖寄归人 2021-01-20 19:14

Suppose I am writing an alternative Camera application and wish to write images exactly into the same place as Camera does and name them exactly in the same name Camera does

5条回答
  •  盖世英雄少女心
    2021-01-20 19:45

    Things to keep in mind for this answer:

    • Every phone producer creates it's own Camera App, tailored to their hardware.

    • With the right permissions, App's can write (almost) everywhere they want...

    Now to your question(s):

    First, we don't know where the photo's are stored, and what the naming convention is. Every one and their mother has a different idea about what is best. So no "Hey it's always there".

    Those who seek will find: get read & write permissions for the whole device. With that search the whole device to find in what folders the images are in. Now subtract the folders that come from "social media". My guess would be that the folder with the most and or latest images is the one that you want. To be sure, you will need testers, that trust you.

    All that are found were not unorganized: just find the pattern used. There may be a standard for this. The big companies will surely have one. You can ask the device what maker it has. Note, that that answer might not be correct.

    Ain't that a picture, no, it's a photo: And then you get the fun part of accessing the camera. Good times. Remember: request picture => get location of picture in memory => save picture as file. Best part, there is no enforcement of all parts of this API, so different devices need different instructions...

    Have fun & Good luck!

    ps, the downvotes are probably for the lack of code

提交回复
热议问题