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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:37:47+00:00 2026-06-08T19:37:47+00:00

I m working on an e-learning type of an application where i retrieve the

  • 0

I m working on an e-learning type of an application where i retrieve the data from the database on list.

It works fine on the emulator,but when i use the APK file of that app on real device,it does not show any data on list, my database is stored in the windows-file explorer-package-data-database-table_name.

I am referring to this site

http://anujarosha.wordpress.com/2011/12/19/how-to-retrieve-data-from-a-sqlite-database-in-android/

Here’s a snippet of my code using database

list_adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, namelist1());

        list1.setAdapter(list_adapter);

    }

    public  List<String> namelist1()
    {
        // We have to return a List which contains only String values. Lets create a List first
        List<String> namelist= new ArrayList<String>();

        // First we need to make contact with the database we have created using the DbHelper class

        Database_helper_class open_database_helper= new Database_helper_class(this);
        // Then we need to get a readable database
        SQLiteDatabase sqlitedatabase = open_database_helper.getReadableDatabase();
        // We need a a guy to read the database query. Cursor interface will do it for us
        //(String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy)
        Cursor cursor =sqlitedatabase.query(open_database_helper.TABLE_E_LEARNING,null,null,null,null,null,null);
        //above query is read all the database column

        // Cursor object read all the fields. So we make sure to check it will not miss any by looping through a while loop

        while(cursor.moveToNext()){
            String str_name = cursor.getString(cursor.getColumnIndex(Database_helper_class.QUES_COLUMN));
            String str_id = cursor.getString(cursor.getColumnIndex(Database_helper_class.ANS_COLUMN));
            //double str_gpa = cursor.getDouble(cursor.getColumnIndex(Database_helper_class.GPA_COLUMN));


            // Finish reading one raw, now we have to pass them to the POJO
            nameclass nameclassobj1=new nameclass();
            nameclassobj1.setname(str_name);
            nameclassobj1.setid(str_id);
            //nameclassobj1.setgpa(str_gpa);

            // Lets pass that POJO to our ArrayList which contains undergraduates as type
              pojo_namelist.add(nameclassobj1);

            // But we need a List of String to display in the ListView also.
                //That is why we create "nameList"
            namelist.add(str_name);

        }
        sqlitedatabase.close();
  • 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-08T19:37:50+00:00Added an answer on June 8, 2026 at 7:37 pm

    Sorry for late reply, got busy in other application

    Actually the data was not saved in the database, that is why i was not getting it on device.
    It works now.

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

Sidebar

Related Questions

I am developing an learning type application for iOS using HTML5/PhoneGap, but facing some
I am working on learning in-app billing but I am having a problem with
So I'm working on learning PDO, and making the transfer from the standard PHP
I have been working on learning the Android NDK the past few days, but
I'm working on learning Objective-C/Coaoa, but I've seem to have gotten a bit stuck
I am working on learning how to use git and the section I am
I'm working on machine learning problem and want to use linear regression as learning
I am learning how to use JQuery to help check data availability. To start
I'm currently working on a WPF application, it's my first so I'm learning as
I'm working with a wsdl file, and learning quite a lot from the whole

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.