Skip to content

Instantly share code, notes, and snippets.

@laithnurie
laithnurie / gist:544802b49e818575e00a
Created December 8, 2015 22:38
extract meta data from mp3 files
String artist = null;
String album = null;
String track = null;
byte[] imageData = null;
long duration = 0;
try {
Mp3File mp3file = new Mp3File(songLocation);
if (mp3file.hasId3v2Tag()) {
ID3v2 id3v2Tag = mp3file.getId3v2Tag();
imageData = id3v2Tag.getAlbumImage();
@laithnurie
laithnurie / MediaPlayerService.java
Last active November 14, 2015 21:20
Media player service
package com.laithlab.core.service;
import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.MediaPlayer;
@laithnurie
laithnurie / gist:1d709404beacceafd417
Created September 11, 2015 20:17
Overlay button over device
import android.app.Service;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.os.IBinder;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
@laithnurie
laithnurie / index.html
Created June 15, 2013 20:23
A CodePen by laithnurie. Try to Focus - Can easily cause headaches
<div class="container">
<canvas></canvas>
<p class="text">Try to F<span>o</span>cus</p>
</div>