![]() ![]() Here is an approach that works with the current version of google translate and will likely keep working with future updates (as long as the package name stays the same): if (_INT >= Build.VERSION_CODES. The Google Translate activity names tend to change over time which makes the code fragile if you hardcode them. I.putExtra("key_from_floating_window", false) The simplest way to use the app is to type or copy text into its textbox. It does make use of online services, but even if you’re without Internet access, the app can still translate between more than 50 languages. I.putExtra("key_suggest_translation", "") Google Translate is the official Google translation app, and it lets you translate between more than 100 languages. In your project-level adle file, make sure to include Googles Maven repository in both your buildscript and allprojects sections. Play around with the sample app to see an example usage of this API. ML Kit can translation between more than 50 languages. I.putExtra("key_text_input", "Me gusta la cerveza") You can use ML Kit to translate text between languages. So my final version, including hard-coded translation from Spanish to English, is: Intent i = new Intent() The difference is that "translation" has been added before "TranslateActivity" However it didn't work initially for me and after investigating the Translate apk, it looks like they've modified their file structure slightly, so the intent ComponentName should now be: i.setComponent( Phi Van Ngoc's answer was fantastic, thanks for that.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |