سلام دوستان من میخوام نقشه گوگل مپ رو نمایش بدم تمام کار هارو انجام دادم api گوگل مپ رو هم ساختم. GoogleMap v2.00
کد های من
#Region Project Attributes
#ApplicationLabel:googlemaps
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
''' #AdditionalRes: C:\sdk\GoogleMapsV2\res, com.google.android.gms
#AdditionalRes: C:\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim mFragment As MapFragment
Dim gmap As GoogleMap
Dim MapPanel As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
ToastMessageShow(IsActivityAvailable("com.google.android.gms"),False)
MapPanel.Initialize("")
Activity.AddView(MapPanel, 0, 0, 100%x, 100%y)
If mFragment.IsGooglePlayServicesAvailable = False Then
ToastMessageShow("Google Play services not available.", True)
Else
mFragment.Initialize("Map", MapPanel)
End If
End Sub
Sub Map_Ready
Log("map ready")
gmap = mFragment.GetMap
If gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map.", True)
Else
gmap.AddMarker(36, 15, "Hello!!!")
Dim cp As CameraPosition
cp.Initialize(36, 15, gmap.CameraPosition.Zoom)
gmap.AnimateCamera(cp)
End If
End Sub
Sub IsActivityAvailable(package As String) As Boolean
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod("getPackageManager")
Try
r.Target = r.RunMethod3("getPackageInfo", package, _
"java.lang.String", 0x00000001, "java.lang.int")
Return True
Catch
Return False
End Try
End Sub
کد های منیفیست :
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.basic4ppc.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdkandroid:minSdkVersion="5"android:targetSdkVersion="14"/><supports-screensandroid:largeScreens="true"android:normalScreens="true"android:smallScreens="true"android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
AddManifestText( <permissionandroid:name="$PACKAGE$.permission.MAPS_RECEIVE"android:protectionLevel="signature"/><uses-featureandroid:glEsVersion="0x00020000"android:required="true"/>)
AddApplicationText(<meta-dataandroid:name="com.google.android.maps.v2.API_KEY"android:value="AIzaSyCmIo_RiATNce0FdAWRsI5_pOQ8mlBPsWI"/><meta-dataandroid:name="com.google.android.gms.version"android:value="@integer/google_play_services_version"/>)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
اما خطایی که مواجه میشوم
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
** Service (service1) Start **
** Service (service1) Start **
(SQLiteException) net.sqlcipher.database.SQLiteException: file is encrypted or is not a database
(SQLiteException) net.sqlcipher.database.SQLiteException: file is encrypted or is not a database
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 8487000 but found 5089000. You must have the following declaration within the <application> element: <meta-dataandroid:name="com.google.android.gms.version"android:value="@integer/google_play_services_version"/>
at com.google.android.gms.common.zze.zzan(Unknown Source)
at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.maps.internal.zzad.zzaP(Unknown Source)
at com.google.android.gms.maps.internal.zzad.zzaO(Unknown Source)
at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
at com.google.android.gms.maps.MapFragment$zzb.zzzW(Unknown Source)
at com.google.android.gms.maps.MapFragment$zzb.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.onCreate(Unknown Source)
at com.google.android.gms.maps.MapFragment.onCreate(Unknown Source)
at android.app.Fragment.performCreate(Fragment.java:1678)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:859)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
at android.app.BackStackRecord.run(BackStackRecord.java:684)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
سوال
hosseinkarimian 100
سلام دوستان من میخوام نقشه گوگل مپ رو نمایش بدم تمام کار هارو انجام دادم api گوگل مپ رو هم ساختم. GoogleMap v2.00
کد های من
#Region Project Attributes #ApplicationLabel:googlemaps #VersionCode: 1 #VersionName: 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: unspecified #CanInstallToExternalStorage: False ''' #AdditionalRes: C:\sdk\GoogleMapsV2\res, com.google.android.gms #AdditionalRes: C:\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms #End Region #Region Activity Attributes #FullScreen: False #IncludeTitle: True #End Region Sub Process_Globals End Sub Sub Globals Dim mFragment As MapFragment Dim gmap As GoogleMap Dim MapPanel As Panel End Sub Sub Activity_Create(FirstTime As Boolean) ToastMessageShow(IsActivityAvailable("com.google.android.gms"),False) MapPanel.Initialize("") Activity.AddView(MapPanel, 0, 0, 100%x, 100%y) If mFragment.IsGooglePlayServicesAvailable = False Then ToastMessageShow("Google Play services not available.", True) Else mFragment.Initialize("Map", MapPanel) End If End Sub Sub Map_Ready Log("map ready") gmap = mFragment.GetMap If gmap.IsInitialized = False Then ToastMessageShow("Error initializing map.", True) Else gmap.AddMarker(36, 15, "Hello!!!") Dim cp As CameraPosition cp.Initialize(36, 15, gmap.CameraPosition.Zoom) gmap.AnimateCamera(cp) End If End Sub Sub IsActivityAvailable(package As String) As Boolean Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod("getPackageManager") Try r.Target = r.RunMethod3("getPackageInfo", package, _ "java.lang.String", 0x00000001, "java.lang.int") Return True Catch Return False End Try End Sub
کد های منیفیست :
اما خطایی که مواجه میشوم
دوستان خودم چند روز کار میکنم روش به نتیجه نرسیدم
لینک ارسال
به اشتراک گذاری در سایت های دیگر
0 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.