Ankama / phonegap-sysinfo

MIT License
4 stars 5 forks source link

is it a issue? #1

Open bau720123 opened 10 years ago

bau720123 commented 10 years ago

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: { } }

bouftou commented 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.

bau720123 commented 10 years ago

oh~ phonegao build 3.1,Android 4.03 and the usage just like yours address https://github.com/Ankama/phonegap-sysinfo

bouftou commented 10 years ago

I will test on this android version. I'll keep you posted.

Thanks for the report !

bau720123 commented 10 years ago

thanks you too by the way,no mater I use mothod "alert" or "print" all of then not work~

bouftou commented 10 years ago

console.log(Sysinfo) ?

If you have enabled debug with phonegap build, try "Sysinfo" in the console panel.

bau720123 commented 10 years ago
<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

fryck commented 10 years ago

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]"

bau720123 commented 10 years ago

OK I will try again~tks @fryck