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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:02:53+00:00 2026-05-27T19:02:53+00:00

I want to insert values in my data base using timer i started with

  • 0

I want to insert values in my data base using timer i started with using the timer to display a msg and it work but when i added the call of th function that insert values just the msg display and no data inserted!! here is my code

public class TimertestActivity extends Activity {
    private double lat;
    private double lng;

    Handler handler = new Handler();
    Runnable runnable = new Runnable() {
        public void run() {
            afficher();

        }
    };

    /** Called when the activity is first created. */

      @Override   
      public void onCreate(Bundle icicle) {   
        super.onCreate(icicle);   
        setContentView(R.layout.main);  
        lat = 123456.98;
        lng = 321654.78;
        runnable.run();
      }   

     public void afficher()
      {
          Toast.makeText(getBaseContext(),
                     "lat" +lat+ "lng" +lng,
                     Toast.LENGTH_SHORT).show();
          insertvalues(lat, lng);
          handler.postDelayed(runnable, 25000);
      }
     public void insertvalues(double lat, double lng){

          //http post c à d envoi des données
          try{
                HttpClient httpclient = new DefaultHttpClient();
                HttpPost httppost = new   
                HttpPost("http://www.pizza-paris.com/clic/marwa/test/form.php?lat="+lat+"&lng="+lng);
                HttpResponse response = httpclient.execute(httppost);
                HttpEntity entity = response.getEntity();
                InputStream is = entity.getContent();
                Log.i("postData", response.getStatusLine().toString());
            }
            catch(Exception e)
            {
                Log.e("log_tag", "Error in http connection "+e.toString());
            }       
            }
}
  • 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-27T19:02:54+00:00Added an answer on May 27, 2026 at 7:02 pm

    The solution was to add internet permissions to his manifest. It’s always the simple things.

    Please read this link for information on permissions.

    The correct format would be:

    <uses-permission
            android:name="android.permission.INTERNET" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using VB.Net I want to get a all datagrid cell values, then insert into
I am wanting to insert a datetime into a MySql data base using Java
I want to insert data into my MySQL database using PowerShell. My code is
I want to replace and insert escape character sequences with their escape character values,
I want to do something like this INSERT INTO t (t.a, t.b, t.c) VALUES
I execute an INSERT INTO statement cursor.execute(INSERT INTO mytable(height) VALUES(%s),(height)) and I want to
I want to insert something into a STL list in C++, but I only
Hello i want to send to a MySQL data base a date and time
I am using an SQL query to insert data from an excel worksheet into
I'm inserting data from a jsf page to database using managed beans. But the

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.