0

저는 현재 이전 GoogleMaps API를 최신 V2로 전환하고 있습니다. 나는 오래된 논리를 리팩터링했고 완벽하게 작동한다. 필자는 2.1 디바이스를 지원하기 때문에 이전 맵을 PlayStore가없는 구형 디바이스 나 디바이스 용 레거시 솔루션으로 남기고 싶습니다. HTC-Wildfire에 오기 전에 많은 장치를 테스트했습니다. 이 기기는 MapsV2에 위임되었지만 빈 화면 만 보여줍니다. OpenGlES에 대한 지원이 부족하기 때문에 새로운지도를 렌더링 할 수 없다고 생각합니다. GoogleMapsV2 OpenGL 문제

int availCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this); 
      switch (availCode) { 
      case ConnectionResult.SUCCESS: 
       addTab(TAB_GOOGLE_MAPS, R.string.tab_google_map, R.drawable.tab_surrounding, GoogleMapsActivityV2.class, true); 
       break; 
      case ConnectionResult.SERVICE_MISSING: 
      case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED: 
      case ConnectionResult.SERVICE_DISABLED: 
       GooglePlayServicesUtil 
       .getErrorDialog(availCode, this, REQUEST_CODE_PLAY_SERVICES) 
       .show(); 
       break; 
      case ConnectionResult.SERVICE_INVALID: 
      default: 
       addTab(TAB_GOOGLE_MAPS, R.string.tab_google_map, R.drawable.tab_surrounding, GoogleMapsActivity.class, true); 
       break; 
      } 

은 그래서 GooglePlayServices 지원이 있지만, obviosly이 검사가 enaugh되지 않습니다

지도 버전이 표시 얻을해야 내가 결정하는 데 사용하는 코드입니다. 지원되는 OpenGL-ES 버전을 확인할 수 있습니까? shua를 만들기 위해 MapsV2가 실행되는지 확인해야합니까? 기존의 대체 기기가 있기 때문에 매니페스트 안에 requiresFeature openGLES 태그를 정의 할 수 없으며 저가형 기기 나 PlayStore가 마음에 들지 않는 사용자를 제외하고 싶지 않기 때문에 requiresFeature openGLES 태그를 정의 할 수 없습니다.

+0

Android 2.1 이하는 [모든 기기의 1 % 미만] (http://developer.android.com/about/dashboards/index.html)에서 지원해야합니까? – WarrenFaith

+0

아니요. 2.2에 적용 할 계획입니다. 그러나 2.2에서도 PlayStore 또는 OpenGL이없는 기기가있어 새로운 GMaps V2를 표시 할 수 없었습니다 –

답변

1

이 수행을위한 프로그램 체크는 OpenGL/ES 2 지원 :

// Check device configuration to ensure OpenGL ES 2.0 support 
ActivityManager am = (ActivityManager)activity.getSystemService(Context.ACTIVITY_SERVICE); 
ConfigurationInfo config = am.getDeviceConfigurationInfo(); 
if (config.reqGlEsVersion < 0x20000) 
{ 
addTab(TAB_GOOGLE_MAPS, R.string.tab_google_map, R.drawable.tab_surrounding, GoogleMapsActivity.class, true); 
} 
else 
{ 
... check for Play Services... 
} 

또한 앱 매니페스트를 통해 OpenGL을/ES 2 지원이 필요할 수 있습니다 :

<uses-feature android:glEsVersion="0x00020000" android:required="true" /> 

이과 충돌하지만 당신의 안드로이드 지원 2.1.