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
#!/bin/sh | |
# | |
# --------------------------------------------------------------------- | |
# Android Studio startup script. | |
# --------------------------------------------------------------------- | |
# | |
message() | |
{ | |
TITLE="Cannot start Android Studio" |
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
package com.phtrivedi.opensource.externalfilewriter; | |
import android.content.Context; | |
import android.os.Environment; | |
import android.os.StatFs; | |
import android.text.TextUtils; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; |
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
apply plugin: 'maven-publish' | |
group = 'grpId' | |
version = '1.0.1-SNAPSHOT' | |
android.libraryVariants | |
publishing { | |
publications { |
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
//In onCreate after initializing actionbar | |
int currentapiVersion = android.os.Build.VERSION.SDK_INT; | |
if (currentapiVersion >= VERSION_CODES.ICE_CREAM_SANDWICH) { | |
// Do something for froyo and above versions | |
try { | |
Field actionBarField = actionBar.getClass().getDeclaredField("mActionBar"); | |
actionBarField.setAccessible(true); | |
enableEmbeddedTabs(actionBarField.get(actionBar)); | |
} catch (Exception e) { | |
Log.e(TAG, "Error enabling embedded tabs", e); |
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
package com.zoomimob_faculty.utils; | |
import android.content.ContentResolver; | |
import android.content.ContentUris; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.net.Uri; | |
import android.os.Environment; | |
import android.provider.DocumentsContract; |
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
// more information here: http://blog.tomtasche.at/2012/10/use-built-in-feedback-mechanism-on.html | |
try { | |
int i = 3 / 0; | |
} catch (Exception e) { | |
ApplicationErrorReport report = new ApplicationErrorReport(); | |
report.packageName = report.processName = getApplication() | |
.getPackageName(); | |
report.time = System.currentTimeMillis(); | |
report.type = ApplicationErrorReport.TYPE_CRASH; |
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
apply plugin: 'com.android.application' | |
repositories { | |
maven { | |
url 'http://google-api-client-libraries.appspot.com/mavenrepo' | |
} | |
mavenCentral() | |
mavenLocal() | |
} |
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
package com.celites.wishnu.utils; | |
import android.app.AlertDialog; | |
import android.app.AlertDialog.Builder; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.DialogInterface.OnClickListener; | |
import android.content.SharedPreferences; | |
import android.util.DisplayMetrics; | |
import com.celites.wishnu.R; |
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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
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
/** | |
* This is to demo comma ellipsize | |
* Output will be: 2014 fifa worldcup quarterfinalists were Germany,Argentina,Netherlands,Brasil and 4 more | |
*/ | |
private void commaEllipsizeDemo(TextView text) { | |
//Following is the original text, which will be ellipsied | |
final String string = "Germany,Argentina,Netherlands,Brasil,France,Belgium,Costa Rica,Colombia"; | |
//Fetch the textpaint from above text | |
final TextPaint paint = text.getPaint(); | |
//Following is the text which will be shown anyway. |
OlderNewer