Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>JavaAndroid SnippetsNew to Visual Studio Code? Get it now.
JavaAndroid Snippets

JavaAndroid Snippets

Dor Perets

|
3,147 installs
| (2) | Free
Snippets for Java Android
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

JavaAndroid snippets

JavaAndroid snippets

Features

Android: | Usage | Description | | ------------ | ---------------- | | onc, oncreate | onCreate function | | onr, onresume | onResume function | | onp, onpause | onPause function | | ond, ondestroy | onDestroy function | | mContext, ctxt, mctxt | mContext init + assign | | br, receiver, onreceive | BroadcastReceiver | | setprop, setp | Set SystemProperty | | getprop, getp | Get SystemProperty | | tag | LogTAG for class | | logi | Log.i | | loge | Log.e | | view, fvbi | FindViewById | | onclick, clicker | onClickListener lambda | | svc, service | Service class |

Java: | Usage | Description | | ------------ | ---------------- | | for, fori | for loop with index | | foreach | for each loop | | ifn, nullcheck | If null statement | | ifnn, inn, notnull | If not null statement | | th, thread | wait for thread | | sw, switch | Switch-Case | | try | try-catch block on Selected Text | | func, foo | create new method | | psf, const, psfs | Create Constant | | var, variable | Create Variable | | sngl, singleton | Singleton class |

Extension Settings

use Tab / Enter for completion.

on settings, enable those:

"editor.tabCompletion": "on"
"editor.snippetSuggestions": "top"

License

dorperets/JavaAndroid-snippets is provided and distributed under the Apache Software License 2.0.

Refer to LICENSE for more information.

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft