間 and 間に: a whole period or an event within it
Separate an activity spanning a period from something happening within that period. Notice how に changes the focus.
Describe what continues through a period
夏休みの間、毎朝泳ぎました。 presents swimming every morning throughout summer vacation. It describes a habit across that period.
Connect a noun with の, as in 夏休みの間, or use a clause such as 待っている間. Check adjective connections too: 忙しい間 and 静かな間.
Locate an event inside the period
夏休みの間に、新しい水着を買いました。 places the purchase of a swimsuit within the vacation. It does not say the buying continued throughout the break.
留守の間に荷物が届きました。 places a delivery during someone’s absence. に focuses on an event that occurred within the interval.
The number of events is not the deciding rule
一年の間に三回引っ越しました。 can place several events inside a year. Do not restrict 間に to a single occurrence.
To describe reading throughout a wait, you can say 待っている間、本を読んでいました。 Ask whether the activity spans the period or is completed within it.
Quick check: Does 留守の間に友だちが来ました mean that the friend kept visiting throughout the absence?
Show the answer and why
No. It places one visit from the friend within the time someone was away. 間に locates the event inside that period.

