Android Open Source - simpleplayer File Format






From Project

Back to project page simpleplayer.

License

The source code is released under:

GNU General Public License

If you think the Android project simpleplayer 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.sergez.splayer.util;
/*from   www  .j a  v a  2s  .co m*/
import java.util.HashSet;
import java.util.Set;

/**
 * @author Sergii Zhuk
 */
public final class FileFormat {
  private static Set<String> supportedFormats;

  static {
    int currentApiVersion = android.os.Build.VERSION.SDK_INT;
    supportedFormats = new HashSet<String>() {
      /**
       *
       */
      private static final long serialVersionUID = -4082075857631915042L;

      {
        add("mp3");
        add("wav");
        add("midi");
        add("wma");
        add("mp4");
        add("m4a");
        add("ogg");
        add("amr");
        add("imy");
        add("ota");
        add("mid");
        add("xmf");
        add("rtttl");
        add("rtx");
      }
    };
    if (currentApiVersion >= 12) {
      supportedFormats.add("flac");
      supportedFormats.add("ts");
      supportedFormats.add("aac");
    }
  }

  /**
   * Check filename for acceptable media format /e.g. mp3, wav etc
   *
   * @param filename
   * @return
   */
  public static boolean acceptableFormat(String filename) {
    int dotPos = filename.lastIndexOf(".");
    String ext = filename.substring(dotPos + 1).toLowerCase();
    if ((dotPos > 0) && (supportedFormats.contains(ext))) {
      return true;
    } else {
      return false;
    }
  }
}




Java Source Code List

org.sergez.splayer.activity.AnimationMakeGoneListener.java
org.sergez.splayer.activity.AudioFxDemo.java
org.sergez.splayer.activity.DonationActivity.java
org.sergez.splayer.activity.ListData.java
org.sergez.splayer.activity.PlayFileAdapter.java
org.sergez.splayer.activity.PreferencesActivity.java
org.sergez.splayer.activity.SimplePlayerActivity.java
org.sergez.splayer.enums.RepeatState.java
org.sergez.splayer.enums.ShuffleState.java
org.sergez.splayer.inappbilling.Base64DecoderException.java
org.sergez.splayer.inappbilling.Base64.java
org.sergez.splayer.inappbilling.IabException.java
org.sergez.splayer.inappbilling.IabHelper.java
org.sergez.splayer.inappbilling.IabResult.java
org.sergez.splayer.inappbilling.Inventory.java
org.sergez.splayer.inappbilling.Purchase.java
org.sergez.splayer.inappbilling.Security.java
org.sergez.splayer.inappbilling.SkuDetails.java
org.sergez.splayer.service.SimplePlayerService.java
org.sergez.splayer.util.Constants.java
org.sergez.splayer.util.DialogUtils.java
org.sergez.splayer.util.DurationAlbumID.java
org.sergez.splayer.util.FileFormat.java
org.sergez.splayer.util.MediaFileData.java
org.sergez.splayer.util.MediaFileUtil.java
org.sergez.splayer.util.PlayerState.java
org.sergez.splayer.util.PrefsConstants.java
org.sergez.splayer.util.PrefsController.java
org.sergez.splayer.util.SortIgnoreCase.java
org.sergez.splayer.util.UIStateController.java
org.sergez.splayer.util.Utils.java
org.sergez.splayer.view.ScrollingTextView.java