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 7842783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:24:08+00:00 2026-06-02T16:24:08+00:00

I have created sqlite database which stores Latitude,Longitude and some other information like description.

  • 0

I have created sqlite database which stores Latitude,Longitude and some other information like description.

Now I want to extract this information and write into a GPX file to my SD card for further analysis purpose. Anyone have an idea about how to do this?

Any helpful links, sources etc.?

  • 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-06-02T16:24:10+00:00Added an answer on June 2, 2026 at 4:24 pm

    Thanks friends. Above two links help me to solve my problem, Here is the code for writing database values to .kml file

    try {
                                    File root = Environment
                                            .getExternalStorageDirectory();
                                    if (root.canWrite()) {
                                        File gpxfile = new File(root, ""
                                                + value + ".kml");
                                        FileWriter gpxwriter = new FileWriter(
                                                gpxfile);
                                        BufferedWriter out = new BufferedWriter(
                                                gpxwriter);
                                        out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                                                + "\n"
                                                + "<kml xmlns=\"http://www.opengis.net/kml/2.2\">"
                                                + "\n" + "<Folder>" + "\n");
                                        for (int i = 0; i < latarray.length; i++) {
                                            out.write("<Placemark>" + "\n"
                                                    + "<name> Point "
                                                    + i
                                                    + "</name>"
                                                    + "\n"
                                                    + "<description>"
                                                    + ""
                                                    + discription[i]
                                                    + "</description>"
                                                    + "\n"
                                                    + "<Point>"
                                                    + "\n"
                                                    + "<coordinates>"
                                                    + ""
                                                    + (lonarray[i] / (1E6))
                                                    + ","
                                                    + ""
                                                    + (latarray[i] / (1E6))
                                                    + ","
                                                    + ""
                                                    + accuarray[i]
                                                    + "</coordinates>"
                                                    + "\n"
                                                    + " </Point>"
                                                    + "\n"
                                                    + "</Placemark>" + "\n");
                                        }
                                        out.write("</Folder>" + "\n" + "</kml>");
                                        out.close();
                                        mydb.close();
                                    }
                                } catch (IOException e) {
                                    Log.e("Cant write", "Could not write file "
                                            + e.getMessage());
                                }
    

    and here is the example to read value from database

    public int[] lattodraw() {
        // TODO Auto-generated method stub
    
        String[] columns = new String[] { KEY_ROWID, KEY_Latitude,
                KEY_Longitude, KEY_Accuracy, KEY_ROWID, KEY_Latitude,
                KEY_Longitude, KEY_Accuracy, KEY_Discription, KEY_North,
                KEY_East, KEY_South, KEY_West };
        Cursor locationCursor = ourDatabase.query(DATABASE_TABLE, columns,
                null, null, null, null, null);
    
        locationCursor.moveToFirst();
        int count = locationCursor.getCount();
        int latarray[] = new int[count];
        int i = 0;
        do {
    
            int latitude = (int) (locationCursor.getDouble(locationCursor
                    .getColumnIndex(KEY_Latitude)) * 1E6);
    
            latarray[i] = latitude;
            i++;
        } while (locationCursor.moveToNext());
        locationCursor.close();
        return latarray;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a application which uses Sqlite database. Now i wanted to deploy
I have created an SQLite database which has a table which stores temperature values.
I have created the application which is based on Sqlite database. So in my
I have an Sqlite database in which I want to select rows of which
I have an sqlite database on android created like this: sqlite> .schema CREATE TABLE
in my app in the first activity i have created a database which stores
I have created the Simple Application of the sqlite database. In which i am
I have one sqlite database in which I store both user-defined information and information
I am new to using the SQLite database in iphone apps. I have created
I have an SQLite database. I created the tables and filled them with a

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.