Android应用程序无法获取连接工厂客户端 [英] android app Couldn't get connection factory client

查看:114
本文介绍了Android应用程序无法获取连接工厂客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发Android应用程序,并使用MapActivity谷歌地图。但是我得到错误不可能获得连接工厂的客户。我探索了几个线程这个错误,但是想不出得到任何令人满意的答案。这里是我的code:

I am developing app for android and using MapActivity for google maps. But I am getting Error "Couldnt get connection factory client" . I explored several threads for this error, but couldnt get any satisfying answer. Here is my code:

的Manifest.xml

Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="wsu.cs558.roadmonitoring.view"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="10"
    android:targetSdkVersion="17" />

<!--
      <permission
        android:name="wsu.cs558.roadmonitoring.view.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>
-->

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- <uses-permission android:name="wsu.cs558.roadmonitoring.view.permission.MAPS_RECEIVE"/> -->

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MapViewActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <uses-library android:name="com.google.android.maps" />

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyCyT7IoMyt5iqRAd2mhO2m50dBecCc59YI" />
</application>

main.xml中

<RelativeLayout 
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical" 
 android:layout_width="fill_parent"
 android:layout_height="fill_parent">

 <com.google.android.maps.MapView
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/map_view"
 android:layout_width="fill_parent" 
 android:layout_height="fill_parent"
 android:clickable="true" 
  android:enabled="true" 
  android:apiKey="AIzaSyCyT7IoMyt5iqRAd2mhO2m50dBecCc59YI" />

 </RelativeLayout>

MapViewActivity.java

MapViewActivity.java

  package wsu.cs558.roadmonitoring.view;

 public class MapViewActivity extends MapActivity {

private MapView mapView;
private static final int latitudeE6 = 37985339;
private static final int longitudeE6 = 23716735;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    mapView = (MapView) findViewById(R.id.map_view);
    mapView.setBuiltInZoomControls(true);




}


@Override
protected boolean isRouteDisplayed() {
    // TODO Auto-generated method stub
    return false;
}

}

我得到了同样的错误,当我在模拟器中使用,所以现在我用我的移动设备上运行的应用程序。我得到同样的错误。我使用谷歌API(2.3.3),用于构建目标。 plz帮助。

I got the same error when I used in Emulator, so now I am using my mobile Device to run the app. I get same error. I am using Google API (2.3.3) for build target. Plz help.

推荐答案

好吧,我得到了自己的答案。但我真的不得不挖了很多。问题是,因为谷歌地图API版本。我已经使用了code仅适用于API第1版是德precated。所以,你必须要么注册您的应用程序版本1下,并使用Android清单的键或使用片段(第2版的Andr​​oid地图code)来解决这一问题。我希望别人在此之前或以任何其他线程回答了。

Ok, I got the answer myself. But I really had to dig a lot. The problem was because of Google Map Api version. The code I have used works only with Api V1 which is deprecated. So, you have to either register your app under Version 1 and use that key in android manifest or use Fragment (version 2 android map code) to resolve this problem. I wish someone else had answered this before or in any other threads.

反正享受。

这篇关于Android应用程序无法获取连接工厂客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆