How to check for existence of 3rd party library during installation?

by Shivakumar T » Thu, 07 Oct 2010 07:05:25 GMT

Sponsored Links

If my app is dependent on a 3rd party library, say chartdroid 
<> ;. Is there a way to check this 
dependency during installation time and redirect the user to install the 
dependency before continuing to install my app.

I ask this because while installing one Google app (I think Google 
translate) it asked me to install TTS before continuing to install.

Thank in Advance.

Best regards


How to check for existence of 3rd party library during installation?

by Mark Murphy » Thu, 07 Oct 2010 07:10:21 GMT


I am assuming your "3rd party library" is in the form of a separate
application. In that case, you can use PackageManager to see if it is
installed. However, you cannot do this during installation -- only
when your application is run by the user.

If by "3rd party library" you mean a JAR, that will be bundled in your
application automatically, and so it cannot be missing at installation

Mark Murphy (a Commons Guy)  |  | 

_Android Programming Tutorials_ Version 3.0.1 Available!


Sponsored Links

How to check for existence of 3rd party library during installation?

by Kumar Bibek » Thu, 07 Oct 2010 13:46:50 GMT

 Yes you can. Query the package manager.


Other Threads

1. Add a third-party to the emulator ?

Hi everybody,

I'm delevelopping a litle application that use that facebook library

it's a .jar that i have added in my project.

i have added that line too in the manifest:
<uses-library android:name="com.restfb" />

It build everything ok, but the apk fail to install..
[2010-10-16 14:09:08 - tt22] Installing tt22.apk...
[2010-10-16 14:09:30 - tt22] Installation error:

10-16 12:09:29.767: ERROR/PackageManager(58): Packagexxxx requires
unavailable shared library com.restfb; failing!
10-16 12:09:29.777: WARN/PackageManager(58): Package couldn't be
installed in /xx/xx/xx.apk

so... the virtual device doesn't know where the lib is...

Is there any solution to that?



2. Android Tablet (2.2) Recommendations for Development


No need for 3G. Do you plan OpenGL dev? If no, what's wrong with
simulator? It works quite fine for what you plan to do.


3. Message not getting posted

4. how to get device orientation at runtime

5. 绛斿: How to connect to a remote MySQL DB without webservices... ?

6. MapView in android emulator white screen

7. re-prompt user to choose default activity