Форум программистов, компьютерный форум CyberForum.ru

Программирование Android

Войти
Регистрация
Восстановить пароль
 
semiromid
7 / 7 / 2
Регистрация: 28.08.2014
Сообщений: 177
#1

SetExact() - Программирование Android

27.10.2014, 16:53. Просмотров 578. Ответов 5
Метки нет (Все метки)

Здравсвуйте! Я использую метод setExact класса AlarmManager , который рассчитан для для 19 API +. Я тестирую на 21 API в стандартном эмуляторе Eclipse. Но этот метод "setExact", работает только тогда точно по времени , когда устройство не находится с выключенным экраном и с блокировкой. Кода-же я нажимаю кнопку выключения экрана в эмуляторе , то временя срабатывания растягивается . Например я выставил что бы сработало через 60 секунд , то оно срабатывает примерно через 4 минуты 30 секунд.
Что это может быть и как добиться точности? Может-быть лучше использовать что-то другое , не AlarmManager ? А что именно?
Java
1
2
3
4
5
AlarmManager manager;
 
 manager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
 pi = PendingIntent.getBroadcast(getBaseContext(), 0, intent, 0); 
 manager.setExact(AlarmManager.RTC_WAKEUP,System.currentTimeMillis()+60000, pi);
Добавлено через 3 часа 24 минуты
Хочу добавить что на устройствах ниже API 19 работает нормально.

Добавлено через 1 час 22 минуты
Если ставлю на 6 секунд

Java
1
manager.setExact.(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime()+6000, pi);
то срабатывает на 20 секунде , постоянно на 20 . Получается идет какое то смещение времени. Из-за чего оно происходит и что это такое вообще?
Similar
Эксперт
41792 / 34177 / 6122
Регистрация: 12.04.2006
Сообщений: 57,940
27.10.2014, 16:53     SetExact()
Посмотрите здесь:

Как организовать повторение будильника через setExact()? - Программирование Android
Добрый день! Нужно организовать ТОЧНЫЙ повторяющийся будильник методом setExact(). Я пробовал так AlarmManager am = (AlarmManager)...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
После регистрации реклама в сообщениях будет скрыта и будут доступны все возможности форума.
Netscape
371 / 358 / 48
Регистрация: 02.10.2009
Сообщений: 712
Записей в блоге: 4
27.10.2014, 17:49     SetExact() #2
adb shell dumpsys alarm

Копируй сюда весь вывод, будем разбираться.

Добавлено через 21 минуту
Это из стокового будильника:
Java
1
2
3
4
5
6
7
8
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, instance.hashCode(),
stateChangeIntent, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
if (Utils.isKitKatOrLater()) {
am.setExact(AlarmManager.RTC_WAKEUP, timeInMillis, pendingIntent);
} else {
am.set(AlarmManager.RTC_WAKEUP, timeInMillis, pendingIntent);
}
https://android.googlesource.com/pla...teManager.java
semiromid
7 / 7 / 2
Регистрация: 28.08.2014
Сообщений: 177
28.10.2014, 06:23  [ТС]     SetExact() #3
Netscape, Эту команду "adb shell dumpsys alarm" нужно в программу "adb" писать , если я правильно понимаю то подобной вещи в Eclipse нету ?

Добавлено через 59 минут
Netscape, Если я правильно Вас понял , то нужно запустить программу adb.exe с помощью командной строки Windows (cmd ) . Которая находится в папке platform-tools. Я её запустил и ввел эту команду , которую Вы написали выше.
Вот что выдал лог.
Первая часть :
Кликните здесь для просмотра всего текста
ERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.

If -p is not specified, the ANDROID_PRODUCT_OUT

environment variable is used, which must
be an absolute path.
-H - Name of adb server host (default: localhost)
-P - Port of adb server (default: 5037)
devices [-l] - list all connected devices
('-l' will also list device qualifiers)
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this command with no additional arguments

will disconnect from all connected TCP/IP devic
es.

device commands:
adb push [-p] <local> <remote>
- copy file/dir to device
('-p' to display the transfer progress)
adb pull [-p] [-a] <remote> [<local>]
- copy file/dir from device
('-p' to display the transfer progress)
('-a' means copy timestamp and mode)
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward --list - list all forward socket connections.
the format is a list of lines with the followin
g format:
<serial> " " <local> " " <remote> "\n"
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb forward --no-rebind <local> <remote>
- same as 'adb forward <local> <remote>' but fail
s
if <local> is already forwarded
adb forward --remove <local> - remove a specific forward socket connection
adb forward --remove-all - remove all forward socket connections
adb reverse --list - list all reverse socket connections from device

adb reverse <remote> <local> - reverse socket connections
reverse specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
adb reverse --norebind <remote> <local>
- same as 'adb reverse <remote> <local>' but fail
s
if <remote> is already reversed.
adb reverse --remove <remote>
- remove a specific reversed socket connection
adb reverse --remove-all - remove all reversed socket connections from dev
ice
adb jdwp - list PIDs of processes hosting a JDWP transport

adb install [-lrtsd] <file>
adb install-multiple [-lrtsdp] <file...>
- push this package file to the device and instal
l it
(-l: forward lock application)
(-r: replace existing application)
(-t: allow test packages)
(-s: install application on sdcard)
(-d: allow version code downgrade)
(-p: partial application install)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.

adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all]
[-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>
.
If no -f option is supplied then the data is wr
itten
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks
themselves
in the archive; the default is noapk.)
(-obb|-noobb enable/disable backup of any insta
lled apk expansion
(aka .obb) files associated with each applic
ation; the default
is noobb.)
(-shared|-noshared enable/disable backup of the
device's
shared storage / SD card contents; the defau
lt is noshared.)
(-all means to back up all installed applicatio
ns)
(-system|-nosystem toggles whether -all automat
ically includes
system applications; the default is to inclu
de system apps)
(<packages...> is the list of applications to b
e backed up. If
the -all or -shared flags are passed, then t
he package
list is optional. Applications explicitly g
iven on the
command line will be included even if -nosys
tem would
ordinarily cause them to be omitted.)

adb restore <file> - restore device contents from the <file> backup
archive

adb help - show this help message
adb version - show version num

scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb get-devpath - prints: <device-path>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system and /vendor (if present) p
artitions on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:

- If <directory> is not specified, /system, /vendor (if present), and /data pa
rtitions will be updated.

- If it is "system", "vendor" or "data", only the corresponding partition
is updated.




semiromid
7 / 7 / 2
Регистрация: 28.08.2014
Сообщений: 177
28.10.2014, 06:23  [ТС]     SetExact() #4
Вторая часть :
Кликните здесь для просмотра всего текста


environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.

E:\android\EclipseAndSVD\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>s
hell dumpsys alarm
"shell" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.

E:\android\EclipseAndSVD\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>a
db shell dumpsys alarm
Current Alarm Manager state:
nowRTC=1414466071613=2014-10-27 23:14:31 nowELAPSED=904227
Next alarm: 932613 = 2014-10-27 23:14:59
Next wakeup: 947223 = 2014-10-27 23:15:14

Pending alarm batches: 11
Batch{b30f6780 num=1 start=932613 end=932613 STANDALONE}:
ELAPSED #0: Alarm{b30f6738 type 3 android}
type=3 whenElapsed=932613 when=+28s386ms window=0 repeatInterval=0 count=0
operation=PendingIntent{b2de8fe8: PendingIntentRecord{b2df3cb8 android broad
castIntent}}
Batch{b30434e8 num=1 start=933614 end=933614}:
RTC #0: Alarm{b30423f8 type 1 com.android.deskclock}
type=1 whenElapsed=933614 when=+29s387ms window=0 repeatInterval=0 count=0
operation=PendingIntent{b3048458: PendingIntentRecord{b30483e0 com.android.d
eskclock broadcastIntent}}
Batch{b302dde8 num=2 start=947223 end=992222}:
ELAPSED_WAKEUP #1: Alarm{b311d3e8 type 2 com.android.phone}
type=2 whenElapsed=947223 when=+42s996ms window=-1 repeatInterval=0 count=0
operation=PendingIntent{b300ee18: PendingIntentRecord{b3052710 com.android.p
hone broadcastIntent}}
ELAPSED_WAKEUP #0: Alarm{b3035dd8 type 2 android}
type=2 whenElapsed=944660 when=+40s433ms window=-1 repeatInterval=0 count=0
operation=PendingIntent{b2fd7260: PendingIntentRecord{b2fb4768 android broad
castIntent}}
Batch{b3020a88 num=1 start=1861395 end=3211395}:
ELAPSED #0: Alarm{b3020a40 type 3 android}
type=3 whenElapsed=1861395 when=+15m57s168ms window=-1 repeatInterval=180000
0 count=0
operation=PendingIntent{b3036a70: PendingIntentRecord{b3049e90 android broad
castIntent}}
Batch{b3020ab0 num=3 start=3632613 end=3632613}:
RTC #2: Alarm{b301a918 type 1 com.android.calendar}
type=1 whenElapsed=3632613 when=+45m28s387ms window=0 repeatInterval=0 count
=0
operation=PendingIntent{b307afc0: PendingIntentRecord{b2f3ad40 com.android.c
alendar broadcastIntent}}
RTC #1: Alarm{b3012f60 type 1 com.android.inputmethod.latin}
type=1 whenElapsed=3627682 when=+45m23s455ms window=-1 repeatInterval=360000
0 count=0
operation=PendingIntent{b3097bb8: PendingIntentRecord{b3109168 com.android.i
nputmethod.latin broadcastIntent}}
RTC #0: Alarm{b30133c8 type 1 com.android.inputmethod.latin}
type=1 whenElapsed=3582398 when=+44m38s172ms window=-1 repeatInterval=360000
0 count=0
operation=PendingIntent{b308a1d8: PendingIntentRecord{b308a138 com.android.i
nputmethod.latin broadcastIntent}}
Batch{b302de58 num=1 start=3792975 end=6677733}:
RTC_WAKEUP #0: Alarm{b3012fa8 type 0 android}
type=0 whenElapsed=3792975 when=+48m8s748ms window=-1 repeatInterval=3846344
count=0
operation=PendingIntent{b2f79d38: PendingIntentRecord{b2f50570 android broad
castIntent}}
Batch{b2fc1cf8 num=1 start=7402688 end=7402688}:
ELAPSED_WAKEUP #0: Alarm{b2fc89c0 type 2 android}
type=2 whenElapsed=7402688 when=+1h48m18s461ms window=0 repeatInterval=0 cou
nt=0
operation=PendingIntent{b2ec9508: PendingIntentRecord{b2fb34a0 android broad
castIntent}}
Batch{b2fbfad8 num=1 start=28875177 end=50475177}:
ELAPSED #0: Alarm{b2fbfa90 type 3 com.android.phone}
type=3 whenElapsed=28875177 when=+7h46m10s950ms window=-1 repeatInterval=288
00000 count=0
operation=PendingIntent{b3073d40: PendingIntentRecord{b3073ca0 com.android.p
hone broadcastIntent}}
Batch{b2fbfb00 num=1 start=46832613 end=46832613 STANDALONE}:
RTC #0: Alarm{b2fa44e0 type 1 android}
type=1 whenElapsed=46832613 when=+12h45m28s387ms window=0 repeatInterval=0 c
ount=0
operation=PendingIntent{b2e56e78: PendingIntentRecord{b2f3dc68 android broad
castIntent}}
Batch{b30c5ce0 num=1 start=79502021 end=79502021}:
RTC_WAKEUP #0: Alarm{b30c5c98 type 0 com.android.providers.calendar}
type=0 whenElapsed=79502021 when=+21h49m57s795ms window=0 repeatInterval=0 c
ount=0
operation=PendingIntent{b30dcf18: PendingIntentRecord{b30cd330 com.android.p
roviders.calendar broadcastIntent}}
Batch{b2fc1d68 num=1 start=864224743 end=1512211759}:
ELAPSED #0: Alarm{b2e4c820 type 3 android}
type=3 whenElapsed=864224743 when=+9d23h48m40s516ms window=-1 repeatInterval
=0 count=0
operation=PendingIntent{b2e803b0: PendingIntentRecord{b300f548 android broad
castIntent}}
Broadcast ref count: 0

Top Alarms:
+1m50s505ms running, 1 wakeups, 1 alarms: android
act=android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSE
D
+1m50s498ms running, 0 wakeups, 1 alarms: android
act=com.android.server.action.NETWORK_STATS_POLL
+1m40s191ms running, 0 wakeups, 1 alarms: android
act=com.android.server.NetworkTimeUpdateService.action.POLL
+55s643ms running, 12 wakeups, 12 alarms: com.android.phone
act=com.android.internal.telephony.data-stall
+24s658ms running, 2 wakeups, 2 alarms: com.android.providers.calendar
act=com.android.providers.calendar.intent.CalendarProvider2
+19s889ms running, 0 wakeups, 14 alarms: android
act=android.intent.action.TIME_TICK

Alarm Stats:
android +2m9s813ms running, 1 wakeups:
+1m50s505ms 1 wakes 1 alarms: act=android.net.ConnectivityService.action.PKT
_CNT_SAMPLE_INTERVAL_ELAPSED
+1m50s498ms 0 wakes 1 alarms: act=com.android.server.action.NETWORK_STATS_PO
LL
+1m40s191ms 0 wakes 1 alarms: act=com.android.server.NetworkTimeUpdateServic
e.action.POLL
+19s889ms 0 wakes 14 alarms: act=android.intent.action.TIME_TICK
com.android.providers.calendar +24s658ms running, 2 wakeups:
+24s658ms 2 wakes 2 alarms: act=com.android.providers.calendar.intent.Calend
arProvider2
com.android.phone +55s643ms running, 12 wakeups:
+55s643ms 12 wakes 12 alarms: act=com.android.internal.telephony.data-stall

E:\android\EclipseAndSVD\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>

semiromid
7 / 7 / 2
Регистрация: 28.08.2014
Сообщений: 177
28.10.2014, 06:29  [ТС]     SetExact() #5
Наверное я не то выложил что нужно . Вот лог этой команды "adb shell dumpsys alarm"

Кликните здесь для просмотра всего текста


E:\android\EclipseAndSVD\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>a
db shell dumpsys alarm
Current Alarm Manager state:
nowRTC=1414466768450=2014-10-27 23:26:08 nowELAPSED=1601063
Next alarm: 1592614 = 2014-10-27 23:26:00
Next wakeup: 1607851 = 2014-10-27 23:26:15

Pending alarm batches: 11
Batch{b2fb7d40 num=1 start=1607851 end=1652850}:
ELAPSED_WAKEUP #0: Alarm{b30b1a78 type 2 com.android.phone}
type=2 whenElapsed=1607851 when=+6s788ms window=-1 repeatInterval=0 count=0
operation=PendingIntent{b3052478: PendingIntentRecord{b3052710 com.android.p
hone broadcastIntent}}
Batch{b300a0e8 num=1 start=1652614 end=1652614 STANDALONE}:
ELAPSED #0: Alarm{b300a6f8 type 3 android}
type=3 whenElapsed=1652614 when=+51s551ms window=0 repeatInterval=0 count=0
operation=PendingIntent{b2de8fe8: PendingIntentRecord{b2df3cb8 android broad
castIntent}}
Batch{b3125798 num=2 start=1833614 end=1833614}:
RTC #1: Alarm{b3125750 type 1 com.android.deskclock}
type=1 whenElapsed=1833614 when=+3m52s550ms window=0 repeatInterval=0 count=
0
operation=PendingIntent{b3115a18: PendingIntentRecord{b31256b0 com.android.d
eskclock broadcastIntent}}
ELAPSED_WAKEUP #0: Alarm{b310a1a0 type 2 android}
type=2 whenElapsed=1667271 when=+1m6s208ms window=-1 repeatInterval=0 count=
0
operation=PendingIntent{b2fd7260: PendingIntentRecord{b2fb4768 android broad
castIntent}}
Batch{b3020a88 num=1 start=1861395 end=3211395}:
ELAPSED #0: Alarm{b3020a40 type 3 android}
type=3 whenElapsed=1861395 when=+4m20s332ms window=-1 repeatInterval=1800000
count=0
operation=PendingIntent{b3036a70: PendingIntentRecord{b3049e90 android broad
castIntent}}
Batch{b3020ab0 num=3 start=3632613 end=3632613}:
RTC #2: Alarm{b301a918 type 1 com.android.calendar}
type=1 whenElapsed=3632613 when=+33m51s550ms window=0 repeatInterval=0 count
=0
operation=PendingIntent{b307afc0: PendingIntentRecord{b2f3ad40 com.android.c
alendar broadcastIntent}}
RTC #1: Alarm{b3012f60 type 1 com.android.inputmethod.latin}
type=1 whenElapsed=3627682 when=+33m46s618ms window=-1 repeatInterval=360000
0 count=0
operation=PendingIntent{b3097bb8: PendingIntentRecord{b3109168 com.android.i
nputmethod.latin broadcastIntent}}
RTC #0: Alarm{b30133c8 type 1 com.android.inputmethod.latin}
type=1 whenElapsed=3582398 when=+33m1s335ms window=-1 repeatInterval=3600000
count=0
operation=PendingIntent{b308a1d8: PendingIntentRecord{b308a138 com.android.i
nputmethod.latin broadcastIntent}}
Batch{b302de58 num=1 start=3792975 end=6677733}:
RTC_WAKEUP #0: Alarm{b3012fa8 type 0 android}
type=0 whenElapsed=3792975 when=+36m31s911ms window=-1 repeatInterval=384634
4 count=0
operation=PendingIntent{b2f79d38: PendingIntentRecord{b2f50570 android broad
castIntent}}
Batch{b2fc1cf8 num=1 start=7402688 end=7402688}:
ELAPSED_WAKEUP #0: Alarm{b2fc89c0 type 2 android}
type=2 whenElapsed=7402688 when=+1h36m41s625ms window=0 repeatInterval=0 cou
nt=0
operation=PendingIntent{b2ec9508: PendingIntentRecord{b2fb34a0 android broad
castIntent}}
Batch{b2fbfad8 num=1 start=28875177 end=50475177}:
ELAPSED #0: Alarm{b2fbfa90 type 3 com.android.phone}
type=3 whenElapsed=28875177 when=+7h34m34s114ms window=-1 repeatInterval=288
00000 count=0
operation=PendingIntent{b3073d40: PendingIntentRecord{b3073ca0 com.android.p
hone broadcastIntent}}
Batch{b2fbfb00 num=1 start=46832613 end=46832613 STANDALONE}:
RTC #0: Alarm{b2fa44e0 type 1 android}
type=1 whenElapsed=46832613 when=+12h33m51s550ms window=0 repeatInterval=0 c
ount=0
operation=PendingIntent{b2e56e78: PendingIntentRecord{b2f3dc68 android broad
castIntent}}
Batch{b30c5ce0 num=1 start=79502021 end=79502021}:
RTC_WAKEUP #0: Alarm{b30c5c98 type 0 com.android.providers.calendar}
type=0 whenElapsed=79502021 when=+21h38m20s958ms window=0 repeatInterval=0 c
ount=0
operation=PendingIntent{b30dcf18: PendingIntentRecord{b30cd330 com.android.p
roviders.calendar broadcastIntent}}
Batch{b2fc1d68 num=1 start=864224743 end=1512211759}:
ELAPSED #0: Alarm{b2e4c820 type 3 android}
type=3 whenElapsed=864224743 when=+9d23h37m3s680ms window=-1 repeatInterval=
0 count=0
operation=PendingIntent{b2e803b0: PendingIntentRecord{b300f548 android broad
castIntent}}

Broadcast ref count: 0

Top Alarms:
+1m50s541ms running, 2 wakeups, 2 alarms: android
act=android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSE
D
+1m50s498ms running, 0 wakeups, 1 alarms: android
act=com.android.server.action.NETWORK_STATS_POLL
+1m40s191ms running, 0 wakeups, 1 alarms: android
act=com.android.server.NetworkTimeUpdateService.action.POLL
+56s89ms running, 23 wakeups, 23 alarms: com.android.phone
act=com.android.internal.telephony.data-stall
+24s658ms running, 2 wakeups, 2 alarms: com.android.providers.calendar
act=com.android.providers.calendar.intent.CalendarProvider2
+20s970ms running, 0 wakeups, 26 alarms: android
act=android.intent.action.TIME_TICK
+44ms running, 0 wakeups, 1 alarms: com.android.deskclock
act=com.android.deskclock.ON_QUARTER_HOUR

Alarm Stats:
android +2m10s930ms running, 2 wakeups:
+1m50s541ms 2 wakes 2 alarms: act=android.net.ConnectivityService.action.PKT
_CNT_SAMPLE_INTERVAL_ELAPSED
+1m50s498ms 0 wakes 1 alarms: act=com.android.server.action.NETWORK_STATS_PO
LL
+1m40s191ms 0 wakes 1 alarms: act=com.android.server.NetworkTimeUpdateServic
e.action.POLL
+20s970ms 0 wakes 26 alarms: act=android.intent.action.TIME_TICK
com.android.deskclock +44ms running, 0 wakeups:
+44ms 0 wakes 1 alarms: act=com.android.deskclock.ON_QUARTER_HOUR
com.android.providers.calendar +24s658ms running, 2 wakeups:
+24s658ms 2 wakes 2 alarms: act=com.android.providers.calendar.intent.Calend
arProvider2
com.android.phone +56s89ms running, 23 wakeups:
+56s89ms 23 wakes 23 alarms: act=com.android.internal.telephony.data-stall

E:\android\EclipseAndSVD\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>\

semiromid
7 / 7 / 2
Регистрация: 28.08.2014
Сообщений: 177
28.10.2014, 08:30  [ТС]     SetExact() #6
А вот лог после того как я поставил будильник на 1 минуту и погасил экран стандартного эмулятора в Eclipse API 19. Прошло с момента старта будильника примерно 30 секунд, и я ввел команду adb shell dumpsys alarm

Кликните здесь для просмотра всего текста


E:\android\EclipseAndSVD\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>a
db shell dumpsys alarm
Current Alarm Manager state:
nowRTC=1414467130467=2014-10-27 23:32:10 nowELAPSED=1963081
Next alarm: 1952614 = 2014-10-27 23:32:00
Next wakeup: 1991150 = 2014-10-27 23:32:38

Pending alarm batches: 11
Batch{b311d800 num=1 start=1991150 end=1991150}:
RTC_WAKEUP #0: Alarm{b311d7b8 type 0 com.example.alarmmanager2}
type=0 whenElapsed=1991150 when=+28s70ms window=0 repeatInterval=0 count=0
operation=PendingIntent{b30d3a78: PendingIntentRecord{b308c408 com.example.a
larmmanager2 broadcastIntent}}
Batch{b3078fb8 num=1 start=2012613 end=2012613 STANDALONE}:
ELAPSED #0: Alarm{b31029e0 type 3 android}
type=3 whenElapsed=2012613 when=+49s532ms window=0 repeatInterval=0 count=0
operation=PendingIntent{b2de8fe8: PendingIntentRecord{b2df3cb8 android broad
castIntent}}
Batch{b30c9208 num=1 start=2293840 end=2563837}:
ELAPSED_WAKEUP #0: Alarm{b30c91c0 type 2 com.android.phone}
type=2 whenElapsed=2293840 when=+5m30s759ms window=-1 repeatInterval=0 count
=0
operation=PendingIntent{b308ee70: PendingIntentRecord{b3052710 com.android.p
hone broadcastIntent}}
Batch{b311d8d0 num=2 start=2733614 end=2733614}:
RTC #1: Alarm{b311d958 type 1 com.android.deskclock}
type=1 whenElapsed=2733614 when=+12m50s533ms window=0 repeatInterval=0 count
=0
operation=PendingIntent{b3113f18: PendingIntentRecord{b3139d70 com.android.d
eskclock broadcastIntent}}
ELAPSED_WAKEUP #0: Alarm{b311d888 type 2 android}
type=2 whenElapsed=2553711 when=+9m50s630ms window=-1 repeatInterval=0 count
=0
operation=PendingIntent{b2fd7260: PendingIntentRecord{b2fb4768 android broad
castIntent}}
Batch{b311d9e8 num=3 start=3632613 end=3632613}:
RTC #2: Alarm{b311dab8 type 1 com.android.calendar}
type=1 whenElapsed=3632613 when=+27m49s533ms window=0 repeatInterval=0 count
=0
operation=PendingIntent{b307afc0: PendingIntentRecord{b2f3ad40 com.android.c
alendar broadcastIntent}}
RTC #1: Alarm{b311da70 type 1 com.android.inputmethod.latin}
type=1 whenElapsed=3627681 when=+27m44s601ms window=-1 repeatInterval=360000
0 count=0
operation=PendingIntent{b3097bb8: PendingIntentRecord{b3109168 com.android.i
nputmethod.latin broadcastIntent}}
RTC #0: Alarm{b311d9a0 type 1 com.android.inputmethod.latin}
type=1 whenElapsed=3582399 when=+26m59s318ms window=-1 repeatInterval=360000
0 count=0
operation=PendingIntent{b308a1d8: PendingIntentRecord{b308a138 com.android.i
nputmethod.latin broadcastIntent}}
Batch{b311db48 num=2 start=3792975 end=5011395}:
RTC_WAKEUP #1: Alarm{b311dbd0 type 0 android}
type=0 whenElapsed=3792975 when=+30m29s894ms window=-1 repeatInterval=384634
4 count=0
operation=PendingIntent{b2f79d38: PendingIntentRecord{b2f50570 android broad
castIntent}}
ELAPSED #0: Alarm{b311db00 type 3 android}
type=3 whenElapsed=3661395 when=+28m18s314ms window=-1 repeatInterval=180000
0 count=0
operation=PendingIntent{b3036a70: PendingIntentRecord{b3049e90 android broad
castIntent}}
Batch{b311dc60 num=2 start=7402688 end=7402688}:
ELAPSED_WAKEUP #1: Alarm{b311dce8 type 2 android}
type=2 whenElapsed=7402688 when=+1h30m39s607ms window=0 repeatInterval=0 cou
nt=0
operation=PendingIntent{b2ec9508: PendingIntentRecord{b2fb34a0 android broad
castIntent}}
ELAPSED_WAKEUP #0: Alarm{b311dc18 type 2 android}
type=2 whenElapsed=6193778 when=+1h10m30s697ms window=-1 repeatInterval=0 co
unt=0
operation=PendingIntent{b2e687e8: PendingIntentRecord{b3003708 android broad
castIntent}}
Batch{b30f6350 num=1 start=28875177 end=50475177}:
ELAPSED #0: Alarm{b30f6308 type 3 com.android.phone}
type=3 whenElapsed=28875177 when=+7h28m32s96ms window=-1 repeatInterval=2880
0000 count=0
operation=PendingIntent{b3073d40: PendingIntentRecord{b3073ca0 com.android.p
hone broadcastIntent}}
Batch{b30f6420 num=1 start=46832613 end=46832613 STANDALONE}:
RTC #0: Alarm{b30f63d8 type 1 android}
type=1 whenElapsed=46832613 when=+12h27m49s533ms window=0 repeatInterval=0 c
ount=0
operation=PendingIntent{b2e56e78: PendingIntentRecord{b2f3dc68 android broad
castIntent}}
Batch{b30f64f0 num=1 start=79502022 end=79502022}:
RTC_WAKEUP #0: Alarm{b30f64a8 type 0 com.android.providers.calendar}
type=0 whenElapsed=79502022 when=+21h32m18s941ms window=0 repeatInterval=0 c
ount=0
operation=PendingIntent{b30dcf18: PendingIntentRecord{b30cd330 com.android.p
roviders.calendar broadcastIntent}}
Batch{b30f65c0 num=1 start=864224743 end=1510942927}:
ELAPSED #0: Alarm{b30f6578 type 3 android}
type=3 whenElapsed=864224743 when=+9d23h31m1s662ms window=-1 repeatInterval=
0 count=0
operation=PendingIntent{b2e803b0: PendingIntentRecord{b300f548 android broad
castIntent}}

Broadcast ref count: 0

Top Alarms:
+1m50s716ms running, 0 wakeups, 2 alarms: android
act=com.android.server.action.NETWORK_STATS_POLL
+1m50s606ms running, 3 wakeups, 3 alarms: android
act=android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSE
D
+1m40s191ms running, 0 wakeups, 1 alarms: android
act=com.android.server.NetworkTimeUpdateService.action.POLL
+56s315ms running, 29 wakeups, 29 alarms: com.android.phone
act=com.android.internal.telephony.data-stall
+24s658ms running, 2 wakeups, 2 alarms: com.android.providers.calendar
act=com.android.providers.calendar.intent.CalendarProvider2
+22s628ms running, 0 wakeups, 32 alarms: android
act=android.intent.action.TIME_TICK
+132ms running, 0 wakeups, 2 alarms: com.android.deskclock
act=com.android.deskclock.ON_QUARTER_HOUR

Alarm Stats:
android +2m12s871ms running, 3 wakeups:
+1m50s716ms 0 wakes 2 alarms: act=com.android.server.action.NETWORK_STATS_PO
LL
+1m50s606ms 3 wakes 3 alarms: act=android.net.ConnectivityService.action.PKT
_CNT_SAMPLE_INTERVAL_ELAPSED
+1m40s191ms 0 wakes 1 alarms: act=com.android.server.NetworkTimeUpdateServic
e.action.POLL
+22s628ms 0 wakes 32 alarms: act=android.intent.action.TIME_TICK
com.android.deskclock +132ms running, 0 wakeups:
+132ms 0 wakes 2 alarms: act=com.android.deskclock.ON_QUARTER_HOUR
com.android.providers.calendar +24s658ms running, 2 wakeups:
+24s658ms 2 wakes 2 alarms: act=com.android.providers.calendar.intent.Calend
arProvider2
com.android.phone +56s315ms running, 29 wakeups:
+56s315ms 29 wakes 29 alarms: act=com.android.internal.telephony.data-stall

E:\android\EclipseAndSVD\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>



Добавлено через 30 минут
Хочу добавить что будильник который я поставил на 1 минуту , сработал через 2 минуты 20 секунд . Я проверял несколько раз , и он всегда срабатывает через такой промежуток времени.

Добавлено через 1 час 25 минут
Попробовал использовать android эмулятор устройств "Genymotion" , там все работает хорошо. Почему -же на стандартном AVD работает не так как должно работать ? Можно ли это списать на глюк самого AVD ?
Yandex
Объявления
28.10.2014, 08:30     SetExact()
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Рейтинг@Mail.ru