A Friedman cosmology is investigated based on scalar-tensor gravitation with general metric coupling and scalar potential functions. We show that for a broad class of such functions, the scalar field can be dynamically trapped using a recently suggested mechanism. The trapped scalar can drive inflation and accelerated cosmic expansion, compatible with standard requirements. The inflationary phase admits a natural exit with a value of the Hubble parameter dictated by the duration of inflation in a parameter independent manner. For inflationary duration consistent with the GUT description, the resulting Hubble parameter is found to be consistent with its observed value.