Shortcut to create new line in Android Studio editor - android

What is the shortcut to create a new line in Android Studio editor (like ctrl+enter in Visual Studio Code)?

I believe its Shift + Enter
If you want to change it ::
Go to File > Settings > Select Keymap > Select Editor Options > Start
a New Line

Shift + Enter
List of android studio keyboard shortcuts:
Android keyboard shortcuts

Related

VS code equivalent new line shortcut for Android studio

I am new to Android Studio, and since in VS Code we could go to a new line using the shortcut "ctrl + enter" from anywhere in the line. Is there a similar shortcut for Android Studio too?
"Shift + Enter" could do the trick.
More shortcuts here: https://developer.android.com/studio/intro/keyboard-shortcuts

Android Studio 3.2.1, XML bad indent format

After updating to Android Studio 3.2.1 the XML files format is very annoying and bad, how can we fix it? Can we change it from somewhere in settings to previews type?
On Android Studio 3, Go to :
Preferences > Editor > Code style > XML then on Scheme switch to Default instead of Project.
You can then use those shortcuts to indent your code:
Windows:
Ctrl + Alt + L
macOS:
Option + Command + L
You can edit your code styles under File > Settings > Editor > Code Style > XML
If you want to preview a specific file, just paste that file's contents into the preview window.
Open File > Settings > Editor > Code Style > XML
Now in layout file make sure you have selected wrap attributes as Wrap always.
Screenshot

how to change terminal font size on Android Studio?

I want to change the Terminal font size. But I have no idea to do it.
Who can solve it?
in window : File - > Settings - > Editor - > Color scheme -> Console Font
File > Settings (Ctrl + Alt + S) > Editor > Color Scheme > Console Font
Thanks for everyone, I have solve it. I also do this steps some days ago, but it is not effective immediately. I try to do it once again just now and then restart AndroidStudio , Everything is OK. Thanks!
In Android Studio 3.0 File > Settings > Editor > Color & Fonts > Console Font....then click Apply and Ok
If you are android studio version above 3.0 :
File > Settings > Editor(expand it) > Color scheme(Expand it) > Console Font > Tick checkbox of Use console font instead of default > Enter size of font you want use > click Apply > Click Ok

Android Studio Keyboard shortcut control

Can anyone give me some suggestion or link of all controls of Android Studio keyboard shortcuts?
Move to File -> Settings -> Keymap and change Keymaps settings to eclipse so that you can use the short cut keys like in eclipse.
Preferences > Keymap will show you all the keyboard bindings.
A couple helpful hints to help you find features:
You can search actions by name; on MacOS the keybinding is Command+Shift+A. You can start typing the name of a command and it will show you all matching commands and their key bindings if they have one. That's really convenient for looking up the key shortcut for something if you have a hint of what it's called.
In most dialogs/windows there's a search box, and you can usually just start typing to start a search. It's especially good for preferences, where there are so many options that are hard to find.
I may be late to answer this, but would like to help all others who come up to this page from now.
Here is the list of all the most productive shortcuts that I have been using regularly in my day to day Android development. It saves a lot of time, seriously.
Find only classes - CMD + o
Find files - CMD + Shift+ o
Find everything - Double Shift
Find symbol - CMD + Alt+ o
Find in page - CMD + f
Find usages - fn + Alt+ f7
Generate boilerplate code - CMD + j
Quick fix - Alt + Enter
Code completion - Ctrl + Space
Definition of a class or method - Alt + Space
Navigate to a class or method - CMD + Left Click
Refactor rename - fn + Shift+ f6
Run app - Ctrl + R
Format code - Alt + CMD+ L
Show documentation - fn + f1
Mode code up/down - Shift + CMD+ up/down
Generate Code - CMD + N
Recently opened files - CMD + e
Recently edited files - CMD + Shift+ e
Delete lines at one go - CMD + Delete
Add single line comment - CMD + /
Add block comment - CMD + Alt+ /
On the Mac OS go to Android Studio -> Preferences -> Keymap
to assign a keyboard shortcut, you need to navigate to
file --> setting --> keymap --> search and than right click and add keyboard shortcut --> in first stroke
you can add/change like
ex:
you want to assign Cntl + w than use Cntl with w
Android Studio > Preferences > Keymap > Select Your Option.
Default is: IntelliJ IDEA Classic
After Android Studio updating, you sometimes need to do that. For example, I updated Android Studio 4.2.1 and I did this because it turned automatically default Keymap which is IntelliJ IDEA Classic. I prefer to use MacOS.
Go to Help and select Default Keymap Reference will point you to one of these default keyboard shortcuts for Android Studio. It has all the keyboard shortcuts you can do in Android Studio. It's says for it's IntelliJIDEA but Android Studio is based off IntelliJIDEA, so all the keyboard shortcuts listed there apply in Android Studio.
Windows and Linux
Mac
Here is the official list of the shortcuts of Android Studio for Windows, Linux and Mac:
https://developer.android.com/studio/intro/keyboard-shortcuts.html#configure_custom_keymaps
if you have a favourite plugin that doesn't have a shortcut, just navigate to
Settings > KeyMap > Double click Plugins > Select desired plugin > Add
Keyboard Shortcut :: Then press down the hot keys you want to assign for the
plugin and click OK.
PS. be careful not to override any important AS shortcut.

Autocompletion not showing in Android Studio with dual screens

I just switched from Eclipse to Android Studio (IntelliJ).
I can't figure out how the autocompletion works! I tried Control + Space, Control + Shift + Space but i have no relevant suggestion. Not in the Java files, not in the layout files.
Is there another shortcut? Do I need to enable some option beforehand?
Preferences > Keymap > Code > Completion > Basic/SmartType:
It was actually a display problem. I'm using two screens, and the suggestions only appear when the IDE is on the main one.
The (imperfect) solution is to define the display where I'm using the IDE as the main one.
Just remove all the folder "AndroidStudioPreview";
On Windows:
Go to your User Folder - on Windows 7/8 this would be:
[SYSDRIVE]:\Users\[your username] (ex. C:\Users\JohnDoe\)
In this folder there should be a folder called .AndroidStudioPreview
On Mac OS X
Remove these files:
~/Library/Application Support/AndroidStudioPreview
~/Library/Caches/AndroidStudioPreview
~/Library/Logs/AndroidStudioPreview
~/Library/Preferences/AndroidStudioPreview
You can get your Autocompletion suggestions back in Android Studio by doing: File>Invalidate Coches/Restart...>Invalidate and Restart

Categories

Resources