Android Open Source - intent_radio Build






From Project

Back to project page intent_radio.

License

The source code is released under:

Copyright (c) 2014 Stephen Blott Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Soft...

If you think the Android project intent_radio listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.smblott.intentradio;
//from   w  w  w.  j av a2 s.  c om
import android.content.Context;
import android.content.pm.ApplicationInfo;
import java.util.zip.ZipFile;
import java.util.zip.ZipEntry;
import java.text.SimpleDateFormat;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;

public class Build
{
   static private String build = null;

   // source: http://stackoverflow.com/questions/7607165/how-to-write-build-time-stamp-into-apk
   //
   public static String getBuildDate(Context context)
   {
      if ( build != null )
         return build;

      try
      {
         ApplicationInfo info = context.getPackageManager().getApplicationInfo(context.getPackageName(), 0);
         ZipFile file = new ZipFile(info.sourceDir);
         ZipEntry entry = file.getEntry("classes.dex");
         long time = entry.getTime();
         build = SimpleDateFormat.getInstance().format(new java.util.Date(time));
      }
      catch (Exception e)
         { build = "Unknown"; }

      if ( debug_build(context)  )
         build += " [debug]";

      return build;
   }

   public static boolean debug_build(Context context)
   {
      int DEBUGGABLE = ApplicationInfo.FLAG_DEBUGGABLE;
      return (context.getApplicationInfo().flags & DEBUGGABLE) == DEBUGGABLE;
   }

   public static String version_string(Context context)
   {
      try
      {
         PackageInfo pinfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
         int version_code = pinfo.versionCode;
         String version_name = pinfo.versionName;
         return version_code + "-" + version_name;
      }
      catch (Exception e) {}

      return "Unknown";
   }
}




Java Source Code List

org.smblott.intentradio.Build.java
org.smblott.intentradio.ClipButtons.java
org.smblott.intentradio.Clipper.java
org.smblott.intentradio.Connectivity.java
org.smblott.intentradio.CopyResource.java
org.smblott.intentradio.Counter.java
org.smblott.intentradio.HttpGetter.java
org.smblott.intentradio.IntentPlayer.java
org.smblott.intentradio.IntentRadio.java
org.smblott.intentradio.Intents.java
org.smblott.intentradio.Later.java
org.smblott.intentradio.Logger.java
org.smblott.intentradio.Metadata.java
org.smblott.intentradio.Notify.java
org.smblott.intentradio.Now.java
org.smblott.intentradio.PlaylistM3u.java
org.smblott.intentradio.PlaylistPls.java
org.smblott.intentradio.Playlist.java
org.smblott.intentradio.PreferenceActivity.java
org.smblott.intentradio.Prefs.java
org.smblott.intentradio.ReadRawTextFile.java
org.smblott.intentradio.State.java
org.smblott.intentradio.WifiLocker.java