Open bau720123 opened 10 years ago
Did you try to access Sysinfo when device is ready ? What version of phonegap/android do you use ?
At this time Sysinfo is available only for android platform.
This may be a bug, indeed.
oh~ phonegao build 3.1,Android 4.03 and the usage just like yours address https://github.com/Ankama/phonegap-sysinfo
I will test on this android version. I'll keep you posted.
Thanks for the report !
thanks you too by the way,no mater I use mothod "alert" or "print" all of then not work~
console.log(Sysinfo) ?
If you have enabled debug with phonegap build, try "Sysinfo" in the console panel.
<script type="text/javascript">
document.addEventListener("deviceready", checksys, false);
function checksys()
{
alert(Sysinfo);
var element = document.getElementById('sys');
element.innerHTML = print(Sysinfo);
console.log(Sysinfo);
}
</script>
<span id="sys"></span>
if I use alert,it will become => [object object] if I use print,it will become => undefined sorry I can't use the console.log,because of my phonegap app content is under the outside domain
I have tested in emulator running on android 4.0.4 (API level 15) with phonegap 3.1 and it works.
Have you correctly added device cordova plugin (cordova plugin add org.apache.cordova.device)
The best way to check is to trace Sysinfo object with console.log() print() always return undefined and it's normal that alert(Sysinfo) display "[Object object]"
OK I will try again~tks @fryck
when I use "print" method to show your "Sysinfo",just like that print(Sysinfo);
but it show....nothing available: { available: { }cpu: { }cpu: { }memory: { }memory: { low: { low: { }threshold: { }threshold: { }available: { }available: { }}getInfo: { }}getInfo: { } }