Skip to content

Instantly share code, notes, and snippets.

View jerolimov's full-sized avatar

Christoph Jerolimov jerolimov

View GitHub Profile
@jerolimov
jerolimov / LazyStartingInputStream.java
Created August 9, 2011 12:02
LazyStartingInputStream
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
public class LazyStartingInputStream extends FilterInputStream {
private final byte[] startingAfter;
private int foundAlready = 0;
@jerolimov
jerolimov / SdcardFolder.java
Created January 10, 2011 11:33
Load Android SDCard Folder for different devices (Android Standard, Samsung Galaxy S, HTC Incredible)
private String getSdcardFolder() {
File externalStorage = Environment.getExternalStorageDirectory();
if (externalStorage.exists() && externalStorage.canWrite()) {
File trySubDir1 = new File(externalStorage, "external_sd");
File trySubDir2 = new File(externalStorage, "sd");
if (trySubDir1.exists() && trySubDir1.canWrite()) {
return trySubDir1.getAbsolutePath();
} else if (trySubDir2.exists() && trySubDir2.canWrite()) {
return trySubDir2.getAbsolutePath();
} else {
@jerolimov
jerolimov / tabsample.xml
Created October 9, 2010 10:15
Android TabHost TabWidget TabContent widget sample
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget