SendGrid API for Android using Java - java

Upon deep research, I was unable to integrate and send emails from SendGrid in the Android Application. SendGrid has Java API for sending emails but adding the dependency in Android Studio throws errors when a build is made. Also, there was a library by Dany Santiyago in GitHub but sadly it doesn't work too. It throws an error saying
More than one file was found with OS independent path 'META-INF/LICENSE'
I followed the guidelines in the question in Stack Overflow but again a new error came saying unable to merge dex. Please suggest a way to integrate SendGrid to the Android Application.

There is no perfect workaround as SendGrid doesn't have an Android API or SDK.

I found this on github : https://github.com/thinkingserious/sendgrid-android-example
The code is not production ready but I am using this in my Android app and it works fine. Leaving this here, for anyone for future reference.

Related

DropBox in Android Application

I am pretty new to Android and am trying to have my android app to have access to the Dropbox on the same phone. I would want to have the authorization happen on the first activity that shows up on my app.
I've tried looking at the DropBox API information on their developers site but they don't have any details on how to implement authorization (just on how to loop through files etc..not that helpful)
I have tried looking here at: https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L22
But I can't even have FileThumbnailRequestHandler.java class compile since Picasso.LoadedFrom.NETWORK returns a LoadedFrom and not an integer.
I'm pretty stuck and theres not a lot of documentation online on how to implement so help would be VERYYYYY appreciated!
To use Dropbox API v2 in Android, we recommend you use the official Dropbox API v2 Java SDK:
https://github.com/dropbox/dropbox-sdk-java
There isn't a step by step tutorial for that in particular, but there's an example Android app that uses it included with the SDK, with instructions for running it:
https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android
Though, it's probably easier to just install a released version of the Dropbox SDK rather than compile it locally, as long as you don't need to make changes to the Dropbox SDK. That is, in build.gradle, replace:
implementation group: 'com.dropbox.core', name: 'dropbox-core-sdk', version: '0-SNAPSHOT', changing: true
with:
implementation 'com.dropbox.core:dropbox-core-sdk:3.1.3'
You should refer to that example app as an example of how to implement the app authorization flow, which is accomplished via OAuth 2.
Your AndroidManifest.xml should be set up as shown here:
https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/AndroidManifest.xml#L33
You start the flow by calling startOAuth2Authentication as shown here:
https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/UserActivity.java#L34
You complete the flow by calling getOAuth2Token as shown here:
https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L22
Your app can store and re-use the resulting access token for that user, as the example does here:
https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L25
Make sure you follow the instructions for installing the SDK. Gradle or Maven should automatically install the right versions of the dependencies for you. I just tried it and it worked for me. That is, I didn't get the Picasso compilation error you mentioned, so I suspect you have a different version of the dependency installed.

APIException 9011 and 9010 error in Places SDK

I am new to Android Development and I am learning Maps SDK for Android.
My API key for Maps SDK is working fine and I am able to see Map on my screen with a marker.
But the problem is, I am not able to use the Place Autocomplete service and facing the following two errors:
APIException code 9011
APIException code 9010
Here my Places SDK is not working though I have enabled it while creating API Key. I have searched about these two errors but yet I am unable to find the reason for the above-mentioned errors. Sorry for using bad English, please tell me the reason why it's happening with me.
These are the errors you are getting:
https://developers.google.com/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesStatusCodes#public-static-final-int-over_query_limit
and
https://developers.google.com/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesStatusCodes#public-static-final-int-request_denied
Make sure you are using the newest Places SDK client and that you are have enabled the Places API.
https://developers.google.com/places/android-sdk/client-migration
You can check these above mentioned APIException codes at link. After that Ensure that your Places SDK is turned on. But places SDK will only work if you have attached your credit card to the Google Maps account. that's all.

Implementing Clarifai API

I need some help with connecting hte Clarifai API into my android app. It's for a uni project where we tests different image recognition softwares. All it needs to do is take a picture on the phone and then run recognition on the pituces (which will be buildings).
I have no idea how to do this which is why i'm throwing this hail mary in the hope that someone would help me. I've put what i have in a drive here: https://drive.google.com/drive/folders/1LH79C0JtpBBpAMdKqNjKfYfj3KTvLgAh?usp=sharing
How can I solve this?
To use the Clarifai API on Android, you should use the Clarifai API Java client. Alternatively, if you wish not to install the library, you can do REST and execute HTTP requests directly using JSON. See the developer's guide for examples.
Note: There's also an Android SDK in works, which is beta at the time of this writing. See here on how to join the beta program.

How can I get the newest version of google play services on an AVD?

I'm trying to develop an Android app that has a native Google Maps control. Seems simple enough, but unfortunately I've run into a lot of trouble setting it up.
I have very carefully followed the instructions here multiple times with no success. Every time I try to load up my app, I get the message <my app> won't run without Google Play services, which are not supported by your device. I have confirmed in the settings that I do in fact have Google Play services on the device.
I have tried to uninstall and reinstall downloaded google services apk's, but abd does not allow me to uninstall it with the error DELETE_FAILED_INTERNAL_ERROR, I assume it is because I don't have root access.
You need to update your SDK and install the latest Google Play Services library under "Extras" section. The AVD can be launched using "android" binary under your SDK tools folder.
So I found the answer to my own question. I made a dumb mistake...
In my manifest, I entered my api key where it says API_KEY: android:name="com.google.android.geo.API_KEY but it should just be API_KEY. Changing this, and using Google Play services 9 instead of 10 fixed it.

Java Google Speech Recognition API

I developed a Java Application that used Google Speech Recognition, but from few days/weeks ago it doesn't work, i'm receiving this message.
java.io.IOException: Server returned HTTP response code: 403
I saw a little bit information about what is happening in this Post.
After that, i registered in https://console.developers.google.com and then i'm trying to use the following URL and i'm having the same response.
https://www.google.com/speech-api/v2/recognize?output=json&lang=es-EN&key=MY_KEY
Furthermore, in the console developers i'm not seeing in any place some API that it's called speech recognition or similar :(
Anybody has a solution? Thanks
Google shutdown the V1 API. Luckily, there is handy unofficial Java implementation for the new v2 version located here.
A key is required to get it working. You need to also subscribe to the chromium developers newsletter to be able to see the option for that key. Full instructions are included on the wiki of the project.

Categories