本文将带您了解关于如何在我的Android应用中使用Google翻译Api的新内容,同时我们还将为您解释安卓谷歌翻译插件的相关知识,另外,我们还将为您提供关于android–如何使用Google图表A
本文将带您了解关于如何在我的Android应用中使用Google翻译Api的新内容,同时我们还将为您解释安卓谷歌翻译插件的相关知识,另外,我们还将为您提供关于android – 如何使用Google图表API、android – 我可以在我的应用中使用Google Places意图吗?、android应用如何调用google的地图语音导航、Android应用:使用Google ID登录?的实用信息。
本文目录一览:- 如何在我的Android应用中使用Google翻译Api(安卓谷歌翻译插件)
- android – 如何使用Google图表API
- android – 我可以在我的应用中使用Google Places意图吗?
- android应用如何调用google的地图语音导航
- Android应用:使用Google ID登录?
如何在我的Android应用中使用Google翻译Api(安卓谷歌翻译插件)
我正在制作一个用于语言实时翻译的android应用…我使用了识别器意图从用户那里获取语音输入,然后它给出了用户所说的选项列表。现在我想使用google将其翻译为另一种语言翻译api,但我不知道如何使用它。到目前为止,我所做的代码是。此外,如果您能告诉我如何做到这一点,而不是给我我所说的内容的选择,它会自行选择一个,然后在此上使用google
translation api…。
package com.example.testing;import java.util.ArrayList;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.speech.RecognizerIntent;import android.view.View;import android.view.View.OnClickListener;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.ListView;public class Voice extends Activity implements OnClickListener{ ListView lv; static final int check=1111; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.voice); lv=(ListView)findViewById(R.id.lvVoiceReturn); Button b=(Button)findViewById(R.id.bVoice); b.setOnClickListener(this); } @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent i=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); i.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak Up"); startActivityForResult(i, check); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub if(requestCode == check && resultCode==RESULT_OK){ ArrayList<String> results=data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,results)); } super.onActivityResult(requestCode, resultCode, data); }}
答案1
小编典典这是https://developers.google.com/translate/的文档
另外,请参考这个示范项目在同一
必应还提供了翻译API
查看此 Google翻译API示例。
希望这可以帮助。
android – 如何使用Google图表API
我如何在Android应用程序中使用此图表?
这是我的代码
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String url = "http://chart.apis.google.com/chart?cht=p3&chs=500x200&chd=e:TNTNTNGa&chts=000000,16&chtt=A+Better+Web&chl=Hello|Hi|anas|Explorer&chco=FF5533,335423&chdl=Apple|Mozilla|Google|Microsoft"; WebView mCharView = (WebView) findViewById(R.id.char_view); mCharView.loadUrl(url); }
和XML
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <WebView android:id="@+id/char_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="visible"/> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout>
解决方法
webview.loadUrl(CHART_URL);
添加到您的清单
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
但如果您正在寻找如何在Android中绘制饼图,您可以看到这个tutorial附有示例代码
android – 我可以在我的应用中使用Google Places意图吗?
目前我只是使用搜索API来获取地址的路线.不是最优雅的解决方案:(
谢谢
解决方法
有关如何开始活动的示例,请查看Open another application from your own (intent)
android应用如何调用google的地图语音导航
RT
android应用如何调用google的地图语音导航
Android应用:使用Google ID登录?
我正在创建一个需要您注册和登录的Android应用程序.
现在我在想,为什么要注册并登录?是不是可以使用设备上已有的Google帐户自动登录?就像你如何使用你的谷歌帐户登录堆栈溢出?
所以我的问题是:这可能吗,怎么样?
谢谢!
解决方法
如果您愿意,您甚至可以从这一点访问他们的一些Google Apps数据.
关于如何在我的Android应用中使用Google翻译Api和安卓谷歌翻译插件的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于android – 如何使用Google图表API、android – 我可以在我的应用中使用Google Places意图吗?、android应用如何调用google的地图语音导航、Android应用:使用Google ID登录?的相关知识,请在本站寻找。
本文标签: