在Android的符号链接创建中的​​应用程序的资产目录 [英] Symbolic Link Creation in Android Within an Application's Asset Directory

查看:192
本文介绍了在Android的符号链接创建中的​​应用程序的资产目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法找到这个具体的问题了坚实的答案。

I can't seem to find a solid answer for this specific question.

我试图创建以编程方式在我的资产文件夹中的同一个应用程序的资产目录中的符号链接的目录在其他位置。从本质上讲,我希望做同样的事情是什么Java.nio.Files的createSymbolicLink方法会做。

I'm trying to create a symbolic link programmatically of a directory in my assets folder in another location within the same application's asset directory. Essentially, I'm looking to do the same thing as what the createSymbolicLink method of Java.nio.Files would do.

是否有与Android SDK这样的可用方法吗?如果没有,是否有可能在NDK?

Is there an available way of doing this with the Android SDK? If not, is it possible in the NDK?

推荐答案

有关及以上的Andr​​oid API 21,只需使用:

For Android API 21 and above, just use:

Os.symlink(originalFilePath,symLinkFilePath);

这篇关于在Android的符号链接创建中的​​应用程序的资产目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆