RichardY
V2EX  ›  Android

Android 有没有办法用一段代码生成 content uri

  •  
  •   RichardY · May 15, 2022 · 12746 views
    This topic created in 1476 days ago, the information mentioned may be changed or developed.
    想要通过简单的代码达到:
    根据一个文件的本地路径生成一个 content uri ( content://xxxx.xxx/xxx.xx 这种形式)
    如果能用 shell 生成的话更好了。
    2 replies    2022-05-16 10:57:16 +08:00
    AoEiuV020CN
        1
    AoEiuV020CN  
       May 16, 2022
    > 根据一个文件的本地路径生成一个 content uri
    这不就是 FileProvider.getUriForFile 的使用场景吗?
    content 是对应 provider 的,provider 对应一个安卓应用,纯 linux shell 命令不涉及安卓应用应该没办法生成可用的 content uri 的,
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2912 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 03:57 · PVG 11:57 · LAX 20:57 · JFK 23:57
    ♥ Do have faith in what you're doing.