General route for the assembly of functional inorganic capsules.