Do cellphones have the technology to measure altitude through an App as they do speed and GPS.
GPS gives altitude, not just location on the surface, so any cell phone with GPS capability can determine the altitude that way.
Some cell phones also have air pressure sensors that apps can use to calculate the pressure altitude. In my experience, these sensors are sensitive to a single foot of altitude change, but I don't know how accurate they are overall.
I'm going to go against the other two answers here and say "no"...
GPS provides an "altitude", but that distance is the distance above the reference geoid (WGS84), not true altitude above the ground. For simplicity sake let's say that there are two altitudes used in aviation, pressure altitude and the distance above the ground (AGL)...
A phone may be able to measure pressure altitude. Some phones have pressure sensors in them but they may not accurately show the altitude because either you are flying in a pressurized aircraft, or if you are flying something unpressurized the cabin pressure may still differ from the outside pressure by a little bit (many aircraft manuals reference altimeter errors when using the alternate static source, which is located inside the aircraft).
What a phone really can't do is measure AGL, which is the distance above the ground (hard surface). This requires radio altimeters or some other method of correlating your current position, pressure altitude, and the ground level.
So if you are looking for your phone to match what is being displayed in the cockpit on the altimeter, it probably won't match. It may give a reasonable value that can be used in an emergency, but I wouldn't count on it.
Apps like Foreflight or Garmin Pilot use GPS location and map data to calculate an approximate altitude. If you connect them to the cockpit equipment (like an ADS-B with altitude reporting), it will use the same altitude that is being sent out for your ADS-B, which again, may or may not be the same thing that is displayed on your altimeter.
Any app that has access to GPS can do this. Mobile GPS reports your position in three dimensions, along with an inferred accuracy, in metres.
This is sometimes called "fine position" or "high accuracy position" (to distinguish it from "coarse position", which is based on cell tower's location, which you obviously don't have at altitude).
Years ago I wrote a toy web application proof-of-concept to do just that. For fun, I'm currently working on an updated version. (It's a toy for passengers, and obviously not appropriate for navigation.)
Something like ForeFlight is far, far fancier.