Same servicein multiple APKs, only want "best one" to launch

by Watcher » Fri, 18 Dec 2009 01:20:49 GMT


Sponsored Links
 Hi,

I have the same service in multiple APKs. In each of the APKs, I am
going to launch the serivce.
Because the APK are difference "applications" that have been installed
& upgraded at various times, the service implementation in each may be
different. I am trying to figure out a way to make sure startService()
runs the implementation that is newest.

I have been fiddling around with PackageManager and Manifest meta-data
and categories but I can't seem to get my head around it. It's really
a leader-election problem... has anyone ever done this ? Any clues ?

Thanks !

--



Other Threads

1. Suggestion for developing news application

I want to develop news application by using android. can anyone
please help me out..?

-- 
Thanks & Warm Regards,
Priya ThamburajReddy

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

2. Threading and Message Loops

Ok, I'm really struggling with what is likely a simple issue. All I
really want to do is have an activity spawn a thread to do a non-
trivial action (for now, just testing with sleep(5000) ). Then, when
that non-trivial action completes,  the thread should notify the
activity, and the activity should present something visual, and
proceed. Simple enough right? I'm trying to use a Handler subclass to
which I send messages using sendMessage(). That handler subclass with
then notify the activity. It all seems to work actually, but then when
the thread completes, android is throwing an unhelpful exception:


05-13 00:58:14.476: ERROR/JavaBinder(1073): *** Uncaught remote
exception!  (Exceptions are not yet supported across processes.)
05-13 00:58:14.476: ERROR/JavaBinder(1073):
android.util.AndroidRuntimeException: { what=1004 when=4149225
arg2=1 } This message is already in use.
05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
android.os.MessageQueue.enqueueMessage(MessageQueue.java:173)
05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
android.os.Handler.sendMessageAtTime(Handler.java:457)
05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
android.os.Handler.sendMessageDelayed(Handler.java:430)
05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
android.os.Handler.sendMessage(Handler.java:367)
05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
android.view.ViewRoot.windowFocusChanged(ViewRoot.java:2421)
05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
android.view.ViewRoot$W.windowFocusChanged(ViewRoot.java:2594)
05-13 00:58:14.476: ERROR/JavaBinder(1073):     at android.view.IWindow
$Stub.onTransact(IWindow.java:166)
05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
android.os.Binder.execTransact(Binder.java:287)
05-13 00:58:14.476: ERROR/JavaBinder(1073):     at
dalvik.system.NativeStart.run(Native Method)

As a seasoned Java developer, running into trouble like this so early
in a new project is frustrating. However, I believe in Android and the
broader Google development platforms, so I'd really like to solve
this, but I think I need the communities help. Even just some sample
code (skeleton apps) that demo some best practices regarding the
threading (such as usage of HandlerThread and Looper) would be a big
help.

Thanks,

Charles
--~--~---------~--~----~------------~-------~--~----~

3. No Pig Fats in Lays | Certificate from Pepsi Pakistan

4. DexClassLoader caould not invoke method from another application properly

5. Screen/Activity orientation

6. Send SMS Message

7. Store prepopulated sqlite database in an app