This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.PowerManager; | |
public class DoNotDimScreen extends Activity { | |
private PowerManager.WakeLock wl; | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Retrieve a list of Music files currently listed in the Media store DB via URI. | |
//Some audio may be explicitly marked as not being music | |
String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0"; | |
String[] projection = { | |
MediaStore.Audio.Media._ID, | |
MediaStore.Audio.Media.ARTIST, | |
MediaStore.Audio.Media.TITLE, | |
MediaStore.Audio.Media.DATA, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); | |
WifiInfo wifiInfo = wifiManager.getConnectionInfo(); | |
int ipAddress = wifiInfo.getIpAddress(); | |
String ip = intToIp(ipAddress); | |
public String intToIp(int i) { | |
return ((i >> 24 ) & 0xFF ) + "." + | |
((i >> 16 ) & 0xFF) + "." + | |
((i >> 8 ) & 0xFF) + "." + |