Sounds like you need to revisit your design. As an FYI you can

      Have a service implement activities, just invoke the activities from a 
regular app icon. In this case the solution is both an app and a service.

       Use App widget and/or other form of Interface Definition Language to 
talk to your service from the application activity.

       Other case is to use another form of Interprocess Communication to talk 
from activity to service, i.e. use TCP/UDP.

I wrote a service which talks over bluetooth, there was no requirement for the 
comm. component to use an Actitity, But GUI actitiies are useful for 
configuration of preferences as well as interacting with your service.


  ----- Original Message ----- 
  From: Thisara Rupasinghe 
  To: [email protected] ; [email protected] ; 
[email protected] 
  Sent: Saturday, June 11, 2011 4:27 AM
  Subject: [android-discuss] Access Sensor from Android Service


  Hi all,

  I'm trying implement a background service to read data from a sensor and 
write into SQLite database. Therefore I have implement android service to run 
this task as a background service. But the problem here is since this is a 
service i need to extends this from Service class. And then when I try to 
access the sensor, it is impossible because to access a sensor it need to be an 
activity. And since i have already extends service I can not extend any more 
class.

  Is there any workaround for this problem.

  -- 
  Thanks & Regards,
  Thisara.


  -- 
  You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
  To post to this group, send email to [email protected].
  To unsubscribe from this group, send email to 
[email protected].
  For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en.

Reply via email to