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

  • SEARCH
  • Home
  • 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 8457261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:45:58+00:00 2026-06-10T12:45:58+00:00

i’m currently trying to get a single row from my own database, located in

  • 0

i’m currently trying to get a single row from my own database, located in the assets folder. Checking if there is a row in the table, with the SQLite Query Browser and the SELECT-Statement from the debugger got me a single row in the database. Anyway calling the statement from my code just gets me an empty cursor. I also added the method

cursor.moveToFirst()

and avoided calling

myDataBase.close();

Here is the method where i’m trying to append a single entry on a TextView:

private void getAdresses(Location location) { // TODO
    double lat = location.getLatitude();
    double lng = location.getLongitude();
    Geocoder geocoder = new Geocoder(this, Locale.GERMAN);

    try {
        List<Address> addresses = geocoder.getFromLocation(lat, lng, 1);
        if (addresses.size() != 0) {
            Address address = addresses.get(0);

            String addressString = address.getAddressLine(0).toString();
            System.out.println("(geocoder) " + addressString);
            textView.append(addressString + "\n");

            Cursor cursor = mDbHelper.getAllEntrys("tblBar", "Adresse",
                    addressString);

            if (cursor.moveToFirst()) {

                String cursorContent = cursor.getString(cursor
                        .getColumnIndexOrThrow("Name"));
                textView.append(cursorContent + "\n");

            } else {
                System.out.println("No bar at current location");
            }
        } else {
            System.out.println("(geocoder) no address!");
        }
    } catch (IOException e) {
        System.out.println(e.toString() + "(geocoder)");
    }
}

Furthermore this is my method for calling the actual query on the database:

public Cursor getAllEntrys(String table, String column, String search) {
    try {
        String sSelect = "SELECT * FROM " + table + " WHERE " + column
                + " = '" + search + "'";
        Cursor cursor = mDb.rawQuery(sSelect, null);

        if (cursor != null) {
            cursor.moveToFirst();
        }
        return cursor;
    } catch (SQLException mSQLException) {
        System.out.println("getData >>" + mSQLException.toString());
        throw mSQLException;
    }
}

Hope someone can help me with this. Many thanks in advance!

  • 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-10T12:46:00+00:00Added an answer on June 10, 2026 at 12:46 pm

    Okay guys first i want to thank all of you for your quick responses. Keep it up! Although the answer is quite obvious, i figured it out myself. The problem in the tutorial from: http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ is, that it doesn’t consider the case that you add values manually (Updates in the SQLite Database Browser) to your database after you first run the programm. Thats what i did… So you have to write your own method to check if there were any changes since the last run. Hope anyone can need this 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a view passing on information from a database: def serve_article(request, id): served_article
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.