Create object for ActivityManager

I am trying to get memorystatus.For that i need to use method getMemoryInfo(ActvityManager.MemoryInfo).I can access it by using ActivityManager class only.But i can't make it out.Please help me to create object for activitymanager.And Can i get Total memory in emulator ?Or we can get it in mobile testing only.
Thanks in advance
saran

I am trying to get memorystatus.For that i need to use method getMemoryInfo(ActvityManager.MemoryInfo).I can access it by using ActivityManager class only.But i can't make it out.Please help me to create object for activitymanager.And Can i get Total memory in emulator ?Or we can get it in mobile testing only.
Thanks in advance
saran