Oh wait if what is being talked about is having the same content provider in multiple applications, that is completely the wrong approach. For a given authority there must be one and only one content provider implementation, living in a single specific .apk.
On Thu, Jan 8, 2009 at 11:03 AM, Peli <[email protected]> wrote: > > Hm, I think you end up with unnecessary code duplication if you > include your component / content provider in every application. > > I think it would be better if every application that wants to use your > component shows a small dialog "You need to install the following > component..." with a button that brings you to the download page of > the Market for your component. There are various ways when to show > this dialog box (catch the ActivityNotFoundException if you try to > launch an activity of your component, or use the PackageManager to > check if a desired component exists to handle the request). > > At OpenIntents we try to resolve dependencies as late as possible - > i.e. not at installation time, but the first time the user actually > wants to use a particular feature (they may never use it in which case > there is no need to install it). > > I think in the long run Market should have better tools for resolving > compulsory dependencies automatically, but for the moment I think this > is a good compromise for developers and end users. > > Peli > www.openintents.org > www.openintents.biz > > > On Jan 8, 4:18 pm, whitemice <[email protected]> wrote: > > I've blogged this question with pictures here:http://tinyurl.com/9hwdva > > > > 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 "WARN/ > > PackageManager: Skipping provider name xxxx name already used" error > > 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. > > > > Questions: > > - Does anyone have any suggestions on how to better handle this > > situation? > > - 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 > > issue? > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" 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-developers?hl=en -~----------~----~----~----~------~----~------~--~---

