With utmost effort; doing something with all one's might — essentially synonymous with 'isshokenmei'/'isshokenmei (same reading)'; used to indicate wholehearted effort.
彼女は試験に合格するために一所懸命勉強した。
She studied with all her might to pass the exam.
チーム全員が一所懸命プレーして勝利をつかんだ。
The whole team played their hearts out and won.
一所懸命に働いたが、まだ終わりが見えない。
I worked as hard as I could, but there's still no end in sight.
子どもたちは一所懸命に練習して発表会に臨んだ。
The children practiced with all their might and took part in the recital.
Historically (samurai term): devoting oneself to defending one's land — originally referred to a samurai's dedication to protecting his domain; now mainly an idiom.
戦国時代の資料には、一所懸命に領地を守る武士の記述がある。
In Sengoku-period documents, there are descriptions of samurai who devotedly defended their domains.