title: Qt Creator 3.2.1 including .jar for Android
body: <p>Hi all and Sorry in advance for asking this question, but after five days of searching on stackoverflow and doing google-engineering I still got no answer for my question:</p>
  
  <p>I would like to include several *.jar files to my project that shall be used by my android app after Qt compiled it.</p>
  
  <p>Here is my environment:</p>
  
  <ul>
  <li>Installed Qt Creator 3.2.1(exe, not compiled from sources)</li>
  <li>main.cpp (starting Qt-Part)</li>
  <li>android/MainActivity.java (starting simple "Hello world" stuff and shall include different classes provided by the .jars (google-api-client-1.19.0.jar google-api-client-android-1.19.0.jar google-http-client-1.19.0.jar google-http-client-android-1.19.0.jar google-http-client-jackson-1.19.0.jar google-oauth-client-1.19.0.jar jackson-core-asl-1.9.13.jar jsr305-1.3.9.jar)</li>
  <li>android/AndroidManifest.xml</li>
  <li>android/libs containing the required .jars</li>
  </ul>
  
  <p>After googling for that problem, I tried almost everything, getting the same result each time: the .jars are not found for the android application or the build process did not work:</p>
  
  <blockquote>
  <pre><code>[javac] C:\workspaces\qt_android\build-GsQt-Android\android-build\src\com\gservice\MainActivity.java:14: error: package com.google.android.gms.common does not exist
  [javac] import com.google.android.gms.common.ConnectionResult;
  [javac]                                     ^
  [javac] C:\workspaces\qt_android\build-GsQt-Android\android-build\src\com\gservice\MainActivity.java:15: error: package com.google.android.gms.common.api does not exist
  [javac] import com.google.android.gms.common.api.GoogleApiClient;
  [javac]                                         ^\MainActivity.java:15: error: package com.google.android.gms.common.api does not exist
  </code></pre>
  </blockquote>
  
  <p>and so on, for all of the eight jars that shall be included.</p>
  
  <p>Here are the things I tried to include them:</p>
  
  <ul>
  <li>created a folder within android, called "libs" and put my jars into it. After building the project, the folder and the jars have been copied to the build directory. By not to the device as it seems.</li>
  <li>included them as simple other files like the AndroidManifest and the MainActivity: </li>
  </ul>
  
  <blockquote>
  <pre><code>OTHER_FILES += \
  android/libs/google-api-client-1.19.0.jar \
  android/libs/google-api-client-android-1.19.0.jar \
  android/libs/google-api-services-gmail-v1-rev2-1.18.0-rc.jar \
  android/libs/google-http-client-1.19.0.jar \
  android/libs/google-http-client-android-1.19.0.jar \
  android/libs/google-http-client-jackson-1.19.0.jar \
  android/libs/google-oauth-client-1.19.0.jar \
  android/libs/jackson-core-asl-1.9.13.jar \
  android/libs/jsr305-1.3.9.jar \
  android/AndroidManifest.xml \
  android/src/com/gservice/MainActivity.java \
  </code></pre>
  </blockquote>
  
  <ul>
  <li>trying the assets-inclusion in the .pro file: </li>
  </ul>
  
  <blockquote>
  <pre><code>LIBS_INSTALL_PATH=/assets/libs
  </code></pre>
    
    <p>libraries.path=android/libs
    libraries.files += google-api-client-1.19.0.jar google-api-client-android-1.19.0.jar google-http-client-1.19.0.jar google-http-client-android-1.19.0.jar google-http-client-jackson-1.19.0.jar google-oauth-client-1.19.0.jar jackson-core-asl-1.9.13.jar jsr305-1.3.9.jar
    libraries.depends += FORCE
    INSTALLS += libraries</p>
  </blockquote>
  
  <ul>
  <li>creating a libraries.qrc file and include this via RESOURCES += libraries.qrc  in the .pro file. libraries.qrc:</li>
  </ul>
  
  <blockquote>
  <pre><code>&lt;RCC&gt;
  &lt;qresource prefix="/libs"&gt;
      &lt;file&gt;android/libs/google-api-client-1.19.0.jar&lt;/file&gt;
      &lt;file&gt;android/libs/google-api-client-android-1.19.0.jar&lt;/file&gt;
      &lt;file&gt;android/libs/google-api-services-gmail-v1-rev2-1.18.0-rc.jar&lt;/file&gt;
      &lt;file&gt;android/libs/google-http-client-1.19.0.jar&lt;/file&gt;
      &lt;file&gt;android/libs/google-http-client-android-1.19.0.jar&lt;/file&gt;
      &lt;file&gt;android/libs/google-http-client-jackson-1.19.0.jar&lt;/file&gt;
      &lt;file&gt;android/libs/google-oauth-client-1.19.0.jar&lt;/file&gt;
      &lt;file&gt;android/libs/jackson-core-asl-1.9.13.jar&lt;/file&gt;
      &lt;file&gt;android/libs/jsr305-1.3.9.jar&lt;/file&gt;
  &lt;/qresource&gt;
  &lt;/RCC&gt;
  </code></pre>
  </blockquote>
  
  <ul>
  <li>trying with qmake (which returns an error, that rcc file's not found) <code>"rcc -binary google-api-client-1.19.0.jar -o google-api-client-1.19.0.rcc"</code> as additional parameter</li>
  </ul>
  
  <p>... I really do not know what to do next, all of my Android-configurations (JDK, SDK, NDK, Ant) are at the correct place and are accessable, JAVA_HOME var and ANT var are set.</p>
  
  <p>Two scentences at the end: the code I want to include for Android is a Google+ authentication app I already created with the Android ADT and that works fine. I shall transfer that working components into the build environment of Qt.</p>
  
  <p>Thanks in advance for reading that looooong description and for helping me getting that solved!</p>
  
  <p>Loyd</p>