【问题标题】:Read asset file from an Android module从 Android 模块读取资产文件
【发布时间】:2016-04-25 04:37:23
【问题描述】:

我想知道如何从 android 访问 assets 目录(文件路径) 我试过类似的东西:

Uri.parse("file:///android_asset/Resources/sound/" + sound);

但它不起作用!

我知道我可以使用 Titanium 轻松做到这一点,但我需要来自 JAVA 模块的 URI 文件...

有什么想法吗?

【问题讨论】:

    标签: android push-notification titanium appcelerator appcelerator-mobile


    【解决方案1】:

    没有 Uri 或 File 类。

    您必须使用资产管理器,然后为您的文件打开一个输入流并从该流中读取。

    【讨论】:

      猜你喜欢
      • 2019-05-26
      • 1970-01-01
      • 2018-01-19
      • 2018-11-14
      • 2015-05-04
      • 2012-03-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多