将文件(*.xls)添加到android项目

将文件(*.xls)添加到android项目,android,Android,我应该将哪个文件夹放在excel文件(*.xls)中以用于android项目?我希望它们在apk文件中,以及以后如何打开它们?我试着把它们放在资产文件夹中,然后像这样打开: try { in = getAssets().open("schedule.xml"); } catch (IOException e) { e.printStackTrace(); return "can't open the file"; } 但是

我应该将哪个文件夹放在excel文件(*.xls)中以用于android项目?我希望它们在apk文件中,以及以后如何打开它们?我试着把它们放在资产文件夹中,然后像这样打开:

    try {
        in = getAssets().open("schedule.xml");
    } catch (IOException e) {
        e.printStackTrace();
        return "can't open the file";
    }

但是它不起作用。

你是说
xls
还是
xml
?这是两种完全不同的类型,请确保使用的文件类型正确

任何文件都可以放在
res/raw
文件夹中。如果文件夹不存在,请创建它

in = getResources().getAssets().open("schedule.xls"); 
这个很好用

in=getResources().getAssets().open(“schedule.xls”);很好用