I saw this movie about 12 years ago (2005) when I was about 8 years old but it probably came out way earlier than that since I saw it on local TV in West Africa. I remember there being a little boy who built a full-sized humanoid robot with wires/cables everywhere. I have a vague memory of this robot sitting in a chair as the boy turned it on. He met some men (I think two friends), they seemed very impressed with what he had built and one of them adopted him and he started to live with them. There was some sort of war/fight and one of the men died. He might have died trying to save the boy but I am not sure. I remember the scene where that guy was cremated with the surviving man standing and watching with his arm around the little boy while looking really sad as dead guy's body was burnt.
The boy was quite young, maybe around 10. I am pretty sure he and most of the other characters were white. I remember really enjoying the emotional bond between him and the guy that 'adopted' him. He would teach the boy lots of things. I think there were flying cars and some advanced weaponry. I also remember the scene where the boy turned on the robot as being very dusty/deserty and crowded.
I really hope this makes sense to someone. I have tried to google for this movie but the only thing that comes up close is AI artificial intelligence. I am 90% sure that this little boy is human anyway so that's not it. I either saw this movie on a black and white TV or it had dull scenery.
This movie started my fascination with robotics and AI. I hope someone recognizes it!