Is it possible to use the accelerometer in a background service?

by Dianne Hackborn » Thu, 10 Sep 2009 03:42:13 GMT


Sponsored Links
 There is no need to use getBaseContext(); Service is itself a Context.







-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~



Is it possible to use the accelerometer in a background service?

by John Smith » Thu, 10 Sep 2009 06:21:53 GMT


 2009/9/10 dadical <keyes...@gmail.com>:



Thanks for that I think the problem was far simpler, I was coding late
at night and I didn't set the class to implement SensorEventListener
:)

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. HorizontalScrollView automatically scrolling

Hello,

I am developing for Honeycomb, and I have a HorizontalScrollView with
a number of "panels" that make up the UI. The rightmost panel changes
its content, sometimes displaying a ListView. I also have a sliding
drawer that, when opening or closing, causes the HorizontalScrollView
to resize.

When the HorizontalScrollView resizes, it also jumps to show the
rightmost panel, which I don't want. But this only happens when the
panel contains a ListView - when the panel contains a LinearLayout the
HorizontalScrollView doesn't change it's position when resizing.

The only similar issue I found while searching is this:
http://stackoverflow.com/questions/1878623/listview-in-a-horizontalscrollview-in-android,
but it's triggered by an adapter changing data rather than a resize.

How can I stop this automatic scrolling?

Thanks,
Mike

-- 

2. Help needed ijn analysing Kernel panic in Android

Hi All,
Does any one know how to analyze Kernal panic in Android?

I have following log to be analyzed.

--Begin log --
<7>[   17.457763] Disabling unused clock "dpll4_m6x2_ck"
<7>[   17.457885] Disabling unused clock "dpll3_m3x2_ck"
<7>[   17.458099] Disabling unused clock "sys_clkout1"
<3>[   17.458618] sr_recalibrate: 2:2 autocomp was disabled
<6>[   17.458984] VFP support v0.3: implementor 41 architecture 3
part 30 variant c rev 3
<3>[   17.460845] regulator_check_voltage: operation not allowed
for vusb
<6>[   17.461578] cpcap_usb_det cpcap_usb_det: CPCAP USB detection
 device probed
<6>[   17.465911] cpcap_rtc cpcap_rtc: setting system clock to
2011-04-28 13:43:12 UTC (1303998192)
<7>[   17.466156] ov5650_sensor_power_set: power on
<7>[   17.469635] ov5650_sensor_power_set_reset: power on
<6>[   17.469726] cam_reset_gpio 98
<6>[   17.469818] cam_standby_gpio 64
<6>[   17.470031] mapphone_camera_reg_power - enable vcam
<4>[   17.470214] mmc0: host does not support reading read-only
switch. assuming write-enable.
<6>[   17.470397] mmc0: new SD card at address 0002
<6>[   17.470886] mmcblk0: mmc0:0002 00000 1.86 GiB
<6>[   17.471252]  mmcblk0:
<6>[   17.472564] mapphone_camera_reg_power - enable vwlan1
<4>[   17.474761]  p1
<6>[   17.602874] ov5650 Chip version 0x1e detected
<7>[   17.603088] ov5650_sensor_power_set_reset: power off
<6>[   17.603179] mapphone_camera_reg_power - disable vcam
<6>[   17.603393] mapphone_camera_reg_power - disable vwlan1
<6>[   17.616668] video4linux video0: video0 is now omap3/ov5650//
<6>[   17.617797] HP_GEN_LENS 3-0004: lens probe called....
<6>[   17.617919] video4linux video0: video0 is now
omap3/ov5650/hplens/
<3>[   17.618072] Registered hplens as V4L2 device.
<6>[   17.618499] Freeing init memory: 180K
<4>[   17.618621] Warning: unable to open an initial console.
<6>[   17.679046] cpcap spi1.0: notify_accy: accy=3
<6>[   17.721221] keychord: using input dev sholes-keypad for
fevent
<6>[   17.727050] kjournald starting.  Commit interval 5 seconds
<6>[   17.728912] EXT3 FS on mmcblk1p21, internal journal
<6>[   17.729156] EXT3-fs: mounted filesystem with ordered data
mode.
<6>[   18.186859] kjournald starting.  Commit interval 5 seconds
<6>[   18.189239] EXT3 FS on mmcblk1p24, internal journal
<6>[   18.189422] EXT3-fs: mounted filesystem with ordered data
mode.
<6>[   18.292541] kjournald starting.  Commit interval 5 seconds
<6>[   18.294067] EXT3 FS on mmcblk1p22, internal journal
<6>[   18.294250] EXT3-fs: mounted filesystem with ordered data
mode.
<6>[   18.345825] CPUFREQ: Per core ondemand sysfs interface is
deprecated - up_threshold
<6>[   18.346038] CPUFREQ: Per core ondemand sysfs interface is
deprecated - sampling_rate
<6>[   18.346160] sr_vdd1_autocomp: Already set to 1
<6>[   18.432647] kjournald starting.  Commit interval 5 seconds
<6>[   18.434356] EXT3 FS on mmcblk1p7, internal journal
<6>[   18.434661] EXT3-fs: mounted filesystem with ordered data
mode.
<6>[   18.506591] kjournald starting.  Commit interval 5 seconds
<6>[   18.508209] EXT3 FS on mmcblk1p23, internal journal
<6>[   18.508422] EXT3-fs: mounted filesystem with ordered data
mode.
<6>[   18.519226] Inserting sec module
<6>[   18.610137] SMC: SecureCRC=0x03E75215
<6>[   18.669799] SMC PA: INFO 00000001 00:00:00.000 ------ ------
 ---------------- Booting... (t=13:43:13.644) SMC 2.7.0.24149     /HW
Token Service Integrat
<6>[   18.681457] SMC PA: INFO 00000002 00:00:00.000 ------ ------
 ---------------- ion
<4>[   18.728088] Mirror/redirect action on
<4>[   18.796203] u32 classifier
<4>[   18.796386]     Actions configured
<6>[   18.831115] SMC PA: INFO 00000003 00:00:00.210 P-001D T-0034
 IPRM decode ---- SSPICreate
<6>[   18.835327] VPNClient built on Apr 26 2011 14:30:10
<6>[   18.910308] SMC PA: INFO 00000004 00:00:00.294 P-0009 T-000B
 fileServer ----- Mounting partition 1...
<6>[   18.955413] SMC PA: INFO 00000005 00:00:00.342 ------ ------
 ---------------- Booted
<6>[   19.055053] SMC PA: INFO 00000006 00:00:00.436 P-0009 T-000B
 fileServer ----- File system mounted successfully in partition 1
<3>[   19.350250] init: untracked pid 1152 exited
<3>[   19.350830] init: service 'console' requires console
<3>[   19.353759] init: cannot find '/system/bin/telnetd',
disabling 'telnet'
<6>[   19.362915] Core dump to |/system/bin/coredump init 1
1303998194 pipe failed
<0>[   19.363159] Kernel panic - not syncing: Attempted to kill
init!
<0>[   19.363250] Phone id:10004020a3a998b
<3>[   19.363342] mbm_version=0x0000030a
<3>[   19.363586] mbm_loader_version=0x0000030a
<6>[   19.363891] omap_mdm_ctrl_panic_handler: Kernel panic
detected, power down modem.
<6>[   19.364166] omap_mdm_ctrl_power_off_mdm6600: Initiate BP
modem power down...
<6>[   19.464263] omap_mdm_ctrl_power_off_mdm6600: AP status set
to shutdown req...
<6>[   19.464416] omap_mdm_ctrl_power_off_mdm6600: BP requested to
 shutdown, Waiting for Ack...
<6>[   19.464599] omap_mdm_ctrl_power_off_mdm6600: BP status is:
0x4
<6>[   19.964569] omap_mdm_ctrl_power_off_mdm6600: BP status is:
0x6
<6>[   19.964721] omap_mdm_ctrl_power_off_mdm6600: BP power down
success.
<0>[   20.100128] Timestamp = 1303998194.994
<0>[   20.100311] Current Time = 04-28 13:43:14.994, Uptime =
4.390 seconds
-----End---

Thanks in advance.

-- 

3. store image from my application to some internal device storage

4. issue with setting wallpaper using wallpaperManager.setBitmap

5. android nfc tech API help

6. How does the default News widget animate it's content

7. Market: Significiant installations drop