Android Community
Results 1 to 7 of 7

Thread: GPS coordinates locator

  1. #1
    Join Date
    Sep 2011
    Posts
    3

    Default GPS coordinates locator


    I can't believe this doesn't exist already, but I spent quite awhile looking and haven't found anything quite like it yet.

    What I need is very simple; I want to be able to input any GPS coordinates, and then all I want is a direction arrow and a distance to the coordinates.

  2. #2
    Join Date
    Sep 2011
    Posts
    3

    Default Re: GPS coordinates locator

    Yay, nay? Anyone?

  3. #3
    Join Date
    Dec 2008
    Posts
    35

    Default Re: GPS coordinates locator


  4. #4
    Join Date
    Sep 2011
    Posts
    3

    Default Re: GPS coordinates locator

    I have that one; it doesn't do what I want.

    It is great for telling me what my current coordinates are, but that's not what I need.

  5. #5

    Default Re: GPS coordinates locator

    MyLocation works as well.

    Spring Framework
    Last edited by arulife; 12-06-2011 at 06:16 AM.

  6. #6
    Join Date
    Dec 2011
    Location
    Pakistan
    Posts
    5

    Default Re: GPS coordinates locator

    if u want to find distance to the given co-ordinates, make a geoPoint object , instantiate it with lat and long, and use the methode distanceBetween(p1, p2); methode, that will solve the problem

  7. #7
    Join Date
    Dec 2011
    Location
    Pakistan
    Posts
    5

    Default Re: GPS coordinates locator


    for the showing a direction arrow,, i am pasting the code that i used below, it draws staright line on the convase



    class MapOverlay extends Overlay
    {
    private final int mRadius = 5;
    private GeoPoint myGeoPoint;

    static GeoPoint geoPoint1,geoPoint2;

    private String name;
    //private boolean isSelf;

    public MapOverlay(GeoPoint geoPoint1, String name)//, boolean isSelf)
    {
    this.myGeoPoint = geoPoint1;
    this.name = name;
    }

    @Override
    public void draw(Canvas canvas, MapView mapView, boolean shadow)
    {
    Projection projection = mapView.getProjection();

    if (shadow == false)
    {
    Point screenPoint = new Point();
    projection.toPixels(myGeoPoint, screenPoint);

    RectF oval = new RectF(screenPoint.x - mRadius, screenPoint.y - mRadius,
    screenPoint.x + mRadius, screenPoint.y + mRadius);

    Paint paint = new Paint();
    paint.setARGB(250, 255, 255, 255);
    paint.setAntiAlias(true);
    paint.setFakeBoldText(true);

    Paint backPaint = new Paint();
    backPaint.setARGB(175, 50, 50, 50);
    backPaint.setAntiAlias(true);
    backPaint.setColor(Color.RED);
    backPaint.setAlpha(150);


    RectF backRect = new RectF(screenPoint.x + 2 + mRadius,
    screenPoint.y - 3*mRadius,
    screenPoint.x + 65, screenPoint.y + mRadius);

    canvas.drawOval(oval, paint);
    canvas.drawRoundRect(backRect, 5, 5, backPaint);
    canvas.drawText(name,
    screenPoint.x + 2*mRadius, screenPoint.y,
    paint);



    Paint mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setColor(Color.BLUE);
    mPaint.setStrokeWidth(2);

    Point point1 = new Point();
    projection.toPixels(geoPoint1, point1);

    Point point2 = new Point();
    projection.toPixels(geoPoint2, point2);

    /// here is the code line that u asked for drawing error, modifiy it to arror, as it shows straight line
    canvas.drawLine((float) point1.x, (float) point1.y, (float) point2.x,
    (float) point2.y, mPaint);

    }
    }

    }// end of OverLay class

Similar Threads

  1. [APP] Phone locator
    By erne.castro in forum All About Andorid Software
    Replies: 0
    Last Post: 08-21-2011, 09:30 AM
  2. Cell Tower Locator
    By La0nda in forum Developers Guild
    Replies: 6
    Last Post: 07-28-2010, 08:00 AM
  3. How to get GPS coordinates at eclipse when emulator is used
    By FrankieChoi in forum Developers Guild
    Replies: 1
    Last Post: 02-21-2010, 09:50 AM
  4. Offender Locator
    By Iceberg in forum All About Andorid Software
    Replies: 12
    Last Post: 10-10-2009, 04:37 PM
  5. Wifi Locator (sniffer)
    By providence in forum Developers Guild
    Replies: 1
    Last Post: 04-10-2009, 09:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •