Jump to content

Witaj!

Zaloguj lub Zarejestruj się aby uzyskać pełny dostęp do forum.

Photo
- - - - -

Sprawdzanie poziomu baterii


  • Please log in to reply
2 replies to this topic

#1 BartMax

BartMax
  • 39 posts

Posted 01 September 2009 - 15:35

Witam Czy ktos moglby sprawdzic na swoim iphonie ponizszy kod i podeslac mi wynik z konsoli? UIDevice *myDevice = [UIDevice currentDevice]; [myDevice setBatteryMonitoringEnabled:YES]; float batLeft = myDevice.batteryLevel; NSLog(@"level: %d",batLeft); Niestety ja mam ciagle -1 :( Bylbym wdzieczny za informacje

#2 MaGazynieR

MaGazynieR
  • 6 posts

Posted 05 September 2009 - 16:16

Sat Sep 5 17:14:09 unknown test[745] : Battery level: -1610612736 Cokolwiek to oznacza

#3 BartMax

BartMax
  • 39 posts

Posted 27 September 2009 - 01:00

UIDevice *device = [UIDevice currentDevice]; device.batteryMonitoringEnabled = YES; int level=(int)(device.batteryLevel * 100); NSLog(@"level: %d",level); Teraz jest zakres od 1-100 i dziala jak powinno ;)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users