Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7007861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:39:42+00:00 2026-05-27T21:39:42+00:00

I am adding points to the map, their location I am saving into the

  • 0

I am adding points to the map, their location I am saving into the databse. When I click on a previously added point on the map, I want to perform SQLite query, whethere I have clicked on some point. Obviously, you are not 100% correct when clicking on item on display. I have invented a squared area, which will accept click as a it is a desired point (more info is seen on the image). I have divided this area to four quadrants for SQlite query – if it is accepted as a Point selection, I have to put my finger only and only in one of those quadrants.

enter image description here

I am using SQL statement for figuring out, if I have clicked on the point or not:

cursor=db.query("points_details2", null ,"(location_X <="+cXplus+" AND location_Y >="+cYminus+") OR (location_X >="+cXminus+" AND location_Y >="+cYminus+") OR (location_X <="+cXplus+" AND location_Y <="+cYplus+") OR (location_X >="+cXminus+" AND location_Y <="+cYplus+")", null, null, null, null);
                            Log.d("POINT", "Cursor "+cursor.getColumnName(0));
                cursor.moveToFirst();

                while (cursor.isAfterLast() == false) {
                    Log.d("POINT","data is: "+cursor.getInt(0)+", "+cursor.getString(1)+", "+cursor.getString(2)+", "+cursor.getDouble(3)+", "+cursor.getDouble(4));
                    cursor.moveToNext();
                }
                cursor.close();

And the boundaries are specified as:

double cXplus=coord_X+5;
double cXminus=coord_X-5;
double cYplus=coord_Y+5;
double cYminus=coord_Y-5;

So here is the boundary 5, coord_X and coord_Y are coordinates of my screen click with my finger.

Here is the thing – Am I using bad approach? This SQL statement I have provided is not working, and I don’t know why. Can anyone help me in this case? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:39:42+00:00Added an answer on May 27, 2026 at 9:39 pm

    They should all be AND! You want the point to be inside ALL four corners of the square.

    i.e.

    (location_X <="+cXplus+" AND location_Y >="+cYminus+") AND (location_X >="+cXminus+" AND location_Y >="+cYminus+") AND (location_X <="+cXplus+" AND location_Y <="+cYplus+") AND (location_X >="+cXminus+" AND location_Y <="+cYplus+")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Where can i find mapviews example? -adding point to map -clicking that points, and
I'm having problems with adding marker clusterer functionality to my map. What I want
By default when you click on a marker the map pans to that location.
Would there be any point in adding resx files to a distributed cache? What
Adding the row one by one in the button click.. (i tried but its
I've been successful at adding map pins to my map overlay but it loads
I am creating a map editor, and where they click will be used to
I would like to remove all the overlays of my map at one point,
I have a map on my website that I want to tie to a
I have a set of points(5-10) that needs to be overlayed on the map.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.