Posts

Showing posts from September, 2015

NEARBY LOCATIONS FROM MYSQL DATABASE

SELECT *, ((ACOS(SIN(-7.796986 * PI() / 180) * SIN(lat * PI() / 180) + COS(-7.796986 * PI() / 180) * COS(lat * PI() / 180) * COS((110.387938 - lon) * PI() / 180)) * 180 / PI()) * 60 * 1.1515 * 1.609344) as distance FROM driver HAVING distance <= 20 ORDER BY distance ASC

Add Animation on map marker android

This is the source code from stackoverflow. I save in my blog for my reference.. 1.  TranslateAnimation animation = new TranslateAnimation(0.0f, 400.0f,0.0f, 0.0f); //new TranslateAnimation(xFrom,xTo, yFrom,yTo) animation . setDuration ( 2000 ); // animation duration animation . setRepeatCount ( 100 ); // animation repeat count (total repetition) animation . setRepeatMode ( 2 ); // repeat animation (left to right, right to left ) //animation.setFillAfter(true); img_animation . startAnimation ( animation ); and 2.  BitmapDescriptor icon = BitmapDescriptorFactory . fromResource ( R . drawable . current_position_tennis_ball ) MarkerOptions markerOptions = new MarkerOptions (). position ( latLng ) . title ( "Current Location" ) . snippet ( "Thinking of finding some thing..." ) . icon ( icon ); mMarker = googleMap . addMarker ( markerOptions );

Android start activity from service

try this code..  Intent dialogIntent = new Intent(getBaseContext(), MainActivity.class); dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getApplication().startActivity(dialogIntent);