Note that there are some explanatory texts on larger screens.

plurals
  1. POFailed to find provider info com.google.settings Android Map
    text
    copied!<p>My android app uses MapView, but after starting activity with MapView I'm getting the three errors in a row:</p> <p>Failed to find provider info com.google.settings</p> <p>and later</p> <p>Couldn't get connection factory client</p> <p>i have set all the permission and Api key. But grid map is displayed.</p> <p>i am solving this problem about for last 2 weeks but i did not solve..</p> <p>somebody know how to fix this problem ??</p> <p><strong>here is my code</strong></p> <pre><code>public class AndroidGPSApplicationActivity extends MapActivity { private MapView map=null; private MyLocationOverlay me=null; private ToggleButton toggle_button; private TextView latitude=null; public double value; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); map=(MapView)findViewById(R.id.mapview); map.getController().setCenter(getPoint(34.0043,71.5448)); map.getController().setZoom(13); map.setBuiltInZoomControls(true); map.setTraffic(true); Drawable marker=getResources().getDrawable(R.drawable.marker); marker.setBounds(0, 0, marker.getIntrinsicWidth(), marker.getIntrinsicHeight()); map.getOverlays().add(new SitesOverlay(marker)); me=new MyLocationOverlay(this, map); map.getOverlays().add(me); MapOverlay mapOverlay = new MapOverlay(); List&lt;Overlay&gt; listOfOverlays = map.getOverlays(); listOfOverlays.add(mapOverlay); tabView(); latitude = (TextView)findViewById(R.id.latitude_value); //latitude.setText(null); toggle_button = (ToggleButton)findViewById(R.id.togglebutton); toggle_button.setOnCheckedChangeListener(new OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(toggle_button.isChecked()) { enableGps(); Toast.makeText(getApplicationContext(), "The state of GPS is changed to on", Toast.LENGTH_LONG).show(); } else { disableGps(); Toast.makeText(getApplicationContext(), "The state of GPS is changed to off", Toast.LENGTH_LONG).show(); } } }); } // end of onCreate(); function @Override public void onResume() { super.onResume(); me.enableCompass(); } @Override public void onPause() { super.onPause(); me.disableCompass(); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_S) { map.setSatellite(!map.isSatellite()); return(true); } else if (keyCode == KeyEvent.KEYCODE_Z) { map.displayZoomControls(true); return(true); } return(super.onKeyDown(keyCode, event)); } private void tabView() { //setting two tabs ..for Map and Update TabHost tabs = (TabHost)findViewById(R.id.TabHost01); tabs.setup(); TabHost.TabSpec spec1 = tabs.newTabSpec("tag1"); spec1.setContent(R.id.setting); spec1.setIndicator("Setting"); tabs.addTab(spec1); //TabHost tabs = (TabHost)findViewById(R.id.TabHost01); //tabs.setup(); TabHost.TabSpec spec2 = tabs.newTabSpec("tag2"); spec2.setContent(R.id.layout1); spec2.setIndicator("Map"); tabs.addTab(spec2); TabHost.TabSpec spec3 = tabs.newTabSpec("tag3"); spec3.setContent(R.id.layout2); spec3.setIndicator("Stastistics"); tabs.addTab(spec3); } protected void disableGps() { Intent intent=new Intent("android.location.GPS_ENABLED_CHANGE"); intent.putExtra("enabled", false); sendBroadcast(intent); } protected void enableGps() { Intent intent=new Intent("android.location.GPS_ENABLED_CHANGE"); intent.putExtra("enabled", true); sendBroadcast(intent); } protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } private GeoPoint getPoint(double lat, double lon) { return(new GeoPoint((int)(lat*1000000.0), (int)(lon*1000000.0))); } /* * This is an inner class . * for puting an image on specified location.. */ private class SitesOverlay extends ItemizedOverlay&lt;OverlayItem&gt; { private List&lt;OverlayItem&gt; items=new ArrayList&lt;OverlayItem&gt;(); private Drawable marker=null; public SitesOverlay(Drawable marker) { super(marker); this.marker=marker; items.add(new OverlayItem(getPoint(34.0043, 71.5448),"PK", "PTCL Office Cantt")); items.add(new OverlayItem(getPoint(34.004124555, 71.4859698), "Lincoln Center", "Department of Computer Science")); items.add(new OverlayItem(getPoint(34.03484758, 71.54653569), "Carnegie Hall", "Where you go with practice, practice, practice")); items.add(new OverlayItem(getPoint(34.07492254, 71.5464754), "The Downtown Club", "Original home of the Heisman Trophy")); populate(); } @Override protected OverlayItem createItem(int i) { return(items.get(i)); } @Override public void draw(Canvas canvas, MapView mapView, boolean shadow) { super.draw(canvas, mapView, shadow); boundCenterBottom(marker); } @Override protected boolean onTap(int i) { Toast.makeText(AndroidGPSApplicationActivity.this, items.get(i).getSnippet(), Toast.LENGTH_SHORT).show(); return(true); } @Override public int size() { return(items.size()); } } private class MapOverlay extends Overlay { @Override public boolean onTouchEvent(MotionEvent event, MapView mapView) { //---when user lifts his finger--- if (event.getAction() == 1) { GeoPoint p = mapView.getProjection().fromPixels( (int) event.getX(), (int) event.getY()); Toast.makeText(getBaseContext(), "Location: "+ p.getLatitudeE6() / 1E6 + "," + p.getLongitudeE6() /1E6 , Toast.LENGTH_SHORT).show(); value= p.getLatitudeE6() / 1E6 ; String str_value = Double.toString(value); latitude.setText(str_value); } return false; } } } </code></pre> <p><strong>Xml file</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;TabHost android:id="@+id/TabHost01" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt; &lt;TabWidget android:id="@android:id/tabs" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="90dp" &gt; &lt;TextView android:id="@+id/setting" android:text="@string/setting_tab" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;RelativeLayout android:id="@+id/layout1" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:apiKey="Api Key" android:clickable="true" /&gt; &lt;ToggleButton android:id="@+id/togglebutton" android:layout_width="50dp" android:layout_height="50dp" android:textOn="ON" android:textOff="OFF" android:layout_alignParentBottom="true"/&gt; &lt;/RelativeLayout&gt; &lt;LinearLayout android:id="@+id/layout2" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/latitude_lbl" android:text="@string/latitude" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/latitude_value" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/longitude_lbl" android:text="@string/longitude" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; &lt;/FrameLayout&gt; &lt;/TabHost&gt; &lt;/LinearLayout&gt; </code></pre> <p><strong>Manifest file</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.gps.welcome" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="4" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;uses-library android:name="com.google.android.maps"/&gt; &lt;activity android:name=".AndroidGPSApplicationActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"&gt;&lt;/uses-permission&gt; &lt;/manifest&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload