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
adb shell | |
screenrecord --verbose /sdcard/demo.mp4 | |
`ctrl-c` | |
exit | |
adb pull /sdcard/demo.mp4 |
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 static Uri addImageToGallery(Context context, String filepath, String title, String description) { | |
ContentValues values = new ContentValues(); | |
values.put(Media.TITLE, title); | |
values.put(Media.DESCRIPTION, description); | |
values.put(Images.Media.DATE_TAKEN, System.currentTimeMillis()); | |
values.put(Images.Media.MIME_TYPE, "image/jpeg"); | |
values.put(MediaStore.MediaColumns.DATA, filepath); | |
return context.getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values); | |
} |
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
FullScreenDialog dialog = new FullScreenDialog(); | |
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); | |
dialog.show(ft, FullScreenDialog.TAG); |
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
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_dropdown_item) { | |
@Override | |
public View getView(int position, View convertView, ViewGroup parent) { | |
View v = super.getView(position, convertView, parent); | |
if (position == getCount()) { | |
((TextView)v.findViewById(android.R.id.text1)).setText(""); | |
((TextView)v.findViewById(android.R.id.text1)).setHint(getItem(getCount())); //"Hint to be displayed" | |
} |
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
/** | |
* copy from the internets: | |
* http://stackoverflow.com/questions/16030667/displaying-card-flip-animation-on-old-android | |
* | |
*/ | |
public class FlipAnimation extends Animation | |
{ | |
private Camera camera; | |
private View fromView; |
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
Lighter / Darker - http://hexcolortool.com/ | |
Taken from here: http://stackoverflow.com/questions/15852122/hex-transparency-in-colors | |
100% — FF | |
95% — F2 | |
90% — E6 | |
85% — D9 | |
80% — CC | |
75% — BF |
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
Get dev keystore fingerprint | |
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android | |
Get prod keystore fingerprint | |
keytool -list -keystore your_keystore_name | |
Change store password | |
keytool -storepasswd -keystore keystorename | |
Enter keystore password: <old password> |
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
Intent emailIntent = new Intent(); | |
emailIntent.setAction(Intent.ACTION_SEND); | |
// Native email client doesn't currently support HTML, but it doesn't hurt to try in case they fix it | |
emailIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(extraText)); | |
emailIntent.putExtra(Intent.EXTRA_SUBJECT, extraSubject); | |
emailIntent.setType("message/rfc822"); | |
PackageManager pm = getPackageManager(); | |
Intent sendIntent = new Intent(Intent.ACTION_SEND); | |
sendIntent.setType("text/plain"); |