Today I read the Google Maps Android v2 API document, he said that the project android-sdk\extras\google\google_play_services\samples\mapscan start, but after I imported into eclipse and installed the libraries android-support-v4.jarand google-play-services.jar correctly, I cannot find the file import com.example.mapdemo.R;in FeatureView.java(line 24)R.java.
almost the entire java file in com.example.mapdemoneed a class "R", for example, the file BasicMapActivity.java needs R on line 41 " setContentView(R.layout.basic_demo);" and line 71 mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();"can someone tell me how to find the class" R "?
R
.java can not create automatically because the file multimap_demo.xml have some errors in
<br><br> <fragment
<br> android:id="@+id/map3"
<br> android:layout_width="match_parent"
<br> android:layout_height="match_parent"
<br> android:layout_weight="0.5"
<br> class="com.google.android.gms.maps.SupportMapFragment"
<br> map:cameraTargetLat="48.85"
<br> map:cameraTargetLng="2.35"
<br> map:cameraZoom="8"/>
<br><br>
eclipse said that "cameraTargetLat", "cameraTargetLng" and "cameraZoom" are not recognized. Error Information:
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'cameraTargetLat' in package 'com.example.mapdemo'
- error: No resource identifier found for attribute 'cameraTargetLng' in package 'com.example.mapdemo'
- error: No resource identifier found for attribute 'cameraZoom' in package 'com.example.mapdemo'
I do not know why.
If I change the code like this:
<br><br> <fragment
<br> android:id="@+id/map3"
<br> android:layout_width="match_parent"
<br> android:layout_height="match_parent"
<br> android:layout_weight="0.5"
<br> class="com.google.android.gms.maps.SupportMapFragment"/>
<br><br>
, , .