Author Archives: Jack

How to use Unix Timestamp with Java

You can use a unix timestamp in java wit the following code:

import java.util.Date;
String TimeStamp = "1324716371";
Date time=new Date((long)TimeStamp*1000);

Now, timestamp doesn't have to be a string, however in many of your projects you may have the value in that format. In this case, we convert it to a long (integer is too small), and then multiply it by 1000 since Java uses milliseconds.

How to remove the title or "Application Name" bar

To remove the bar that appears at the top of your activity, modify your AndroidManifest.xml document.  Foreach activity, add the line:

android:theme="@android:style/ThemeNoTitleBar.Fullscreen"

Making the result look like:

<activity android:name=".MainActivity"
          android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen">