Main forum > Bug Reports

SHOEBOX does not work on ANDROID

<< < (3/3)

spacefractal:

--- Code: GLBasic ---BOOL glb_prepare_reading_file(DGStr& filename)
{       if(filename.len()==0)
                return FALSE;

        STDOUT(CGStr("glb_prepare_reading_file: ")+filename);
        #ifdef ANDROID
                TempFileName.releasebuffer();
                DGStr checkfilename=filename;
                                // SPACE FRACTAl - THIS IS REQUIRED. FULL PATH MUST NOT BEEN USED FOR EXTRAXCT
                                checkfilename=REPLACE_Str(GETCURRENTDIR_Str()+filename, DGStr(android_files_dir()), CGStr(""));
                                checkfilename=REPLACE_Str(checkfilename, CGStr("//"), CGStr("/"));
                                checkfilename=REPLACE_Str(checkfilename, CGStr("/Media/"), CGStr("Media/"));
                                STDOUT(checkfilename);
                if(!DOESFILEEXIST(checkfilename)) // This will unpack the file from the APK, if fails to extract from above.
                                {       return FALSE;
                }
                                //STDOUT(CGStr("3: "));
                return TRUE;
#endif
#ifdef WANT_SHOEBOX
        DGStr TempFileName;
        if(!__g_ShoeBox_Data->FindOrExtract(filename, TempFileName.getbuffer(1024), true))
        {
                                TempFileName.releasebuffer();
                                //STDOUT(CGStr("2: "));
                return FALSE;
        }

        TempFileName.releasebuffer();
        filename = TempFileName;
#endif

        return TRUE;
}
 
will remove shoebox feature on Android completly and should no longer crash like crasy.

Also im recommend to redirect SETSHOEBOX() to SETCURRENTDIR() when its used, which im guess its a much better alternative.

MrPlow:
No probs. I only metioned it as I wasn't even using SETSHOEBOX and I got a Shoebox error?
Is there a reason for that?

spacefractal:
Yes. It's a relevant issue as well.

It's call and checking if shoebox file is open or not in the code I'm posted.  It's does with all commands that use files. For some reason it's can also crash too it's seen.

Generally shoebox is very bad on Android, due indirect file access. You ends with more double amount of memory anyway and different issues. On other systems they work, due you have direct file access. Not on Android.

So yes, it's a relevant issue and confirmed. But I'm won't fix it. I'm more interested to remove shoebox completely on Android for improve stability.

Navigation

[0] Message Index

[*] Previous page

Go to full version