while writing a game for my grandchildren I had two problems that "entertained" me for quite a long time:
1. Adding a view twice:
by mistake I added a scrollview twice to the activity. After selection of an image, the SV is changed to become invisible and then the game goes on. What happened is that one of the SV stayed visible but teransparent and covered the activity screen from sensing the touch, disabling the game. After removing the second addition - everything works. The compiler should have said something, isn't it ?
2. using RandomAccessFile
I used this type of file, with the new WriteObject and ReadObject, to save a special type
It works very efficiently-
But when I changed the name of the program it didn't read the file anymore.
Looking inside I found that the data includes the name of the program:
1. Adding a view twice:
by mistake I added a scrollview twice to the activity. After selection of an image, the SV is changed to become invisible and then the game goes on. What happened is that one of the SV stayed visible but teransparent and covered the activity screen from sensing the touch, disabling the game. After removing the second addition - everything works. The compiler should have said something, isn't it ?
2. using RandomAccessFile
I used this type of file, with the new WriteObject and ReadObject, to save a special type
B4X:
Type Shapeposition(cx As Int, cy As Int, rotation As Int )
Dim pos(7), ref(7) As Shapeposition
B4X:
raf.Initialize(File.DirRootExternal & "/tangram","sets.dat",False)
ref = raf.ReadObject(name_index*kstep)
raf.Close
Looking inside I found that the data includes the name of the program:
, so when the program name is changed - it is unusable, unless re-writing it.Zwt dudu.tangram.main$_shapepositionw q ~ wsq ~ wq ~ wsq