EDITED
@enniom Hi!
I will take a look at this thoroughly tomorrow - today, I am too tired... It was a long day
Just a quick note - dealing with devices with different sizes is a bit tricky. Note that you cannot rely on raw pixel sizes when calculating the positions, due to different screen density of devices.
For example, you can have two devices with the same raw pixel sizes (e.g., 1920x1080), but their densities can differ. This means that e.g., a square with 100x100 pixels will have different physical size on both devices.
So, the calculations need to be based on physical screen size. You need dpi (dots per inch) value to calculate the actual screen size. Android reports the dpi value in "buckets" (120, 160, 240, 320, etc.), which can be different from actual dpi value of the device. This means that calculated physical screen size is not exact (I could use exact values, but some Android devices have problems reporting this exact values, so this is unreliable). I believe this introduces errors in positioning and scaling.
Furthermore, you generally don't need original screen sizes if you use percentages for positioning and sizing on another device. The aspect ratio ensures that widget ratio is preserved. Using the physical screen size ensures widgets are within the visible area.
Best regards,
Kl3m3n