Tools

Adjusting Look & Feel of IntelliJ IDEA and Android Studio on Ubuntu

2015-03-28 Linux, Tools, Ubuntu 1 comment

Introduction

In contrast to MS Windows, default installation of IntelliJ IDEA, Android Studio and other JetBrains IDEs, in my opinion, doesn’t look good in Ubuntu with Unity. Unfortunately, adjusting look of my favorite IDE is a common problem right now and it was reported to JetBrains issue tracker. Luckily, we can perform a few tweaks, to improve its look & feel ourselves.

Enabling HUD

Some Java applications don’t have Head Up Display (HUD) enabled by default. The same problem occurs in IntelliJ IDEA. I’ve described that in article about software for common users on Ubuntu. HUD is characteristic element for Unity environment and it’s similar to Apple OS X. I think, it’s useful and allows to have more space on the screen. In addition, I wanted my IDE to behave in the same way as other applications. In order to enable HUD, we have to install additional software:

sudo add-apt-repository ppa:danjaredg/jayatana
sudo apt-get update
sudo apt-get install jayatana

Hint: We can skip this step if we’re using different Windows Manager than Unity (e.g. Gnome).

Font fix

IntelliJ IDEA has problem with font anti-aliasing on Ubuntu. In order to resolve that problem, we need to install Font Fix for Open JDK.

sudo add-apt-repository ppa:no1wantdthisname/openjdk-fontfix
sudo apt-get update
sudo apt-get install openjdk-7-jdk

Preparing run script

To finalize font fixing process, we need to prepare additional shell script, place it in the bin/ directory with the IDE and run IntelliJ IDEA with that script. Below, I present source of my scripts for IntelliJ IDEA and Android Studio. We can create scripts for other JetBrains IDEs (e.g. PyCharm) in the same way.

run-idea.sh

#!/bin/sh
# change to your location
IDEA_HOME=/home/piotr/Development/java/idea-ce
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64

# Note: Can modify $IDEA_HOME/bin/idea{,64}.vmoptions
# instead of setting here.
# "-Dawt.useSystemAAFontSettings=on" seems worse to me
# "-Dsun.java2d.xrender=true" makes fonts darker
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=lcd \
                      -Dsun.java2d.xrender=true \
                      -Dswing.aatext=true \
		      -Dsun.java2d.pmoffscreen=false"
# Having this set makes menu font size smaller (wtf?)
export GNOME_DESKTOP_SESSION_ID=this-is-deprecated
# unset GNOME_DESKTOP_SESSION_ID
exec $IDEA_HOME/bin/idea.sh "$@" 

run-studio.sh

#!/bin/sh
# change to your location
ANDROID_STUDIO_HOME=/home/piotr/Development/android/android-studio
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64

# Note: Can modify $ANDROID_STUDIO_HOME/bin/studio{,64}.vmoptions
# instead of setting here.
# "-Dawt.useSystemAAFontSettings=on" seems worse to me
# "-Dsun.java2d.xrender=true" makes fonts darker
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=lcd \
                      -Dsun.java2d.xrender=true \
                      -Dswing.aatext=true \
		      -Dsun.java2d.pmoffscreen=false"
# Having this set makes menu font size smaller (wtf?)
export GNOME_DESKTOP_SESSION_ID=this-is-deprecated
# unset GNOME_DESKTOP_SESSION_ID
exec $ANDROID_STUDIO_HOME/bin/studio.sh "$@" 

Configuring fonts & appearance

I wasn’t satisfied by default font configuration of IntelliJ IDEA and Android Studio, so I updated it a little. In my opinion, it looks better after such operation. You can see my configuration on the screenshots below. Screenshots are from Android Studio, but configuration can be the same for all JetBrains IDEs. Of course, I also prefer Darcula theme.

android_studio_font_01

android_studio_font_02

Finishing configuration & system reboot

When we performed all of the tasks mentioned in the steps above, we need to perform reboot of the system. After that, our IDE and its fonts should look fine. That’s it. I hope it will be helpful for you.

5 essential tools for serious software development in a team projects

2013-03-27 Software Development, Tools 1 comment

Introduction

Daily usage of tools mentioned in this post is quite obvious for me right now, but using them wasn’t obvious while I was working alone or when I was involved only in freelance or private projects.
Whilst we don’t work in a group, we don’t have to care about lot of things, but when we work in a team (even small), we have to organize and optimize our work very well in order to obtain its high quality, work efficiently and make life of future developers of our code and co-workers easier.

1. Good IDE or editor

Intellij IDEA
Having good Integrated Development Environment or editor is very important during software development. When we master keyboard shortcuts and useful features of our environment, we can increase speed of work and debugging. Choosing environment depend on the projects and programming languages which we are using on daily basis. Eclipse is a good choice, when we develop code in Java language, but we can use it for creating C/C++ code, PHP and web development. Good alternative for Eclipse is IntelliJ IDEA (only Community Edition for Java developers is free right now). Android developers should strongly consider using Android Studio, which is based on IntelliJ IDEA. JetBrains provided IDE for Python developers as well. It’s called PyCharm and its Community Edition is free. Obvious choice for developers using Microsoft technologies will be MS Visual Studio. Despite IDEs, we can also consider using advanced editors like Sublime Text. After proper configuration, it can be very nice tool for web development and JavaScript development (including node.js). Some Ruby developers use Sublime Text as well. In general, it is worth considering while we write our programs in scripting languages. In addition, it is available on MS Windows, Linux and Mac OS. Sublime Text is just an editor, so it does not have code debugger like Eclipse or MS Visual Studio, but we can add this functionality for JavaScript language by installing Sublime Web Inspector plugin. Some people also use Notepad++. I like this editor, but I wouldn’t use it for software development due to lack of important features. In my opinion it’s good for editing single files or performing some simple operations on text or code. Of course, Linux geeks should not forget about exclusive Vim editor, but use of this software must be learned before using.

2. Source control system

branching-illustration@2x
When we work in a team, we need to have source control system. Uploading code to server by different people or sending code via e-mails is not efficient and unprofessional. That’s why we should use Git, which is distributed version control system. While using such tool, we can be always up to date with our code and we can easily track changes in the project, create branches for several tasks and so on. We can also rollback changes, when something will go wrong. Git clients are available for all popular operating systems. When we are not familiar with command line interface, we can use tools like TortoiseGit. On daily basis, the most important commands are: clone, pull, commit and push. Good practice is to create branch for development version of the application and treat master branch as a release version of the application. In addition, we can create separate branch for each issue we are working on and when we finish our task, we can merge our branch with development branch. It’s very helpful and allows us to increase stability of the project. If we want to know all advanced features of Git and master this environment, we should read “Pro Git” book which is available on-line for free.
Another, older source control system is SVN. Well known GUI client for SVN on MS Windows is TortoiseSVN. SVN is not distributed version control system like Git and does not have such amount of features, but it’s worth to know it, because it is used in some projects today for some reasons. Yet another source control system, which is less famous than SVN and Git, is Mercurial. Like mentioned systems, despite command line interface, it also has client with GUI called TortoiseHG available for Windows OS.

3. Continuous integration tool

ci-diagram

Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily – leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly.

Quote of Martin Fowler.

Continuous Integration is also explained in details on Wikipedia.

jenkins_logo

One of the common tools used for Continuous Integration is Jenkins. In simple words, developers commit changes to the project and afterwards Jenkins download source code from the repository and generates a fresh build of the project (compiled application). Builds can be scheduled and run automatically, but we can also run our builds manually. When something will go wrong, we receive an information that build is broken, unstable or cannot be compiled. In such case, developer who broke the build (pushed changes, which caused such situation) is responsible for repairing the build. We have to take care about the configuration files, because sometimes Jenkins may analyze our source code differently than our local compiler (because of specific settings or different operating system) and it may cause build failure. While using Continuous Integration, we don’t have to send compiled projects via e-mail or in other inconvenient way. We can just run the build. After that operation, Quality Assurance Engineers and Project Leader will always have access to the newest version of our project.
When we don’t want to use Jenkins, we can consider adapting alternative Continuous Integration service called Travis, which is integrated with GitHub. Yet another continous integration and build server is Bamboo from Atlassian.

4. Code review tool

PeerReview

Code review as a systematic examination of the source code plays important role in the quality of the project. Different programmers have different background and point of view. We all make mistakes and it’s easier to fix them when we have good support. There are tools which can help us to make Code Review. One of them is Review Board written in Python, which can be associated with Jenkins. After running Review Board build, we can send e-mails including current revision changes to our team in order to keep everyone up to date. There are also other tools, which we can use. Phabricator can be an interesting tool, but I don’t have any experience with it yet. Nevertheless I know, that it is written in PHP and was developed at Facebook. Gitlab is also worth considering during conducting code reviews. Moreover, we can omit using additional tools and perform code reviews by browsing code and talking with another developer verbally, which is also good practice. To summarize this section, Code Review lets us to know what is going on in all projects of our team and, what is more important, helps us to increase quality, maintainability and robustness of our code and projects, which are used by the final users.

5. Issue tracking system

jiratour_workflow_visualizeworflow

Good Issue Tracking System is also important tool used during the development of the project. It lets you track tasks, bugs and changes in the projects. We can create simple workflow in our project, which will increase quality of the software and also keep you informed about progress of the project. This is important in situations when several people work on the same application, so we can divide and choose tasks wisely in such a way, that people won’t disturb or “interfere” themselves during the work. In addition, project leader will be informed about the progress of the work. There are many issue tracking systems, but one of the best and well known is Jira. In addition, Jira allows you to work with projects in Agile methodology, so you can define backlogs, sprints and create good workflow in the project. Despite of these features it has so called Confluence, which is basically internal project Wiki, where you can create your knowledge base and notes.

Summary

All these five elements can help you to make great applications and projects. It may seem, that using them is a lot of additional work, but in fact, they are really useful and can help you to work faster, better, increase quality of the project, integrate code, identify and track the bugs, track tasks, issues and keep the project up to date for everyone who is involved in it. When we take care of good project organization, the only possibility is awesome outcome.

Place it by Brezi – generating screenshots of mobile and web apps in realistic environment

2013-02-02 Design, Mobile, Tools No comments

placeit-by-brezi

Some time ago I discovered nice tool, which allows you to create screenshots of mobile and web apps in realistic environment. It’s quite useful. Especially for promotional purposes and in the case, when our graphic design skills are not good enough.

Check this out! http://placeit.breezi.com/