A microfluidic device comprising: a) a first element comprising one or more types of chemical functional groups on its surface, wherein said one or more types of the chemical functional groups are comprised in molecules covalently bound to said surface; b) a hydrogel layer having a first face and a second face located opposite to each other, said hydrogel layer comprising one or more types of chemical functional groups, at least one type of said chemical functional groups is effective to react with at least one type of the chemical functional groups comprised in the molecules covalently bound to the surface of the first element; and c) a second element, wherein the hydrogel layer is interposed between the first element and the second element in a given axis substantially perpendicular to the hydrogel layer and wherein the first element, the second element and the hydrogel layer have shapes and dimensions determined to delineate at least one microchannel between the first element and the first face of the hydrogel layer and at least one cavity between the second element and the second face of the hydrogel, said at least one microchannel and said at least one cavity being arranged relative to each other so that said given axis intercepts both said at least one microchannel and said at least one cavity; and wherein at least one type of said chemical functional groups comprised in the molecules covalently bound to the surface of the first element and at least one type of said chemical functional groups of the hydrogel layer are covalently bound to each other. a) a first element comprising one or more types of chemical functional groups on its surface, wherein said one or more types of the chemical functional groups are comprised in molecules covalently bound to said surface; b) a hydrogel layer having a first face and a second face located opposite to each other, said hydrogel layer comprising one or more types of chemical functional groups, at least one type of said chemical functional groups is effective to react with at least one type of the chemical functional groups comprised in the molecules covalently bound to the surface of the first element; and c) a second element, wherein the hydrogel layer is interposed between the first element and the second element in a given axis substantially perpendicular to the hydrogel layer and wherein the first element, the second element and the hydrogel layer have shapes and dimensions determined to delineate at least one microchannel between the first element and the first face of the hydrogel layer and at least one cavity between the second element and the second face of the hydrogel, said at least one microchannel and said at least one cavity being arranged relative to each other so that said given axis intercepts both said at least one microchannel and said at least one cavity; and wherein at least one type of said chemical functional groups comprised in the molecules covalently bound to the surface of the first element and at least one type of said chemical functional groups of the hydrogel layer are covalently bound to each other. wherein the hydrogel layer is interposed between the first element and the second element in a given axis substantially perpendicular to the hydrogel layer and wherein the first element, the second element and the hydrogel layer have shapes and dimensions determined to delineate at least one microchannel between the first element and the first face of the hydrogel layer and at least one cavity between the second element and the second face of the hydrogel, said at least one microchannel and said at least one cavity being arranged relative to each other so that said given axis intercepts both said at least one microchannel and said at least one cavity; and wherein at least one type of said chemical functional groups comprised in the molecules covalently bound to the surface of the first element and at least one type of said chemical functional groups of the hydrogel layer are covalently bound to each other.