In the tutorial, you seem to flip between calling the layout folder either res/layout-sw400dp or res/layout-w400dp. Is the sw400dp just a typo as it would mean something different than just w400dp?
I’m having difficultly in trying to figure out how I should organize my layout files. From your example, what if you had a device that is greater than 500dp in portrait mode? What would be the be folder setup to ensure you have the over-under layout for portrait mode and side-by-side layout for landscape mode on this device?
Thanks for the tutorial. It helped no end and makes the transition to the official Android documentation, on the subject, a little easier. Great initial motivation of the subject matter.
If you import android.app.Fragment the app will crash on startup.
In order to zoom to the location on the map as shown in the image, loadMap of InfoFragment.java needs to be:
private void loadMap(GoogleMap googleMap) {
if (googleMap != null) {
// Use green marker icon
BitmapDescriptor defaultMarker = BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE);
// listingPosition is a LatLng point
LatLng sceneryPosition = new LatLng(44.22438242, 6.944561);
// Create the marker on the fragment
mapFragment.getMap().addMarker(new MarkerOptions()
.position(sceneryPosition)
.icon(defaultMarker));
CameraPosition cameraPosition = new CameraPosition.Builder().target(sceneryPosition).zoom(10.0f).build();
CameraUpdate cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition);
mapFragment.getMap().moveCamera(cameraUpdate);
}
}
Hey, I couldn’t find New/Scaled drawable when right-clicking res/drawable. I am using Android Studio 2.2 and I have installed Android drawable importer too.