Guides, resources, notes, docs and knowledge for everything Oscar.
TagsDownload Android Studio and SDK Tools
Editor > Tear line: #586672
Use x86 images instead of x86_64, for faster boot-up of emulator
File > Import settings…
defaults write com.google.android.studio AppleFontSmoothing -int 1
defaults write com.google.android.studio AppleWindowTabbingMode manual
cd ~
touch .bash_profile
open -e .bash_profile
Add to .bash_profile
export PATH=$PATH:/Users/username/Library/Android/sdk/platform-tools/
source .bash_profile
adb version
Add adb to path variable
%localappdata%\Android\sdk\platform-tools
adb devices -l
adb install app-release.apk
adb -s "<deviceId>" install app-release.apk
adb uninstall com.package.name
adb shell monkey -p your.app.package.name 1
adb shell input text 'my string here. With some characters escaped like \$ that'
*#*#2846579#*#*
adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "LINK"
Background setting > Log Setting
adb shell /system/bin/screencap -p /sdcard/screenshot.png && adb pull /sdcard/screenshot.png screenshot$(date +"%Y%m%dT%I%M%S").png
android.*
when debuggning
Setup horizontal scroll wheel to Alt + ←/
Shortcut | Action |
---|---|
Ctrl + NumPad + | Increase Font Size |
Ctrl + NumPad - | Decrease Font Size |
Ctrl + NumPad-0 | Reset Font Size |
Ctrl + R | Refactor This… |
Ctrl + NumPad , | Run |
Alt + NumPad , | Run… |
Ctrl + Shift + NumPad , | Run |
Alt + Shift + NumPad , | Run… |
Alt + NumPad + | Apply Changes |
Alt + ' | VCS popup |
Ctrl + NumPad 1 | Toggle Presentation mode |
Ctrl + NumPad 2 | Toggle Distraction Free mode |
Ctrl + NumPad 3 | Toggle Full Screen mode |
Ctrl + Enter | Complete Current Statement |
Ctrl + Space | Code Completion SmartType |
Ctrl + Shift + Enter | Code Completion Basic |
Alt + Page Up/Page Down | Move to opposite group |
Ctrl + W | Close tab |
Ctrl + Alt + Shift + ↑/↓ | Go to previous/next change |
Ctrl + Alt + , | Attach debugger to process… |
Add shared scope “Generated files”.
Pattern: file[app]:build//*
Apply file color to scope.
Template text:
android.content.Intent intent = new Intent(this, $className$.class);
intent.putExtra($CURSOR$);
startActivity(intent);
Reformat according to style
Template variables
Name | Expression | Default value | Skip if defined |
---|---|---|---|
className | classNameComplete() | ||
CURSOR |
Template text:
Snackbar.make(findViewById(R.id.$resId$), "$text$", Snackbar.LENGTH_SHORT).show();
Reformat according to style
Template variables
Name | Expression | Default value | Skip if defined |
---|---|---|---|
resId | completeSmart() | ||
text |
Applicable in Java: statement.
tools:
namespace in layout-files for previewing in Android StudioWhen switching between a debug apk and a signed release apk on the same device, remember to first uninstall the debug apk for all users.
Edit Custom VM options…
-Xms256m
-Xmx1024m
C:\Users\Oscar.gradle\gradle.properties
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX: +HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.configureondemand=true
Turn off animations on your test device, otherwise Espresso may not work as expected and the tests may fail. Turn off animations from Settings by opening Developer Options and turning all the following options under “Drawing” off: