Java 如何通过C+编写的代码在Android设备中保存位图图像+; 我试图在Android中保存位图图像,但是通过C++功能。我需要使用流吗?如果是,我应该为创建的ofstream对象提供什么路径 std::ofstream bmpF; bmpF.open(<Android Path?>, std::ofstream::binary | std::ofstream::out); std::of Stream bmpF; bmpF.open(,std::ofstream::binary | std::ofstream::out);

Java 如何通过C+编写的代码在Android设备中保存位图图像+; 我试图在Android中保存位图图像,但是通过C++功能。我需要使用流吗?如果是,我应该为创建的ofstream对象提供什么路径 std::ofstream bmpF; bmpF.open(<Android Path?>, std::ofstream::binary | std::ofstream::out); std::of Stream bmpF; bmpF.open(,std::ofstream::binary | std::ofstream::out);,java,android,c++,ofstream,Java,Android,C++,Ofstream,文件名可以是android项目中的任何路径。您可以通过jni层传递它,并在java中从:context.getFilesDir()+ 至于流的使用:您可以选择以和在普通c/c++项目中相同的方式写入文件 文本文件示例 void writeToFile( const char* fileName) { FILE* fid = fopen(fileName, "w"); if (fid==NULL) { printf("WriteVectorArt: couldn't

文件名可以是android项目中的任何路径。您可以通过jni层传递它,并在java中从:context.getFilesDir()+

至于流的使用:您可以选择以和在普通c/c++项目中相同的方式写入文件

文本文件示例

void writeToFile( const char* fileName) {
    FILE* fid = fopen(fileName, "w");
    if (fid==NULL) {
        printf("WriteVectorArt: couldn't open the file");
    } else {
        fprintf(fid, "SomeText to write");
        fclose(fid);
   }}
bmpF.open(“//storage//simulated//0//pictures//name.bmp”,std::ofstream::binary | std::ofstream::out)