Tuesday 3 December 2013

Add pin point on Map V2

When you have latitude and longitude then use this code

                                if(!TextUtils.isEmpty(checklat) && !TextUtils.isEmpty(checklon)){
                                        new Mybitmap().execute();
                                }


public class Mybitmap extends AsyncTask<Void, Void, Bitmap>{
        @Override
        protected Bitmap doInBackground(Void... params) {
            // TODO Auto-generated method stub
            abc = imgloader.getBitmap(checkimg);
            return abc;
        }
       
        @Override
        protected void onPostExecute(
                Bitmap result) {
            // TODO Auto-generated method stub
            super.onPostExecute(result);
            try{
            if(result != null){
                final LatLng latlong = new LatLng((Double.parseDouble(checklat)), (Double.parseDouble(checklon)));
                  Log.i(tag, "Latitude and Longitude ...."+latlong);
           
                  map.addMarker(new MarkerOptions()
                    .position(latlong)
                    .title(checktitle + " " +checksdateformate).icon(BitmapDescriptorFactory.fromBitmap(result)));
                map.moveCamera(CameraUpdateFactory.newLatLngZoom(latlong, 20));
                map.animateCamera(CameraUpdateFactory.zoomTo(20), 2000, null);                                               
            }}
            catch(Exception e){
                e.printStackTrace();
            }
        }
    };

Find Hours Diffrence in Kotlin

  In Kotlin, determining the difference in hours between two timestamps is a common task, especially in scenarios involving time-based calcu...