Writers often confuse while and meanwhile.

WHILE

While is a conjunction; it starts a subclause and means during the time that.

This all happened while you were asleep.
While you peel the potatoes, I will make the salad.
While driving along the coast, Robert noticed a large number of birds flying just above the waves.

Against the blue sea a man is stretching on the beach while his wife is lying under a parasol
While Laura enjoyed reading on the beach, Henry did some exercises. Meanwhile, their son had gone for an ice cream.

To indicate that something happened at a point in time we use when.
I was reading the newspaper when there was a sudden knock on the door.

We can use while to contrast ideas:

While Germans are beer drinkers, most Italians prefer wine.
Here while has the meaning of in contrast, on the other hand, unlike or whereas.

In British English you can sometimes see the form whilst, which is more formal than while.

While can also be a noun meaning a period of time:

I’ll be back in a while.
He hadn’t seen her for a while.

MEANWHILE

Meanwhile is an adverb and usually starts a new sentence. It means the same as in the meantime, all the while or at the same time.

Susan went out in the garden to pick some flowers. Meanwhile, I decorated the cake.
Start boiling the water for the rice. Meanwhile, slice the tomatoes and the carrots.

Notice that it is wrong to write *in the meanwhile. It must be either meanwhile or in the meantime. (For the use of the asterisk, see my comment at the end of this text.)