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
public class MyAppClass extends Application | |
{ | |
public static Typeface FONT_AWESOME; | |
public static FontAwesomeHelper FONT_AWESOME_HELPER; | |
@Override | |
public void onCreate() | |
{ | |
super.onCreate(); | |
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
//This demo app Assumes there are 2 jpg files on the sdcard in the root directory | |
public class MainActivity extends ActionBarActivity { | |
ImageView img; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
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
class CreateShareImage extends AsyncTask<String, Void, String> { | |
@Override | |
protected void onPreExecute() { | |
} | |
@Override | |
protected String doInBackground(String... params) { | |
Bitmap bkgImage = BitmapFactory.decodeResource( | |
MainActivity.this.getResources(), R.drawable.stork); | |
Bitmap mutableBitmap = bkgImage.copy(Bitmap.Config.ARGB_8888, true); |
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
public class BlehActivity extends Activity { | |
private Handler handler; | |
private ProgressBar progress; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
progress = (ProgressBar) findViewById(R.id.progressBar1); | |
handler = new Handler(); |
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
String sourceString = ""; | |
HttpURLConnection connection; | |
OutputStreamWriter request = null; | |
URL url = null; | |
String response = null; | |
String params = "refext=http://offliberty.com&track=" + uri[0]; | |
try { |
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
public class ReverseGeoAsync extends AsyncTask<String, String, String> { | |
public interface AsyncDone { | |
void networkRequestCompleted(String res); | |
} | |
private AsyncDone _listener; | |
public ReverseGeoAsync(AsyncDone listenerParam) { | |
_listener = listenerParam; | |
} | |
@Override | |
protected String doInBackground(String... uri) { |
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 com.example.streetview.HttpRequest.NetworkListener; | |
public class MainActivity extends Activity implements NetworkListener { | |
ImageView iv; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
iv = (ImageView) findViewById(R.id.img); |
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
public class Act extends Activity { | |
OnTaskCompleted otc = new OnTaskCompleted() { | |
@Override | |
public void onTaskCompleted(String result) { | |
Log.d("onTaskCompleted", result); | |
} | |
}; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
//**in the service (ServiceX) | |
public static boolean isRunning(Context ctx) { | |
sharedPref = ctx.getSharedPreferences("my_pref", MODE_PRIVATE); | |
return sharedPref.getBoolean("running", false); | |
} | |
private void setRunning(boolean running) { | |
sharedPref = getSharedPreferences("my_pref", MODE_PRIVATE); | |
SharedPreferences.Editor prefEditor = sharedPref.edit(); | |
prefEditor.putBoolean("running", running); | |
prefEditor.commit(); |
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
find someDir/ -iname "*.flv" -exec ffmpeg -i {} -sameq -ar 22050 {}.mp4 ";" -ls | |
vlc * --sout '#transcode{vcodec=h264,vb=92,channels=1,ab=16,samplerate=1024,width=320}:standard{access=http,mux=ts,dst=:666/tv.mp4}' --random --sout-keep | |
awk -F'[ "]+' '$7 == "/" { ipcount[$1]++ }END { for (i in ipcount) {printf "%15s - %d\n", i, ipcount[i] } }' /var/log/apache2/access.log | |
ffmpeg -loop 1 -shortest -y -i img.jpg -i snd.wav -acodec copy -vcodec mjpeg out.avi | |
ls * |sort > play.txt | |
cat play.txt | while IFS= read -r f; do printf "%05d %s\n" "$RANDOM" "$f"; done | sort -n | cut -c7- >> play.m3u | |
sed -e 's/$/\nwf.mp4/' -i play.m3u |
NewerOlder