Вопрос

Is it possible to use the older GData Apis and the newer google-apis-java-client libraries in the same app? Reason I ask is I am using the new client libraries for accessing spreadsheets in google docs. I would also like to access picasa to upload and download pics. For the life of me I can not get this working with the new libraries and there is not a sample code for it. However there is a sample code for the older GData libs. The problem with using both is they use the some of the same libs, but different versions. This is on Android.

Это было полезно?

Решение

It is possible, but you're right there are some conflicts due to the Guava library (ex Google Collections).

We use Maven to manage our dependencies. Here is the repository we use for GData libs :

    <repository>
        <id>burtsev-net-maven</id>
        <name>Burtsev.Net Maven Repository</name>
        <url>http://maven.burtsev.net</url>
    </repository>

And here are the dependencies we use that play nice together, GData 1.47.1 and Google API 1.17.0 :

    <dependency>
        <groupId>com.google.gdata.gdata-java-client</groupId>
        <artifactId>gdata-docs-3.0</artifactId>
        <version>1.47.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.gdata.gdata-java-client</groupId>
        <artifactId>gdata-docs-meta-3.0</artifactId>
        <version>1.47.1</version>
    </dependency>
            <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-admin</artifactId>
        <version>directory_v1-rev15-1.16.0-rc</version>
    </dependency>
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-drive</artifactId>
        <version>v2-rev105-1.17.0-rc</version>
    </dependency>
    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client-gson</artifactId>
        <version>1.17.0-rc</version>
    </dependency>
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-storage</artifactId>
        <version>v1beta2-rev36-1.17.0-rc</version>
    </dependency>
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-bigquery</artifactId>
        <version>v2-rev125-1.17.0-rc</version>
    </dependency>
    <dependency>
        <groupId>com.google.oauth-client</groupId>
        <artifactId>google-oauth-client</artifactId>
        <version>1.17.0-rc</version>
    </dependency>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top