alfcen Well-Known Member Licensed User Longtime User Sep 13, 2012 #1 Hello Code: Copy Dim Out As OutputStream Out = File.OpenOutput(File.DirRootExternal, "skyatlas/" & pngfile & ".png", False) Canvas1.Bitmap.WriteToStream(Out, 100, "PNG") Out.Close works fine with a 640x960px phone running Android 2.2, but does not write any file with a tablet 1280x800px running Android 4.03. Tried JPEG, too, but no change. Anybody more familiar with Android 4.03 and its possible glitches? Android 4.x virtually bombards me with out-of-memory errors, while the 2-years old phone never complains. Time to care about memory sensitive programming, such as clearing bitmaps and canvases... the better practice, though.
Hello Code: Copy Dim Out As OutputStream Out = File.OpenOutput(File.DirRootExternal, "skyatlas/" & pngfile & ".png", False) Canvas1.Bitmap.WriteToStream(Out, 100, "PNG") Out.Close works fine with a 640x960px phone running Android 2.2, but does not write any file with a tablet 1280x800px running Android 4.03. Tried JPEG, too, but no change. Anybody more familiar with Android 4.03 and its possible glitches? Android 4.x virtually bombards me with out-of-memory errors, while the 2-years old phone never complains. Time to care about memory sensitive programming, such as clearing bitmaps and canvases... the better practice, though.
Erel B4X founder Staff member Licensed User Longtime User Sep 13, 2012 #2 Can you post the full error message from the logs? Upvote 0
alfcen Well-Known Member Licensed User Longtime User Sep 13, 2012 #3 There is no error message. BTW, File.Copy works. Upvote 0
I Inman Well-Known Member Licensed User Longtime User Sep 13, 2012 #4 alfcen said: Android 4.x virtually bombards me with out-of-memory errors, while the 2-years old phone never complains. Time to care about memory sensitive programming, such as clearing bitmaps and canvases... the better practice, though. Click to expand... You can try setting android:largeHeap="true" in your Manifest file, which will increase the available heap size for the app, for Android 3.0 and above devices Upvote 0
alfcen said: Android 4.x virtually bombards me with out-of-memory errors, while the 2-years old phone never complains. Time to care about memory sensitive programming, such as clearing bitmaps and canvases... the better practice, though. Click to expand... You can try setting android:largeHeap="true" in your Manifest file, which will increase the available heap size for the app, for Android 3.0 and above devices
alfcen Well-Known Member Licensed User Longtime User Sep 13, 2012 #5 Thanks a lot for throwing this in, Inman, I'll definitely try it. Upvote 0