Clear
adb shell pm clear your.package
Relaunch
adb shell am start -a android.intent.action.MAIN -n your.package/.YourLaunchActivity
gem 'ruport' | |
gem 'acts_as_reportable' | |
gem 'state_machine' | |
# use ap instead of p to print nicer | |
gem 'awesome_print' | |
gem 'acts_as_api' | |
gem 'rolify' |
Clear
adb shell pm clear your.package
Relaunch
adb shell am start -a android.intent.action.MAIN -n your.package/.YourLaunchActivity
runner: | |
extensions: | |
spec: | |
coffee: "mocha" | |
scopes: | |
coffee: "coffee" | |
go: "go run" | |
js: "node" | |
python: "python" | |
ruby: "ruby" |
public static String getJSONFromBundle(Bundle bundle) { | |
if (bundle == null || Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { | |
return null; | |
} | |
JSONObject json = new JSONObject(); | |
Set<String> keys = bundle.keySet(); | |
for (String key : keys) { | |
try { | |
// json.put(key, bundle.get(key)); see edit below | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
// DO | |
if(cursor.moveToFirst()) { | |
do { | |
// do stuff with the cursor | |
} while (cursor.moveToNext()); | |
} | |
cursor.close(); | |
// DON'T | |
while (cursor.moveToNext()) { |
// Generate a version string based on git | |
def computeVersionName = { | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'describe', '--tags' // or commandLine 'git', 'rev-parse', 'HEAD' | |
standardOutput = stdout | |
} | |
return stdout.toString().trim() | |
} |
public class MyActivity extends Activity { | |
private TextView mTextView; | |
private ImageView mLogo; | |
private ImageView mStars; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_my); |
I hereby claim:
To claim this, I am signing this object:
int pxDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 80, getResources().getDisplayMetrics()); | |
int pxDp = (int) (getResources().getDisplayMetrics().density * px + 0.5f); |