With the recent launch of the Google Fit platform, we hope to spur innovation in the world of fitness apps and devices that encourage users to have a more active lifestyle. To expand the ecosystem and help users get a more comprehensive view of their fitness, were excited to announce the Google Fit Developer Challenge in partnership with adidas, Polar, and Withings. Were inviting you to create and showcase an app, or update an existing app, that integrates with Google Fit. The submission deadline is February 17, 2015. Our selected judges will choose up to six new apps and six existing apps for Fit, as the winners. The judges are looking for fitness apps that are innovative, fun to use, keep users coming back, offer users real benefit, and meet the Android design and quality guidelines.
Challenge winners will be featured on Google Play in front of Android users around the world. Runners-ups will also receive prizes, in the form of smart devices from Google, adidas, Polar, and Withings, so that they can continue to tinker and improve their fitness apps with the latest hardware.
Check out the challenge website to find out how to enter*. You will also find some helpful resources to find inspiration. We encourage you to join the Google Fit Developer Community on Google+ to discuss your ideas and the challenge.
* The challenge is open to registered Google Play developers in the US, UK, France, Germany, India, Israel, Hong Kong, Singapore, South Korea, Japan, and Taiwan who are over the age of 18 (or the age of majority in their country). For the full terms and conditions, read the official rules.
Posted by Angana Ghosh, Product Manager, Google Fit
To create Custom InfoWindow for Google Maps Android API v2:
- Make your Activity implements GoogleMap.InfoWindowAdapter.
- Override getInfoWindow(Marker marker) and getInfoContents(Marker marker).
The API will first call getInfoWindow(Marker) and if null is returned, it will then call getInfoContents(Marker). If this also returns null, then the default info window will be used. The first of these (getInfoWindow()) allows you to provide a view that will be used for the entire info window. The second of these (getInfoContents()) allows you to just customize the contents of the window but still keep the default info window frame and background.
- setInfoWindowAdapter(this).
Modify MapsActivity.java from last example "Make GoogleMaps marker draggabe and detect moving marker".
public class MapsActivity extends AppCompatActivity implements OnMapReadyCallback, GoogleMap.OnMapClickListener, GoogleMap.OnMapLongClickListener, GoogleMap.OnMarkerDragListener, GoogleMap.InfoWindowAdapter {
private GoogleMap mMap;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this);
}
/** * Manipulates the map once available. * This callback is triggered when the map is ready to be used. * This is where we can add markers or lines, add listeners or move the camera. In this case, * we just add a marker near Sydney, Australia. * If Google Play services is not installed on the device, the user will be prompted to install * it inside the SupportMapFragment. This method will only be triggered once the user has * installed Google Play services and returned to the app. */ @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mMap.setOnMapClickListener(this); mMap.setOnMapLongClickListener(this); mMap.setOnMarkerDragListener(this); mMap.setInfoWindowAdapter(this); }
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_addmarkers: addMarker(); return true; case R.id.maptypeHYBRID: if(mMap != null){ mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID); return true; } case R.id.maptypeNONE: if(mMap != null){ mMap.setMapType(GoogleMap.MAP_TYPE_NONE); return true; } case R.id.maptypeNORMAL: if(mMap != null){ mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); return true; } case R.id.maptypeSATELLITE: if(mMap != null){ mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); return true; } case R.id.maptypeTERRAIN: if(mMap != null){ mMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN); return true; } case R.id.menu_legalnotices: String LicenseInfo = GoogleApiAvailability .getInstance() .getOpenSourceSoftwareLicenseInfo(MapsActivity.this); AlertDialog.Builder LicenseDialog = new AlertDialog.Builder(MapsActivity.this); LicenseDialog.setTitle("Legal Notices"); LicenseDialog.setMessage(LicenseInfo); LicenseDialog.show(); return true; case R.id.menu_about: AlertDialog.Builder aboutDialogBuilder = new AlertDialog.Builder(MapsActivity.this); aboutDialogBuilder.setTitle("About Me") .setMessage("http://android-er.blogspot.com");
aboutDialogBuilder.setPositiveButton("visit", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String url = "http://android-er.blogspot.com"; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); } });
aboutDialogBuilder.setNegativeButton("Dismiss", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } });
try{ lat = Double.parseDouble(strLat); }catch (NumberFormatException ex){ parsable = false; Toast.makeText(MapsActivity.this, "Latitude does not contain a parsable double", Toast.LENGTH_LONG).show(); }
try{ lon = Double.parseDouble(strLon); }catch (NumberFormatException ex){ parsable = false; Toast.makeText(MapsActivity.this, "Longitude does not contain a parsable double", Toast.LENGTH_LONG).show(); }
if(parsable){
LatLng targetLatLng = new LatLng(lat, lon); MarkerOptions markerOptions = new MarkerOptions().position(targetLatLng).title(strTitle);
//Add marker on LongClick position MarkerOptions markerOptions = new MarkerOptions().position(latLng).title(latLng.toString()); markerOptions.draggable(true);
mMap.addMarker(markerOptions); }
@Override public void onMarkerDragStart(Marker marker) { marker.setTitle(marker.getPosition().toString()); marker.showInfoWindow(); marker.setAlpha(0.5f); }
@Override public void onMarkerDrag(Marker marker) { marker.setTitle(marker.getPosition().toString()); marker.showInfoWindow(); marker.setAlpha(0.5f); }
@Override public void onMarkerDragEnd(Marker marker) { marker.setTitle(marker.getPosition().toString()); marker.showInfoWindow(); marker.setAlpha(1.0f); }