Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle APIs Client Library for Java (google-api-java-client) -- Maven vs. Importing JARs
    text
    copied!<p>I've started work on an Android App that will work with Google Docs.</p> <p><strong>UPDATE 12/9:</strong> From the information I've come across, it seems Google Docs is not supported by this library. The question is probably still relevant in general, but seem not specifically for this project as I can't use the library anyway.</p> <p>I was doing some research and come across the <strong>Google APIs Client Library for Java</strong></p> <p>I decided to start with the <strong>tasks-android-sample</strong> to begin learning how to utilize this library.</p> <p>I followed <a href="http://samples.google-api-java-client.googlecode.com/hg/tasks-android-sample/instructions.html" rel="nofollow">these instructions</a></p> <p>I successfully installed <strong>Mercurial</strong> and <strong>Maven</strong> and already had <strong>Java 7</strong> installed.</p> <p>I was able to execute these commands</p> <pre><code>cd [someDirectory] hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client-samples cd google-api-java-client-samples/shared/shared-sample-android [editor] src/main/java/com/google/api/services/samples/shared/android/ClientCredentials.java mvn source:jar install </code></pre> <p>I was also successful in setting up the <strong>Mercurial plugin</strong> <em>(not sure what this did for me -- I believe the hg command above is the only time <strong>Mercurial</strong> was involved)</em> and <strong>Maven plugin</strong></p> <p>Finally, I was able to imported the <strong><em>tasks-android-sample</em></strong>, compile it, run it on the emulator and I was able to see the tasks I created on my google account.</p> <hr> <p>I then repeated the process, except this time I simply imported sample's source code and the required JARs into a new Android project and added the <em>ClientCredentials.java</em> manually to the project (So I could specify my Google API Key).</p> <p>I was also able to compile and run this project and it operated as expected.</p> <p>My questions in all this is which method is preferred? Or is it a personal choice? Are there benefits to using <strong>Maven</strong> that I'm not realizing at this time?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload