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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:26:44+00:00 2026-05-27T11:26:44+00:00

In my app i store my rss news in a database.When the user get

  • 0

In my app i store my rss news in a database.When the user get into my news activity with internet i call createEnty(); method

HotOrNot entry = new HotOrNot(agones.this);

            entry.open();

            entry.createEntry(msg.getTitle(), msg.getagonistiki(), msg
                    .getskor(), msg.getgipedo(), msg.getDate(),msg.getgoal1(),msg.getgoal2(),msg.getDescription());

            // entry.update(msg.getTitle(),msg.getagonistiki(),msg.getskor(),msg.getgipedo(),msg.getDate());

            entry.close();

(in HotOrNot)

public void createEntry(String title, String getagonistiki, String getskor,
        String getgipedo, String date, String getgoal1, String getgoal2, String teliko_skor) {
    // TODO Auto-generated method stub
    ContentValues cv=new ContentValues();
    cv.put(DBHelper.TITLE, title);
    cv.put(DBHelper.AGONISTIKI, getagonistiki);
    cv.put(DBHelper.SKOR, getskor);
    cv.put(DBHelper.GIPEDO, getgipedo);
    cv.put(DBHelper.DATE, date);
    cv.put(DBHelper.GOALA, getgoal1);
    cv.put(DBHelper.GOALB, getgoal2);
    cv.put(DBHelper.DESCRIPTION, teliko_skor);


    try
    {
        ourDatabase.insert("osfpDB",null,cv);
    }       //ourDatabase.update("osfpDB",cv,DBHelper.ROWID,null);

    catch(Exception e)
    {
        Log.e("DB ERROR ON .INSERT", e.toString()); // prints the error message to the log
        e.printStackTrace(); // prints the stack trace to the log
    }

}

Then,when the user gets into news activity without internet i m calling getData();

public Cursor getData() 
{ 

String[] columns =new String[]{DBHelper.ROWID, DBHelper.TITLE , DBHelper.AGONISTIKI, DBHelper.SKOR, DBHelper.GIPEDO, DBHelper.DATE, DBHelper.GOALA, DBHelper.GOALB, DBHelper.DESCRIPTION }; 
Cursor c=ourDatabase.query(DBHelper.DATABASE_TABLE, columns, null, null, null, null, null); 
return c; 
}

My problem is that every time the user get into news activity with internet connection,the database writes all the data again from the beginning.I mean that if the first time there are 12 news,they are writing to the database.If the second time there are 12 news again,the same 12 news,the app rewrites them and i have 24 entries in my database and not 12 that i would like to have.So i m looking for a way to delete my database every time that the user has internet and recreate it,or rewrite the database every time….PLease help,i have been stacked here for days…:)

@Guillaume i m trying this but i m getting an empty database

HotOrNot entry = new HotOrNot(agones.this);
            agones.this.deleteDatabase(DBHelper.DATABASE_NAME);

            entry.open();

            entry.createEntry(msg.getTitle(), msg.getagonistiki(), msg
                    .getskor(), msg.getgipedo(), msg.getDate(),msg.getgoal1(),msg.getgoal2(),msg.getDescription());

            // entry.update(msg.getTitle(),msg.getagonistiki(),msg.getskor(),msg.getgipedo(),msg.getDate());

            entry.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-05-27T11:26:44+00:00Added an answer on May 27, 2026 at 11:26 am

    I think you can write delete * from scripts on on internet connection action.

    Delete * clears entries in database, it doesn’t remove tables. So, on next action you can insert what ever you want.

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

Sidebar

Related Questions

I have a News Webserver where registered user can get RSS News. I want
I'm having trouble with a Mac App Store submission. I'm using the method below
I have an app in the app store which a database in the resources
The application update process via app store (on the device by a lambda user)
Many apps already in App Store has ability to print from iphone without installing
When submitting an app to the app store what is the real difference between
I upload my app to app store, I already build my apps using device
I submitted an iPhone application to the app store, but it is failed to
I created an iPhone application for the App Store. I hear that some things
Possible duplicate: How can i give app store link in my apps before approving

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.