Are you using both Eclipse (ADT) and Android studio for developing Android apps?
They both come with their own SDKs, and maintaining two SDKs separately can be quite painful.
Here is how you set both IDE’s to use the same SDK.
Create a new common SDK to be used by both IDE’s
First, you have to set up a common SDK. You can either download a new SDK, or use the one that came with either Eclipse/ADT or Android Studio.
Let say you want to put your new SDK at the following location: /Users/Name/sdk.
You can use your existing SDK from Android Studio, in the Android Studio folder.
On mac, navigate to your applications folder, and then right click on Android Studio, Show contents, and then copy the contents of that SDK folder to your new common SDK folder: /Users/Name/sdk.
If you want to remove the “Dashboard” screen from the Mission Control view in OS X Mavericks, Open a Terminal, and run these two commands:
defaults write com.apple.dashboard mcx-disabled -boolean YES
If you later want to have Dashboard back, you use the same commands, only with NO at the end of the first one, instead of YES.
If you are trying to run your Android apps in a harware accelerated android emulator on Mac OS X, you may experience a crash, or your whole mac will freeze up, ending in a reboot.
The default installation of intel HAXM that comes with the Android SDK manager is version 1.0.6.
Intel has released a Hotfix, revision 03 of the HAXM software, available here.
Download and install the “haxm-macosx_r03_hotfix.zip”, Which has a version number of 1.0.7.
Be aware that there is also another known issue with intel HAXM and VirtualBox, as it says on their webpage:
The Android Emulator may freeze when HAXM and VirtualBox v4.2.14 and newer are run in parallel on the same machine. Our testing shows that previous versions of VirtualBox, v4.2.12 and earlier, don’t exhibit the issue.
If you are tired of the boring default look of Android Studio (and IntelliJ which it is based on), you can do like me, and switch to the better looking Monokai theme from Sublime Text 2.
The ugly default theme
I have already covered how to get the Monokai theme in Eclipse, and even how to get Monokai in Chrome developer tools!
I have previously posted about a theme named Monokai (in this post).
I think its a great color theme for displaying code, so ofcourse I had to try it out when I discovered the possibility to switch themes in Chrome Developer Tools.
A theme customization of Chrome Developer Tools, is done with pure CSS, and this particular stylesheet, for Monokai, you can download here.
The CSS goes into the Custom.css file in the following folder on your computer:
C:\Users\<yourusername>\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\Custom.css
or on Mac:
~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css
Currently, it seems to be something wrong with the “Toolbar Enhancements” in the theme, so open the CSS file in a text editor, and remove that section. (leaving you with this).
The end result is a nice color theme in Chrome Developer Tools!
Do you have a Sony Xperia Z1, and the screen appears to be dead / off, but the phone is actually on in the background (to verify if it is on, try calling it from another phone for example).
The following trick will probably fix the problem:
- Hold down the Volume Up button and the Power button for about 10 seconds.
You should feel 3 vibrations. This will turn your phone off.
- Wait a couple of seconds, 20 or so.
- Hold down the Power button for about 3 seconds.
This should turn the phone on again, and this time the screen should come on too!
Please comment below if this trick worked for you
If you are using lists in your app, and some of the list items have too long text, making it wrap to several lines like item number three in the following image, then this trick will show you how to create better looking lists.
Text wrapping to two lines
Your custom list item xml layout file may look like this:
<?xml version="1.0" encoding="utf-8"?>
If you change it by adding the ellipsize and singleLine attributes, the long text will wrap when it goes out of its boundaries:
<?xml version="1.0" encoding="utf-8"?>
Text is nicely cut off with an ellipsize …
This will not only look better, but also keep all list items at the same height.
It’s the singleLine attribute that does the trick, but by using the ellipsize attribute, you can also specify where you want the three periods to appear.
You can for example specify “middle” to have them appear in the middle of the text, thus showing the start and and of the text.