This file contains hidden or 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
/* .... */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
// MRTIPS "Incantation" Section ---------------------------- | |
//create a string array with the tips' ids from values/mrtips_arrays.xml |
This file contains hidden or 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 TTSTestActivity extends Activity implements OnInitListener { | |
private static final int MY_DATA_CHECK_CODE = 0; | |
private TextToSpeech mTts; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
setContentView(R.layout.tts_layout); | |
// check whether TTS resources are available on the device | |
Intent checkIntent = new Intent(); |
This file contains hidden or 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
<application ... > | |
<activity android:name=".MainSearchableActivity" > | |
<intent-filter> | |
<action android:name="android.intent.action.SEARCH" /> | |
</intent-filter> | |
<meta-data android:name="android.app.searchable" | |
android:resource="@xml/searchable"/> | |
</activity> | |
... | |
</application> |
This file contains hidden or 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
private static boolean checkConnectivity(Context context){ | |
ConnectivityManager connec = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
return (connec.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState() == NetworkInfo.State.CONNECTED || connec.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState() == NetworkInfo.State.CONNECTED); | |
} |
This file contains hidden or 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
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:id="@android:id/background"> | |
<shape> | |
<corners android:radius="5dip" /> | |
<gradient | |
android:startColor="#ff9d9e9d" | |
android:centerColor="#ff5a5d5a" | |
android:centerY="0.75" | |
android:endColor="#ff747674" |
This file contains hidden or 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 OAuthActivity extends Activity { | |
public static String OAUTH_URL = "https://github.com/login/oauth/authorize"; | |
public static String OAUTH_ACCESS_TOKEN_URL = "https://github.com/login/oauth/access_token"; | |
public static String CLIENT_ID = "YOUR_CLIENT_ID"; | |
public static String CLIENT_SECRET = "YOUR_CLIENT_SECRET"; | |
public static String CALLBACK_URL = "http://localhost"; | |
@Override |
This file contains hidden or 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
int id = getResources().getIdentifier("name_of_resource", "id", getPackageName()); |
This file contains hidden or 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 org.apache.commons.lang3.StringUtils | |
... | |
StringUtils.isBlank(myString) |
This file contains hidden or 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
MainActivity.this.runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
// Code to run on UI | |
} | |
}); |
OlderNewer