I've just followed exactly what was said in this tutorial and ran the command
/usr/local/google_appengine/endpointscfg.py get_client_lib java -bs gradle helloworld_api.NewsApi
I know my NewsApi service works, I've tested it on the Google APIs explorer.
I get a success message: API client library written to ./getNews-v1.zip
I extracted the zip and found the following files inside the folder (getNews):
No JAR file exists!! What do I use to set up the library in my Android client?
Any ideas? Thanks!
If you want a sources JAR and included dependencies to include in your project use '-bs default' or simply omit that option. Using '-bs gradle' or '-bs maven' assumes you are going to use one of those build tools to build a classes JAR yourself. The 'endpointscfg.py' of course won't compile sources to class files for you as it doesn't have knowledge of any Java environment.
More info in the docs:
https://cloud.google.com/appengine/docs/python/endpoints/endpoints_tool
Related
EDIT:
When I use the response of How to manually include external aar package using new Gradle Android Build System I have an error.
BASE:
I never use AAR file, with the release of Android Studio we can use it.
But I don't find any explanation to use it.
Do you know how to use it?
It's necessary to make some things like ask for the permissions or create the dependencies?
Thanks
AAR format is a jar file containing a compiled Android Library project. Here's some info on what is inside an AAR file
What this means for app developers is that instead of (the old way):
Downloading the source code of a library project
Building it in eclipse
Setting your application project to depend on the local library project
You can instead add the dependency specification to your project/app/build.gradle's dependencies block: compile 'fr.baloomba:viewpagerindicator:2.4.2'
Then gradle (on the next build) searches for the aar file in a central binary repository, downloads the library and allows you to use it's functionality in your project. ( ex: http://search.maven.org/remotecontent?filepath=fr/baloomba/viewpagerindicator/2.4.2/viewpagerindicator-2.4.2.aar )
You can also search the central repository's web interface for libraries to depend on. Once you've clicked on a library to add to the project, click "Gradle/Grails" under "Dependency Information" to copy the line to add to build.gradle.
In my opinion this is a huge improvement.
You don't need to add any permissions to the app, either way, adding a Library project dependency is a compile time thing, not runtime or user-facing.
I am working on an android project working in Android Studio (0.5.3).
I have created two endpoint api classes (called UserEndpoint and OfferEndpoint) in the backend part of the project. Then I wanted to create the client libraries to use in the app part of the project. I use the gradlew appengineEndpointsInstallClientLibs command for this. In the /build/client-libs part it did create the .zip files of the client libraries. But it did not install them in the app part of the project.
So now my question:
Is the command I am using (gradlew appengineEndpointsInstallClientLibs) supposed to also install them in the app part, and if yes what could be the reason it is not working for me (there seem to be no errors).
This tutorial mentions that I have to manually add the libraries. I added the .zip files to the /libs folder, but there is no 'add as library' option as the tutorial mentions. Is this the correct way of doing this? And if yes could someone give me a little more in detail explanation because I tried some things by adding the dependency in the build.gradle file but nothing seems to work.
Thanks in advance!
By default, if you don't use #ApiNamespace, the namespace that is used
is the reverse of your-project-id.appspot.com. That is, the package
path will be com.appspot.your-project-id.yourApi.
Source
The annotation was missing in the #Api annotations of the endpoints.
I am creating a backend GAE project with Cloud Endpoints. I want also to create an Android application that will consume these endpoints, and I found in the documentation here that I have to copy the java source classes to my Android project to access to the endpoints. I really don't like this approach thinking in the case that I am developing the endpoints for a external client (I don't want to give them my source code, I prefer just give them a jar library to avoid complexity).
I found reading the README file also generated with the endpoints that The generated service-specific library can be found in the top level directory
of the zip file:
google-api-services-noteendpoint-v1-rev20130920182043-1.16.0-rc.jar. But this jar is not generated anymore.
So, copying the source classes is the only way to pass the access to the endpoint to the Android project? Where is this jar that once was supposed to be created?
Thanks so much.
Ok, I found the answer, the jar is not generated but can be generated by maven. The endpoints created has maven structure and you only have to package it to get the final jar. Tested and working.
On eclipse, with Google plugin, clicking on the appengine project you can select:
Google->Generate Cloud Endpoint Client Library, you need to have an associated android project. You can create a android associated project, selecting, when creating a new project: AppEngine Connected Android Project.
Hello i'm using JNA to be able to use an external .dll(i don't have the header file but i have documentation thus the exposed function signatures).
I have managed to use my dll in a java project following the instructions here and now i'm trying to use the same thing on an android app.
I imporetd the jna jar in my libs and also added the jar in my buildpath and i'm getting an error
The library 'jna-3.5.1.jar' contains native libraries that will not run on the device.
The following libraries were found:
com/sun/jna/linux-amd64/libjnidispatch.so
com/sun/jna/darwin/libjnidispatch.jnilib
com/sun/jna/linux-i386/libjnidispatch.so
com/sun/jna/sunos-x86/libjnidispatch.so
com/sun/jna/sunos-amd64/libjnidispatch.so
com/sun/jna/sunos-sparc/libjnidispatch.so
com/sun/jna/sunos-sparcv9/libjnidispatch.so
Any ideas?
This deserves an answer...
Did you compile the lib you wanna use for android?
Why not write a JNI wrapper around those native libs, and invoke that from your android app?
Browse your jna.jar and delete the files displayed on your message :
com/sun/jna/linux-amd64/libjnidispatch.so
com/sun/jna/darwin/libjnidispatch.jnilib
com/sun/jna/linux-i386/libjnidispatch.so
com/sun/jna/sunos-x86/libjnidispatch.so
com/sun/jna/sunos-amd64/libjnidispatch.so
com/sun/jna/sunos-sparc/libjnidispatch.so
com/sun/jna/sunos-sparcv9/libjnidispatch.so
Then maybe you need to restart your IDE and that should work.
I would like to integrate my app with a variety of file storage services. I followed the quickstart instructions for the Drive sdk, which adds a bunch of jars to my projects libs directory. Additionally, the Dropbox sdk requires the following list of jars:
commons-logging-1.1.1.jar
dropbox-android-sdk-1.5.3.jar
httpclient-4.0.3.jar
httpcore-4.0.1.jar
httpmime-4.0.3.jar
json-simple-1.1.jar
Once all of these are added to my project, I get the following error when I try to run:
Dex Loader] Unable to execute dex: Multiple dex files define
Lorg/apache/http/entity/mime/FormBodyPart;
If I remove the httpmime jar added for Dropbox, my project runs fine. But is this a safe way to resolve the conflict? Is there an alternative method with which I can build my project and include all the required jars?
Assuming no version conflicts this would work fine. Compare the httpmime-4.0.3.jar to the httpmime jar that Drive added to your libs directory. If they're the same, then it's fine. If they're different, then you'll have to find out the differences between the two and insure that they're not breaking changes. As a last resort you could also repackage one of the SDKs with its required version of httpmime in a jar selectively obfuscated with ProGuard, though that's a hassle.
If you are developing with Eclipse, consider using Google Plugin for Eclipse. It provides a way to add any of the Google's SDK to your app. All the jars are added automatically.