I am trying to develop a simple app using Google maps.
While running the app i can see only the grid and the map controls.
I did obtain an API key and included it into main.xml file.
The permissions for the internet was also granted in the androidmanifest.xml.
My browser in avd is connecting to internet and when i run the native map app in the avd, it shows the following error.
**Network Failure ... Wrong remote strings version.GMM Server must be hosting:/strings_remote_533149424.dat**
GoogleMapActivity.java
package com.example.googlemap;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
public class GoogleMapActivity extends MapActivity
{
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
}
#Override
protected boolean isRouteDisplayed()
{
return false;
}
}
main.xml
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="0kuSQz9hsxal-_JpKGJbFp__zLqhl5d4gG3ohDg"
/>
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.googlemap"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".GoogleMapActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<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" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
</application>
</manifest>
I'm using a proxy to connect to the internet.
Can anyone plz help me out with this..plz help me!!
As far as I know about GoogleMaps, there are no indications in manuals if the proxy could matter in displaying maps. If you got the map controls and the GoogleMap grid, this means that you have been connected to the map server but map tiles permissions were denied to you. What to do:
1. Check it if you got the DEBUG key or the Release key
2. Use the Debug key if you are testing locally with the "apk" downloaded from your PC
3. Use the Release key if you are debugging your "apk" downloaded from the Android market
It looks like you are stumbling upon one of the upper bottle-necks.
If these indications did not work, show your settings and source code on this forum for others to react appropriately.
Did you set this permision in manifest: android.permission.ACCESS_FINE_LOCATION, android.permission.ACCESS_COARSE_LOCATION and in aplication ???
I revisited your question and found 2 possible flaws.
Rewrite your manifest file as follows. USES-PERMISSION tags should be out of the APPLICATION tags.
Possibly, you may have been using a wrong debug-key. Please, generate an new debug-key according to manuals to use with this application on development PC.
If the problem persists, please update your development environment to the latest and test again.
Your rewritten manifest.xml should look like the following:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.googlemap"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".GoogleMapActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Related
I did the things described in this article:
When the application starts on real device HTC Desire 500 Dual, Android version 4.1.2 is not shown google map. Showing a black screen with the logo of google and inactive "+" and "-".
I use this files:
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gogo008.kermi.geo.v2"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- The following two permissions are not required to use Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<application android:label="#string/app_name" android:icon="#drawable/ic_launcher">
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<activity android:name="KermiGeo_v2"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyCTNkkaXiTHasvFzrHek1RYMj4AzoUHIeA"/>
</application>
</manifest>
res/layout/main.xml
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
src/gogo008/kermi/geo/v2/KermiGeo_v2.java
package gogo008.kermi.geo.v2;
import android.app.Activity;
import android.os.Bundle;
public class KermiGeo_v2 extends Activity
{
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Info from google console is:
Key for Android apps (with certificates)
API key: AIzaSyCTNkkaXiTHasvFzrHek1RYMj4AzoUHIeA
I usе debug certificate fingerprint.
Can anyone help me?
Check DDMS for errors. I found using DDMS the correct SHA1 hash and package name to be used in google console android maps setup.
1) It's showing empty map with grey color only with +(zoom in) and -(zoom out) buttons.
2) I extracted the SHA1 key from the debug.keystore and generated the MAP API V2 key in the
console.
3) I pasted that key in the manifest file.
4) GOOGLE MAP API V2 switched ON
and i use my Nexus 7 for debugging(USB Debugging)
LogCat Message :
Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network
errors).
Please help if i went somewhere wrong in these files.
AndoidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="metro.tailors"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17" />
<permission android:name="metro.tailors.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="metro.tailors.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<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="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="metro.tailors.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="metro.tailors.FactorsActivity"
android:label="#string/title_activity_factors" >
</activity>
<activity
android:name="metro.tailors.LadiesCategoryActivity"
android:label="#string/title_activity_ladies_category" >
</activity>
<activity
android:name="metro.tailors.GentsCategoryActivity"
android:label="#string/title_activity_gents_category" >
</activity>
<activity
android:name="metro.tailors.MapActivity"
android:label="#string/title_activity_map" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA2pMJiaPfwlz2yKaRNMZHykQkY_******"/>
</application>
</manifest>
This the XML File of the MapActivity
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
MapActivity.java
package metro.tailors;
import android.os.Bundle;
import android.app.Activity;
public class MapActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
}
}
4) GOOGLE MAP API V2 switched ON
You should turn on Google Maps for Android:
Fragment support start only from API > 11, So either change your manifest file to that or add android-support Library and use the SupportMapFragment object along side with FragmentActivity.
To download support library check the below link.
http://developer.android.com/tools/extras/support-library.html#Downloading
The doc states Use MapFragment class only if you are targeting API 12 and above. Otherwise, use SupportMapFragment.
https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/MapFragment.
regarding:
2) I extracted the SHA1 key from the debug.keystore and generated the MAP API V2 key in the console.
Not only do you have to do this, you also have to add your app to the list of allowed apps in the Google API Console, with your debug key and package name, as well as with your production keystore key and package name
I want to display Google Map APIv2 in an emulator.
It seems to me that I've done everything according to official Google tutorial and this tutorial. I see "+" and "-" buttons to adjust zoom, but don't see the map.
I've tried to regenerate keystore and provide another api key, but this had no effect. The only guess I have is that eclipse signs my application with a debug key, though I've done export procedure from my keystore.
Or may be it's somehow jdk issue? I have jdk 1.7 installed, and android uses 1.6
Here are the errors that I get:
E/Trace(681): error opening trace file: No such file or directory (2)
E/ActivityThread(681): Failed to find provider info for com.google.settings
E/ActivityThread(681): Failed to find provider info for com.google.settings
E/ActivityThread(681): Failed to find provider info for com.google.android.gsf.gservices
E/ActivityThread(681): Failed to find provider info for com.google.android.gsf.gservices
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="us.irz.findme"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="17" />
<permission
android:name="us.irz.findme.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="us.irz.findme.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="us.irz.findme.LoginActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="us.irz.findme.DeviceActivity"></activity>
<activity android:name="us.irz.findme.MapActivity"></activity>
<activity android:name="us.irz.findme.TabsActivity"></activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my_api_key"/>
</application>
</manifest>
map.xml file
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
MainActivity.java
public class MainActivity extends FragmentActivity implements OnClickListener {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
}
...
}
If you like to try it in a emulator, the emulator has to be created as with target Google Api level xx, not with Android 2.3 (for example), Sometimes the emulator can't load the map, so I recomended you to use a real Android device, your phone, tablet or something like this... Too check that the api key is the correct.. If you know spanish, can follow this tuto, is very good http://www.sgoliver.net/blog/?page_id=3011, search the section "Mapas en Android (Google Maps Android API v2) – I"...
Please check that you added the Google Play Services library in you project.
Android google maps get error Couldn't get connection factory client, I have get apikey from here, this is my code:
MainActivity.java
package com.haichal.map;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
public class MainActivity extends MapActivity
{
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
#Override
protected boolean isRouteDisplayed() {
return false;
}
}
main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="#+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0IbdGeqd17e6zbTdNfSze2pEt1jJzEEPoOM0jZw"
/>
</RelativeLayout>
Manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.haichal.map"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".MainActivity"
android:label="#string/title_app" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And in android project target, I using Google Apis, platform 4.1.2, Api level 16.
In my eclipse project no get error(no red ballon), I debug and install success, but when I run apps, maps just get blank grid, not get maps, if I look in log cat I get message error Couldn't get connection factory client.
How to solved my problem?
when i run apps, maps just get blank grid, not get maps
Either your device does not have Internet access (at least to the Google Maps server), or your API key is wrong. Another possibility would be that you lack the INTERNET permission, but it appears that you have that already.
if i look in log cat i get message error Couldn't get connection factory client
That message happens all of the time, even when your app works.
I've deleted my debug key, generated a new one, gotten the new MD5 fingerprint and registered that with google and used the new API key in my layout XML, still broken. It was all working fine until a few days ago. Now all my maps are just a bunch of X's. Any ideas?
Do I need to sign my app for debug/development? All I have done so far is generate the fingerprint and used that to get an API key, am I missing a step perhaps?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.elon.ecs"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application android:icon="#drawable/icon" android:label="#string/app_name"
android:debuggable="true">
<uses-library android:name="com.google.android.maps" />
<service android:name="NewsEvents_Service"></service>
<activity android:name=".ECS"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="ElonMap"></activity>
<activity android:name="NavigationActivity"></activity>
<activity android:name="NewsEvents"></activity>
<activity android:name="EditKeywords"></activity>
<activity android:name="FullNewsEvent"></activity>
<activity android:name="OnTheJob"></activity>
</application>
<uses-sdk android:minSdkVersion="4"/>
</manifest>
Have you checked that your permissions are still OK? You need the INTERNET permission to download the map tiles.
I've also been bitten, by putting the <uses-permission> tag after the <application> tag. This worked on all devices I tried except the SE Xperia X10 mini. Putting <uses-permission> first solved that one.
Also, make sure that you actually have an internet connection on your device (can you load web pages, for instance?)
You should also make sure that your application is being signed using the same keystore you used to generate your map key. If you're using eclipse to build, you'll find that keystore in the preferences, under Windows > Preferences > Android > Build.
There might be a problem on your mapView. are you trying to emulate satellite and street view?
Or your zoom level is too high.