I'm developing a cross-platform mobile application using HTML5 Javascript & Phonegap. It's supposed to be an application which can display the Device Information and RAM & CPU status (using & free RAM CPU, name, size,...). But I can find any API which can get the status of CPU&RAM. I'm just a beginner in Mobile HTML5&JavaScript. So, if you guys know anything that can help, please tell me. I'll be very appriciated. Thank you!
-
There's no way to do this using Javascript. The browser does not have access to that kind of system information. β tb11 Aug 05 '13 at 02:53
-
@tb11βit's probably more correct to say browser developers have chosen not to provide access to detailed system information from the scripting environment. The current "API" is the user agent string, but it's unreliable and insufficient for the OP's requirements. β RobG Aug 05 '13 at 03:23
2 Answers
In a plain web app you don't have access to this information. But since you mentioned Phonegap in your question, you can get basic device info using this:
http://docs.phonegap.com/en/3.0.0/cordova_device_device.model.md.html#device.model
There are also 2 cordova plugins which you can look into. Neither has iOS support at the time of this writing.
http://plugins.cordova.io/#/package/com.ankamagames.plugins.sysinfo http://plugins.cordova.io/#/package/org.chromium.system.memory
You may want to look at Chrome packaged apps and the chrome.* apis for cross platform and mobile development here https://developer.chrome.com/apps/about_apps

- 2,759
- 1
- 16
- 11
Although I never worked on such area. But what I can suggest is- You will need to write android native plugin to achieve the same.
I think there should be android api to read memoryinfo and cpuinfo file if not you can directly read /proc/cpuinfo and /proc/memoryinfo to get ram and cpu related information. Hope it will give you some insight. Below is the link of related question - Android How do you get total memory RAM in the device?