OK for one Service to bind to another?

by goosedroid » Tue, 01 Mar 2011 03:37:07 GMT


Sponsored Links
 I have a service (ServiceA) which is used by activities by binding to
it.

I would like to kick off one operation on ServiceA, on occasion, via
AlarmManager. I thought the following chain of components would be
appropriate: AlarmManager -> BroadcastReceiver -> ServiceB ->
ServiceA.

In my example, Service B would bind to Service A in
ServiceB.onCreate(), call functions via the bind interface, and unBind
in ServiceB.onDestroy().

The obvious solution is just to have Service A expose this operation
via an Intent, and then have the AlarmManager (via the
BroadcastReceiver) fire off this Intent  to ServiceA. However, for
reason I won't go into, this isn't very feasible for my situation.

Thanks

-- 



Other Threads

1. Wifi is unstable on Nexus One?

* Steps to reproduce the problem:
  Setup wifi and make sure it connected correctly, reboot the phone.

* What happened:
  Wifi doesn't reconnect correctly, always in "disconnected" state.

* What you think the correct behavior should be.
  Wifi reconnect correctly.

The build is Android 2.1-update1.

As shown in the below log, WifiStateTracker tried to associate with my
AP,
but wpa_supplicant is always timed out. So it repeated the
SCANNING ==> ASSOCIATING ==> DISCONNECTED procedures.

Actually I saw similar problem when porting AOSP 1.5~2.1 to my target
device.
Originally I thought it's my own problem.
But now I got an N1 which has the same problem.
So I think it's a bug of AOSP itself.

Any idea?

03-09 09:48:29.738 V/WifiStateTracker(   92): Changing supplicant
state: SCANNING ==> ASSOCIATING
03-09 09:48:33.681 D/WifiStateTracker(   92): Deconfiguring interface
and stopping DHCP
03-09 09:48:34.686 D/NetworkStateTracker(   92): setDetailed state,
old =DISCONNECTED and new state=DISCONNECTED
03-09 09:48:34.708 D/SettingsWifiEnabler(  241): Received network
state changed to NetworkInfo: type: WIFI[], state: DISCONNECTED/
DISCONNECTED, reason: (unspecified), extra: (none), roaming: false,
failover: false, isAvailable: true
03-09 09:48:39.622 I/wpa_supplicant(  698): Authentication with
00:0e:a6:f6:1d:3c timed out.
03-09 09:48:39.622 I/wpa_supplicant(  698): CTRL-EVENT-STATE-CHANGE
id=1 state=0
03-09 09:48:39.622 I/wpa_supplicant(  698): CTRL-EVENT-STATE-CHANGE
id=-1 state=2
03-09 09:48:39.622 V/WifiMonitor(   92): Event [Authentication with
00:0e:a6:f6:1d:3c timed out.]
03-09 09:48:39.622 V/WifiMonitor(   92): Event [CTRL-EVENT-STATE-
CHANGE id=1 state=0]
03-09 09:48:39.622 V/WifiStateTracker(   92): Changing supplicant
state: ASSOCIATING ==> DISCONNECTED
03-09 09:48:39.638 V/WifiMonitor(   92): Event [CTRL-EVENT-STATE-
CHANGE id=-1 state=2]
03-09 09:48:39.638 V/WifiStateTracker(   92): Changing supplicant
state: DISCONNECTED ==> SCANNING
03-09 09:48:40.560 I/wpa_supplicant(  698): CTRL-EVENT-SCAN-RESULTS
Ready
03-09 09:48:40.560 I/wpa_supplicant(  698): Trying to associate with
00:0e:a6:f6:1d:3c (SSID='WL-566gM 2 in C area' freq=2437 MHz)
03-09 09:48:40.560 I/wpa_supplicant(  698): CTRL-EVENT-STATE-CHANGE
id=-1 state=3
03-09 09:48:40.568 V/WifiMonitor(   92): Event [Trying to associate
with 00:0e:a6:f6:1d:3c (SSID='WL-566gM 2 in C area' freq=2437 MHz)]
03-09 09:48:40.568 V/WifiMonitor(   92): Event [CTRL-EVENT-STATE-
CHANGE id=-1 state=3]
03-09 09:48:40.568 V/WifiStateTracker(   92): Changing supplicant
state: SCANNING ==> ASSOCIATING
03-09 09:48:44.626 D/WifiStateTracker(   92): Deconfiguring interface
and stopping DHCP
03-09 09:48:45.628 D/NetworkStateTracker(   92): setDetailed state,
old =DISCONNECTED and new state=DISCONNECTED
03-09 09:48:45.648 D/SettingsWifiEnabler(  241): Received network
state changed to NetworkInfo: type: WIFI[], state: DISCONNECTED/
DISCONNECTED, reason: (unspecified), extra: (none), roaming: false,
failover: false, isAvailable: true
03-09 09:48:50.573 I/wpa_supplicant(  698): Authentication with
00:0e:a6:f6:1d:3c timed out.
03-09 09:48:50.573 I/wpa_supplicant(  698): CTRL-EVENT-STATE-CHANGE
id=1 state=0
03-09 09:48:50.573 I/wpa_supplicant(  698): CTRL-EVENT-STATE-CHANGE
id=-1 state=2
03-09 09:48:50.573 V/WifiMonitor(   92): Event [Authentication with
00:0e:a6:f6:1d:3c timed out.]
03-09 09:48:50.573 V/WifiMonitor(   92): Event [CTRL-EVENT-STATE-
CHANGE id=1 state=0]
03-09 09:48:50.573 V/WifiStateTracker(   92): Changing supplicant
state: ASSOCIATING ==> DISCONNECTED
03-09 09:48:50.578 V/WifiMonitor(   92): Event [CTRL-EVENT-STATE-
CHANGE id=-1 state=2]
03-09 09:48:50.578 V/WifiStateTracker(   92): Changing supplicant
state: DISCONNECTED ==> SCANNING
03-09 09:48:51.498 I/wpa_supplicant(  698): CTRL-EVENT-SCAN-RESULTS
Ready
03-09 09:48:51.498 I/wpa_supplicant(  698): Trying to associate with
00:0e:a6:f6:1d:3c (SSID='WL-566gM 2 in C area' freq=2437 MHz)
03-09 09:48:51.498 I/wpa_supplicant(  698): CTRL-EVENT-STATE-CHANGE
id=-1 state=3
03-09 09:48:51.508 V/WifiMonitor(   92): Event [Trying to associate
with 00:0e:a6:f6:1d:3c (SSID='WL-566gM 2 in C area' freq=2437 MHz)]
03-09 09:48:51.508 V/WifiMonitor(   92): Event [CTRL-EVENT-STATE-
CHANGE id=-1 state=3]
03-09 09:48:51.508 V/WifiStateTracker(   92): Changing supplicant
state: SCANNING ==> ASSOCIATING

-- 

2. Closed WTA: Spica selalu stuck di setup connection saat flashing

Akhirnya berhasil semalam, dengan uninstall pc suite bawaan samsung..
Makasih semua atas sarannya, akhirnya spica saya bisa upgrade le dxjc4 +
root + apps2sd..
Ga nyesel dah bergadang semalaman... :)




coba install ulang drivernya om...
saya kemaren juga gt, ternyata driver yg saya donlot pertama ngaco, padahal
udah berhasil kedetect...
saya donlot ulang punya bro muslih, kemaren langsung jalan :D

2010/4/15 achmad kemal <kemal180...@gmail.com>



-- 
"Indonesian Android Community [id-android]"

3. Creation of a Developer Wanted / Artist Wanted / Services Offered page?

4. Application Launch Animation

5. Stlh upgrade ke DXJC4 internal memory jd 0byte

6. Image is not coming at center of the screen.

7. how to remove/invisible the scroll bar