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
adb shell "run-as in.justickets.android.staging chmod 666 /data/data/in.justickets.android.staging/files/justickets.realm" | |
adb -d shell 'run-as in.justickets.android.staging cp /data/data/in.justickets.android.staging/files/justickets.realm /sdcard/justickets.realm' | |
adb pull /sdcard/justickets.realm |
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
private void createSimpleNotificationWithAction() { | |
NotificationCompat.Builder mBuilder = | |
new NotificationCompat.Builder(this) | |
.setSmallIcon(R.mipmap.ic_launcher) | |
.setContentTitle("My notification") | |
.setContentText("Hello World!"); | |
// Creates an explicit intent for an Activity in your app | |
Intent resultIntent = new Intent(this, MainActivity.class); | |
// The stack builder object will contain an artificial back stack for the |
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
private void createInboxStyleNotification() { | |
NotificationCompat.Builder mBuilder = | |
new NotificationCompat.Builder(this) | |
.setSmallIcon(R.mipmap.ic_launcher) | |
.setContentTitle("My notification") | |
.setContentText("Hello World!"); | |
NotificationCompat.InboxStyle inboxStyle = | |
new NotificationCompat.InboxStyle(); | |
String[] events = new String[6]; | |
events[0] = "Line 1"; |
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
private void createSimpleNotification() { | |
NotificationCompat.Builder mBuilder = | |
new NotificationCompat.Builder(this) | |
.setSmallIcon(R.mipmap.ic_launcher) | |
.setContentTitle("My notification") | |
.setContentText("Hello World!"); | |
// Creates an explicit intent for an Activity in your app | |
Intent resultIntent = new Intent(this, MainActivity.class); | |
// The stack builder object will contain an artificial back stack for the |
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
adb shell | |
run-as com.example.app | |
cp databases/failname.db /sdcard | |
exit | |
exit | |
adb pull /sdcard/failname.db |
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.msomu.popularmovies; | |
/** | |
* Created by msomu on 17/04/16. | |
*/ | |
/* | |
* Copyright (C) 2014 skyfish.jy@gmail.com | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. |
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
RelativeLayout.LayoutParams rlp = (RelativeLayout.LayoutParams) holder.image.getLayoutParams(); | |
float ratio = item.getHeight() / item.getWidth(); | |
rlp.height = (int) (rlp.width * ratio); | |
holder.image.setLayoutParams(rlp); | |
Picasso.with(holder.image.getContext()).load(item.getPic()).into(holder.image); | |
holder.text.setText(item.getName()); | |
holder.itemView.setTag(item); |
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.BitmapFactory; | |
import android.graphics.Matrix; | |
import android.net.Uri; | |
import android.util.Log; | |
import java.io.ByteArrayOutputStream; | |
import java.io.FileNotFoundException; |
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
// Simple GET request example: | |
$http({ | |
method: 'GET', | |
url: '/someUrl' | |
}).then(function successCallback(response) { | |
// this callback will be called asynchronously | |
// when the response is available | |
}, function errorCallback(response) { | |
// called asynchronously if an error occurs | |
// or server returns response with an error status. |
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.app.Activity; | |
import android.support.design.widget.TextInputLayout; | |
import android.view.View; | |
import android.view.WindowManager; | |
import android.widget.EditText; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; |