If your sample has closed pores, usual adsorption of gas or Archimedes' Principle cannot be used to measure the true density. They will only give you an apparent density since the gas or liquid used for these methods will not penetrate into the close pores. The method described by Adbelkader is useful for studying Aerogel, whose pores are all connected. However, foams, that has individual pores separated from each other cannot be measured. If the pore size is rather large, you might grind the foam cryogenically (as small as possible so that there are no left over pores), then use a gas picometer or BET adsorption isotherms to measure the density. The more you grind the particle size smaller, the closer the density approaches to the asymptotic values, which is the true density. If you use mercury densitometer under pressure, you might be able to obtain the porosity and combined with Archimedes' Principle, you might be able to calculate the near true density.
TEM, SEM and optical microscope can be used which is taking photos layer by layer of your samples. The sample preparation is important in such methods where you need microtomy and sometimes freezing in liquid nitrogen. Also, you can use Positron Annihilation Life Spectroscopy (PALS). In this method a graph is gathered based on the time that positron is absorbed.