android fluid frames and gc

Started by
9 comments, last by frob 9 years, 10 months ago


also this is a bit mysterious

SurfaceHolder holder = getHolder();

It is exactly the same as it works in C, since you are already familiar with C. It calls a function and stores the result. However, as Java works slightly different from C, it would be a SurfaceHolder pointer rather than a SurfaceHolder structure, but the concept is the same. Call a function, store the result.


isnt it some violation of OOP rules (i know almost nothing about) to get some "holder" to some surface just from nothing, some global space? I do not understand this - how man shopuld understand it

It calls a function that is within the current scope. It might be inside the class, it might be inside a parent class, it might be somewhere else. All you need to know is that the compiler can find the function somewhere.

As for the rest, why doesn't the code follow some other design, those are bigger design questions. Even though it adds a tiny bit of complexity by requiring additional knowledge, it radically simplifies the design because components can be reused.

Even though it might be simpler in some ways to weld and epoxy everything together, people use bolts and screws and other standard parts because they can be easily reused.

This topic is closed to new replies.

Advertisement