hamed_hossani
یک شنبه 01 تیر 1393, 20:20 عصر
سلام
من می خواستم google map رو تست بزنم.
روی گوشی اوردم بالا
اول ارور میداد که google play service مشکل SERVICE_VERSION_UPDATE_REQUIRED (http://developer.android.com/reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_VERSION_UPDATE_REQUI RED), داره
اپدیت کردم.
حالا ارور میده که
INSTALL_FAILED_INSUFFICIENT_STORAGE و برنامه کنسل میشه.
جایی گفتن اینو به منیفست اضافه کن.
android:installLocation="preferExternal"
کردم بازم درست نشد.
چکار باید کرد؟
پ.ن:
دارم از این اموزش استفاده می کنم.
http://wptrafficanalyzer.in/blog/showing-current-location-in-google-maps-using-api-v2-with-supportmapfragment/
فایل mainActivity.java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(servicesOk()){
Toast.makeText(this, "ready to Map", Toast.LENGTH_SHORT).show();
}
setContentView(R.layout.activity_main);
}
public boolean servicesOk(){
int isAvalable=GooglePlayServicesUtil.isGooglePlayServ icesAvailable(this);
if(isAvalable==ConnectionResult.SUCCESS){
return true;
}
else if(GooglePlayServicesUtil.isUserRecoverableError(i sAvalable))
{
Dialog dialog=GooglePlayServicesUtil.getErrorDialog(isAva lable, this, GPS_ERRORDIALOG_REQUEST);
dialog.show();
}
else{
Toast.makeText(this, "can't connect to google play service", Toast.LENGTH_SHORT).show();
}
return false;
}
فایل منیفست
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ir.hamedhossani.googlemaptest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<permission
android:name="ir.hamedhossani.googlemaptest.permission.MAPS_RECE IVE"
android:protectionLevel="signature"></permission>
<uses-permission android:name="ir.hamedhossani.googlemaptest.permission.MAPS_RECE IVE"/>
<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_G SERVICES"/>
<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="ir.hamedhossani.googlemaptest.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>
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="@@"/>
</application>
</manifest>
مقدار api را وارد کردم (بجای@@)
من می خواستم google map رو تست بزنم.
روی گوشی اوردم بالا
اول ارور میداد که google play service مشکل SERVICE_VERSION_UPDATE_REQUIRED (http://developer.android.com/reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_VERSION_UPDATE_REQUI RED), داره
اپدیت کردم.
حالا ارور میده که
INSTALL_FAILED_INSUFFICIENT_STORAGE و برنامه کنسل میشه.
جایی گفتن اینو به منیفست اضافه کن.
android:installLocation="preferExternal"
کردم بازم درست نشد.
چکار باید کرد؟
پ.ن:
دارم از این اموزش استفاده می کنم.
http://wptrafficanalyzer.in/blog/showing-current-location-in-google-maps-using-api-v2-with-supportmapfragment/
فایل mainActivity.java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(servicesOk()){
Toast.makeText(this, "ready to Map", Toast.LENGTH_SHORT).show();
}
setContentView(R.layout.activity_main);
}
public boolean servicesOk(){
int isAvalable=GooglePlayServicesUtil.isGooglePlayServ icesAvailable(this);
if(isAvalable==ConnectionResult.SUCCESS){
return true;
}
else if(GooglePlayServicesUtil.isUserRecoverableError(i sAvalable))
{
Dialog dialog=GooglePlayServicesUtil.getErrorDialog(isAva lable, this, GPS_ERRORDIALOG_REQUEST);
dialog.show();
}
else{
Toast.makeText(this, "can't connect to google play service", Toast.LENGTH_SHORT).show();
}
return false;
}
فایل منیفست
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ir.hamedhossani.googlemaptest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<permission
android:name="ir.hamedhossani.googlemaptest.permission.MAPS_RECE IVE"
android:protectionLevel="signature"></permission>
<uses-permission android:name="ir.hamedhossani.googlemaptest.permission.MAPS_RECE IVE"/>
<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_G SERVICES"/>
<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="ir.hamedhossani.googlemaptest.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>
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="@@"/>
</application>
</manifest>
مقدار api را وارد کردم (بجای@@)