How could Yehoshua be in Yericho? The city is closed
Rashi (from Nedarim 56b): This teaches that the Ibur of a city 1 is considered part of the city.
Ran (56b): This is the [roughly] 70 and two thirds Amos outside the city.
When did Yehoshua approach Yericho?
Radak: After they circumcised the Arelim in Gilgal, they offered Pesach and came to [outside] Yericho.
Why did the angel come to Yehoshua?
Radak: It was to invigorate him to conquer it, and inform him [that he will succeed]. He had a drawn sword
Radak: This is like the angel that came to fight with Yakov, who told him "you fought with an angel and with people, and won!"
Why was he carrying a sword?
Malbim: This indicated that he came regarding the war against Yericho; it will be conquered via the sword.
Harchev Davar (Bereishis 48:16): This teaches that he came to protect Yisrael from enemies. Had he come to supply our food, he would have been carrying a sickle.
What is the meaning of "ha'Lanu Atah Im l'Tzareinu "?