Android Bug/Architectural Issue: How do I handle multiple versions of my own Content Provider?

by whitemice » Thu, 08 Jan 2009 23:18:16 GMT

Sponsored Links
 Ie blogged this question with pictures here: 

I am writing a component that makes certain functionality available to
any application running on an Android device (e.g. an advertising
service, stock ticker cache, Snowball server, etc).

This functionality is useful for application developers, but not
interesting to actual users i.e. my component should be included as
part of a new application, but not require the end user to explicitly
install the additional component themselves.

I expect that over time multiple applications installed on the phone
will want to communicate with my component.  As each new application
will have a different certificate, I want to communicate between
applications using an Android Content Provider.  To save resources on
the device (networking, caching, etc) only one instance of my
component should be appointed to handle all queries.

This works well as Android only registers the first Content Provider
for a given URI and then ignores the rest (throwing an ARN/
PackageManager: Skipping provider name xxxx name already usederror
each time a new one is installed).

However if the registered Content Provider is uninstalled, it will
immediately break all the other applications that rely on it, even
though other instances of the component still exist.

- Does anyone have any suggestions on how to better handle this
- If I could reregister Content Providers I could handle situations
like this, and upgrade components when newer versions are installed.
Perhaps the Android OS could also handle this situation better, by
tracking Content Provider naming collisions?
- Should I be looking at other communication methods to solve this


Other Threads

1. testing my app

 I want to make an app that will react to a phone call. How do I test
this? ie how do I simulate incoming calls?


2. accessing the phone number of an incoming call..

Is it possible to get the phone number of an incoming call that is
currently ringing?


3. Re-use already existing code on the android platform

4. Request for comment on Activity flow design

5. Should I use AlarmManager or ScheduledExecutorService? (pros/cons?)

6. Application Development and Consulting Needed

7. Android Specialists