Android, files in media folder automatically copied to data?

Previous topic - Next topic

Kitty Hello

I "could" try to make the copy of the assets file only when you access it. That would make the loading of the game a tad slower then. But! The lowercase/uppercase insensitivity is definitely broken then. You will have to make sure what you use.

...or I could convert it all to lowercase when building the app...
What do you think? I think that using an "loading" screen at the first start might be the best.

Also, when you move an app to the SD card, the copied data should be on the card, too. No?

spacefractal

The loading screen would been automatic accour if attest was copied in the thread by now.

It's easy to wait in a loop for checking when finish.txt exists by GETFILESIZE(), then the thread is finish.

Also it's normal on Linux as big and small letters is different and should not been changed. So I have no problems with that.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Moebius

Copying assets as the program requires it would be useful.  At least this gives us a way to display our own splash screens.
If you can display a 'loading' screen at the start, you could make it just a xml android view, which allows the use of images put in one of the folders - so you could make it display "splash.png" or something like that, copied by GLB (like 'icon.png') on compile.
The problem I found earlier is that in order to display an android 'view', the initialising function where the files are currently copied has to finish first - so you need to find some way of moving it out of that.
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

spacefractal

and yes I like the idea to copy the assets when required, even that mean a bit longer loading time. I dont mind if its copied and stay on the sdcard as well. That due not all assets mightbeen required in the startup or been used at all....

I also don't mind for the case sensitivity, since its normal on Linux/Unix based systems anyway and should been that.

I do still mind the easiest mean a while fix is just copy the assets in a java thread (so it allow glbasic to been init while copy and wait until finish.txt, and eventuelly splash.png files popin in the data folder when found).

I experimenting with that when I got the new parts for my PC (that died yesterday).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Kitty Hello

OK, next update will not block when tfiles are copied. It will display 7 "o" (6x3 square) and change them to "O" so you have a tiny animation while it's copying.
It's not beautiful, but also not ugly. I hope you can live with it.
If not, write a scalable idle animation for me ;)

Moebius

Sounds good.  I guess we could mess with the code anyway if we really wanted too.  Isn't it funny that the difference between a blank screen and a series of moving "O"s is so large to a user?
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

MrTAToad

It all stems from early computers - you dont know whether a blank screen signifies that the computer is doing something or has hung...

It is always good to let the user know when long operations are in progress for the previously specified reason!

BdR

Excellent sounds great :good: looking forward to the update.

Question; does it now also recover when the copying of media files was interrupted? I mean, when the (ever impatient) user presses the back button during copying, or if he presses the "clear data" button in the app info screen..?

Kitty Hello


spacefractal

I also experimenting with copy assets in a thread. I got that actuelly to work.

I have attachments (*-java not supported)... no I need to uploade it to dropbox:
http://dl.dropbox.com/u/3236515/GreedyMouse/SDLActivity.java

In Glbasic you can co that if its a ANDROID device (so you have a idea how to do):

Code (glbasic) Select

// WAIT FOR ASSETS COPYING
IF PLATFORMINFO$("DEVICE")="" OR PLATFORMINFO$("DEVICE")="TOUCHSCREEN" OR PLATFORMINFO$("DEVICE")="KEYBOARD" THEN SLEEP 250
REPEAT
LIMITFPS 10
DRAWRECT 0, 0, 32, 32, RGB(RND(255), RND(255), RND(255))
SHOWSCREEN
UNTIL PLATFORMINFO$("TEMP")<>"INSTALLING" AND PLATFORMINFO$("TEMP")<>""
IF PLATFORMINFO$("DEVICE")="" OR PLATFORMINFO$("DEVICE")="TOUCHSCREEN" OR PLATFORMINFO$("DEVICE")="KEYBOARD" THEN SLEEP 250


as you can see I abused PLATFORMINFO$("TEMP") little abit, which say "INSTALLING" under assetsCopy() and change to the correctpath when its finish.

Yes I only using a blinking curser, but could use graphics or such (which can been loaded soon the graphics file exists).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/