-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate translate = TranslateOptions.newBuilder().setApiKey(MY_API_KEY).build().getService(); Sometimes Takes Very Long time #603
Comments
Totally agree with you. 3 minutes is unacceptable. Shouldn't you create the Where are you running this? I'll try to get you an answer, but this really should be a question for StackOverflow NOTE - You might wish to invalidate your ApiKey, and just change to xxxx when posting in the future. |
Ah, found your SO Question and that your running on Android, so my comment is moot, though you might still wish to run a cloud service that initializates Translate and just request from that. |
I'm sorry to say that if you look at the bottom of google-cloud-java, you note that "Android is not supported" for these libraries currently. |
You might wish to use the REST interface instead. |
How is it not supported on Android? I am using it in my production app right now and it translates messages good. It just takes a long time to initialize sometimes. I am initializing it in my Application class. |
The engineering team hasn't had a chance to validate or optimize the library on Android so they asked that a warning be posted. I'm a bit surprised that it works at all -- there are files you might wish to change for Android such as excluding netty-borring-ssl-native and following the suggestion for TLS on Android. You might also wish to look at these examples. But as I said, we aren't testing on Android currently, so you are on your own. My apologies. That said, you will likely find that implementing with REST will produce a much smaller app and a much faster one. @GoogleCloudPlatform/gcloud FYI |
Will the team resume work? Is this library likely to stop working soon? Is it critical for me to transfer to REST API because I am actually happy with the performance right now. |
There aren't any plans to break things. (and you can stay on a working version anyway) It's just surprising that it works on Android at all. REST might be the way to fix your 20% startup issues. (but I don't know the root cause). That's why I suggested it. Otherwise, it's really up to you. |
I appreciate your replies. My issue is never present the first time somebody opens my app. However, whenever somebody exits my app by pushing the back button, I call |
Ah - it sounds like the shutdown threads are left in a strange state. Take a look at this which suggests I haven't written an Android app in several years, so I'm probably not thinking through everything. In the past, I've found this book to be invaluable.
|
🤖 I have created a release \*beep\* \*boop\* --- ### [0.121.5](https://www.github.com/googleapis/java-errorreporting/compare/v0.121.4...v0.121.5) (2021-08-02) ### Dependencies * update dependency com.google.cloud:google-cloud-core to v1.96.0 ([#603](https://www.github.com/googleapis/java-errorreporting/issues/603)) ([cf5a107](https://www.github.com/googleapis/java-errorreporting/commit/cf5a107afbd7e4d808f7577548c146262c4b2e84)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release \*beep\* \*boop\* --- ### [0.121.5](https://www.github.com/googleapis/java-errorreporting/compare/v0.121.4...v0.121.5) (2021-08-02) ### Dependencies * update dependency com.google.cloud:google-cloud-core to v1.96.0 ([#603](https://www.github.com/googleapis/java-errorreporting/issues/603)) ([cf5a107](https://www.github.com/googleapis/java-errorreporting/commit/cf5a107afbd7e4d808f7577548c146262c4b2e84)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release \*beep\* \*boop\* --- ### [0.121.5](https://www.github.com/googleapis/java-errorreporting/compare/v0.121.4...v0.121.5) (2021-08-02) ### Dependencies * update dependency com.google.cloud:google-cloud-core to v1.96.0 ([#603](https://www.github.com/googleapis/java-errorreporting/issues/603)) ([cf5a107](https://www.github.com/googleapis/java-errorreporting/commit/cf5a107afbd7e4d808f7577548c146262c4b2e84)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
In my Main Activity, I initialize the Translate variable. If you look at the logs: I track when the initialization starts and when it finishes. Most of the time it initializes quick. But 1/5 times it takes up to 30 seconds to 3 minutes (UNACCEPTABLE).
I also have the latest versions in gradle:
The text was updated successfully, but these errors were encountered: