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
package com.antmobile.java; | |
import rx.Observable; | |
import rx.Subscriber; | |
import rx.schedulers.Schedulers; | |
public class FirstTempClass { | |
public static void main(String[] args) { | |
final Observable<Long> observable = Observable.create(new Observable.OnSubscribe<Long>() { |
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
if (Build.VERSION.SDK_INT>=16) { // this is only for Jelly Bean and up | |
LinearLayout container = (LinearLayout) getView().findViewById(R.id.container); | |
LayoutTransition transition = container.getLayoutTransition(); | |
transition.enableTransitionType(LayoutTransition.CHANGING); | |
} |
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
for f in *.png; do convert $f -resize 400x210 $(basename $f .png).png;done |
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
for f in *.tif; do convert $f $(basename $f .tif).png;done |
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
/** | |
* starts google maps w/ lat lon | |
*/ | |
public static void showOnMap(Context c, double lat, double lng, String name) { | |
String geoUri = "geo:"+lat+","+lng+"?q="+lat+","+lng+"("+name+")"; | |
Uri geo = Uri.parse(geoUri); | |
Intent intent = new Intent(Intent.ACTION_VIEW); | |
intent.setData(geo); | |
intent.setClassName("com.google.android.apps.maps","com.google.android.maps.MapsActivity"); | |
if (intent.resolveActivity(c.getPackageManager()) != null) { |
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.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.drawable.*; | |
import android.util.AttributeSet; | |
import com.android.volley.toolbox.NetworkImageView; | |
public class FadeInNetworkImageView extends NetworkImageView { | |
private static final int FADE_IN_TIME_MS = 250; |
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 String computeMD5Hash(String password) | |
{ | |
try { | |
// Create MD5 Hash | |
MessageDigest digest = java.security.MessageDigest.getInstance("MD5"); | |
digest.update(password.getBytes()); | |
byte messageDigest[] = digest.digest(); | |
StringBuffer MD5Hash = new StringBuffer(); | |
for (int i = 0; i < messageDigest.length; i++) |
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 url = "http://www.example.com"; | |
Intent i = new Intent(Intent.ACTION_VIEW); | |
i.setData(Uri.parse(url)); | |
startActivity(i); |
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
/** | |
* Copyright 2013 Ognyan Bankov | |
* modified by Michal Ursiny for purposes of Fuerte Eshop adding headers and body support | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
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
#!/usr/bin/python | |
from xml.dom.minidom import parse | |
dom1 = parse("AndroidManifest.xml") | |
oldVersion = dom1.documentElement.getAttribute("android:versionName") | |
oldVersionCode = dom1.documentElement.getAttribute("android:versionCode") | |
versionNumbers = oldVersion.split('.') | |
versionNumbers[-1] = unicode(int(versionNumbers[-1]) + 1) | |
dom1.documentElement.setAttribute("android:versionName", u'.'.join(versionNumbers)) |
NewerOlder