Ir al contenido principal

Entradas

Mostrando las entradas etiquetadas como Java

Use Microsoft Cognitive Services Translate API in Android using Java

I recently implemented the MS Cognitive Services Translate API for Wordee . I switched to it after trying Google Translate API and I did that for two reasons: Microsoft's API is better documented. Google's API costs twice the MS's API. Now, it was difficult to find a complete tutorial / example of how to implement the MS REST API in Android using Java, so I decided to share the first (and simplest, but flexible) version of that implementation. The application I uploaded to illustrate the example consists of a Spinner to select the target language,  an EditText to enter the text you want to translate, a Button to perform the translation request and a TextView to show the translated text. The API automatically detects the source language . This example is fully functional, you only need to provide a valid API key. There are also two important things to clarify in this example. First, we saved the languages in a JSON file, that we have to retrieve and parse i...

Firebase Auth error login

I'm studying a Android-Java developer course, and we are designing an application that uses Email and Password login. So when we enter the correct email and password a Toast will show up saying "Successful sign in!", the opposite will be "Failed to sign in!". The problem was that I was always getting a "Failed to sign in!" and I knew my email and password were correct. I didn't get any error in the Logcat , only some weird line from getGoogleApiForMethod. So I just came up with this marvelous idea: "Just add an exception log to your f*** code!" And so I did. I added a Log. e ( TAG , "Failed because of: " + task.getException().getMessage()) ; after my !task.isSuccessful() And then I discovered the following: An internal error has occurred. [ Identity Toolkit API has not been used in project BLAHBLAH before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/identityt...