How can I get the seconds since 1.1.1970 as a long in Android?

by Streets Of Boston » Fri, 26 Feb 2010 04:00:55 GMT


Sponsored Links
 System.currentTimeMillis() gets you the number of milliseconds sinc
1/1/1970 00:00:00.000 UTC.




--



How can I get the seconds since 1.1.1970 as a long in Android?

by Martin » Fri, 26 Feb 2010 04:12:11 GMT


 Woow, thank you :-)
Greetings, Martin





--


Sponsored Links


Other Threads

1. Bluetooth in Android

Hello Everyone..

I want to connect another android device using bluetooth. I have tried
but was nt able to..
Can anyone help me

-- 

2. ANIMATION WITH BUTTON CLICK

hi,  I am new to android and I could nt able to solve this, I want to
create a button and with the click of the button the animation should
happen , whats the wrong with this , please help me with the sample
code

Help is always appreciated
Thanks



package com.transformation;

//import android.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation.AnimationListener;
import android.widget.Button;
import android.widget.LinearLayout;
public class Transformation extends Activity implements
AnimationListener {
  LinearLayout layout;
  LinearLayout layout2;
  Animation movement;
  Animation movement2;

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
   final Button button = (Button)findViewById(R.id.widget40);
   button.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {


            public void startAnimation(View v)

                // Get the layouts
                layout = (LinearLayout) findViewById(R.id.linearLayout1);
                layout2 = (LinearLayout) findViewById(R.id.linearLayout2);

                // Create animation for right image
                movement = AnimationUtils.loadAnimation(this,
R.layout.animation_test);
                movement.reset();
                movement.setAnimationListener(this);

                // Create animation for left image
                movement2 = AnimationUtils.loadAnimation(this,
R.layout.animation_test2);
                movement2.reset();
                movement2.setAnimationListener(this);


                // Start animation on each image
                layout2.startAnimation(movement2);
                layout.startAnimation(movement);}

              // Listen for animations to be finished
              // There are more efficient ways, I'm just being lazy.
              public void onAnimationEnd(Animation animation) {
                layout.setVisibility(View.INVISIBLE);
                layout2.setVisibility(View.INVISIBLE);
                // or do whatever it is you wanted to do here, like launch
another activity?
              }

              public void onAnimationRepeat(Animation animation) {
              }

              public void onAnimationStart(Animation animation) {
            }
            });


            }

@Override
public void onAnimationEnd(Animation animation) {
        // TODO Auto-generated method stub

}

@Override
public void onAnimationRepeat(Animation animation) {
        // TODO Auto-generated method stub

}

@Override
public void onAnimationStart(Animation animation) {
        // TODO Auto-generated method stub

}
          };

-- 

3. Streaming Live Video to Android

4. Android JNI + USB serial

5. How to run my applications more efficiently

6. ScheduledExecutorService memory leak question.

7. Setting border for Gridview