Install Android Studio on Ubuntu

Ubuntu

Android Studio is a great development environment and is available on Ubuntu. I’m using Ubuntu Mate 16.10 “Yakkety Yak”.
 
First install a Java Development Kit (JDK). OpenJDK is pre-installed or you can use Oracle Java 8 (there is a great guide here). I don’t wish to argue over your choice – I need to use the latter (my tutor does). Download Android Studio here. – I extracted it to /opt; ran the installer; and used my home folder for the SDK. If you are using 64 bit, you need the 32 bit GNU standard C++ library:
sudo apt install lib32stdc++6

For Arch you need to enable “multilib” repository:

<code><span class="pln">sudo pacman </span><span class="pun">-</span><span class="typ">Syu</span> <span class="pun">&amp;&amp;</span><span class="pln"> sudo pacman </span><span class="pun">-</span><span class="pln">S multilib</span><span class="pun">/</span><span class="pln">lib32</span><span class="pun">-</span><span class="pln">libstdc</span><span class="pun">++</span><span class="lit">5</span><span class="pln"> multilib</span><span class="pun">/</span><span class="pln">lib32</span><span class="pun">-</span><span class="pln">zlib</span></code>

Virtualisation support is interesting. I read two tutorial and Google’s guide. The former makes reference to command line options not in version 2.2.2. These posts suggest this is a bug, but it may now be default behaviour. First enable that virtualisation in BIOS (check if enabled using “kvm-ok”).

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo adduser dougie kvm
sudo adduser dougie libvirtd

This results in an error.
screenshot-at-2016-11-25-21-16-19

Using the system version of libstdc++.so.6 works. Add the following to /etc/environment:

ANDROID_EMULATOR_USE_SYSTEM_LIBS=1

It seems snappy but with no feedback I’m unsure if accelerated.

So I now have a development environment set up for my project. The next hurdle is to choose a title. So far it is a: development project; distributed application; and uses Android.

TM470

After a false start when The Open University opened the TM470 module site, we got back on track on Wednesday. Although the module doesn’t start until February, I need to decide a project to assign a tutor.
 
I read the study guide and project choice pages. Self development is key, by being a reflective practitioner.
 
My project can be research, development or evaluation. It should develop knowledge acquired at level three, where I took:
  • Developing Concurrent Distributed Systems (M362),
  • IT Systems Planning for Success (TM353) and
  • Software Engineering (TM354).
I also want to use:
  • Algorithms Data Structures and Computability (M269) as I enjoyed the subject and
  • Web Technologies (TT284) as I enjoyed mobile application development and gained a distinction.
Developing a mobile application with a software engineering approach makes sense. There are techniques and approaches from TM353 that help. For TT284 I used MIT’s AppInventor but would like to use Google’s Android Studio. I worked through the tutorials and it offers a comprehensive suite of tools and runs on Ubuntu.
 
The trick is to be find an achievable solution to a defined problem. I have ideas but have lots of research ahead of me. I am writing down ideas in a notebook as I get them and aim to decide in the next few weeks.
 
Throughout I am going to blog, more for myself than anything else. I’ve noticed students reaching out for support on Twitter. While being careful about plagiarism, thought’s trigger conversations we wouldn’t otherwise have.

Samsung RV511 backlight and Fedora 20

Put Fedora 20 on my Samsung RV511 yesterday, everything worked out of the box except the backlight. Using the keys or the slider moved the animation but didn’t change the brightness – which was set to nuclear eye ball toasting mode.

Both the slider and the key combinations change the values in /sys/class/samsung/backlight. I know that the ACPI BIOS can provide interfaces but not always methods to control brightness, so I added acpi_backlight=vendor to the GRUB_CMDLINE_LINUX entry in /etc/default/grub and the back-light is working fine.

Don’t forget to grub2-mkconfig -o /boot/grub2/grub.cfg.

Assumption

Someone asked me yesterday “You’re good with computers, can you give me a copy of Photoshop?“. Aside from the fact I run Linux on most of my computers, I’m not keen on being accused of software piracy on the basis that I’m “good with computers” or any other reason. I made the mistake of asking why he needed it, he wanted to resize some pictures – so I suggested Paint.net.

His answer? “Oh no that’s free, it’s bound to be rubbish.”

Strange, I thought he wanted Photoshop free.

Samsung ML-1915 with Ubuntu

I picked up a cheap laser printer, a Samsung ML-1915. It isn’t automatically configured by Ubuntu 10.10 as it requires the Samsung Unified Linux Print Driver.

The page explains what to do but in synopsis, you need to add the repository and install two packages, obviously check out the site before blindly following me:

Add the repository to /etc/apt/sources.list:

deb http://www.bchemnet.com/suldr/ debian extra

Now, I know Ubuntu has the apt-add-repository command but that will add “pangolin release” instead of “debian extra” and will create a source entry too – which will give you an error:

W: Failed to fetch http://www.bchemnet.com/suldr/dists/debian/Release
Unable to find expected entry  extra/source/Sources in Meta-index file
(malformed Release file?)

If you did then you need to remove the offending deb-src http://www.bchemnet.com/suldr/ debian extra entry.

That done, add the GPG key and update the apt cache.

wget -O - http://www.bchemnet.com/suldr/suldr.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install samsungmfp-driver samsungmfp-data

It will then pick up and install when you plug it in. Samsung themselves provide a 30 odd Mb driver file, here. There are a whole list of the differences here but for me, I prefer Debian compliance and not installing anything I don’t need.

Oh and a big thank you to everyone who sent me suggestions of what to do in San Diego. People can be surprisingly open and friendly – especially within our community.

Twitter vulnerabilities, using Windows, studying and new WordPress themes.

Graham Cluley, a Senior Technology Consultant at Sophos, has a nice blog piece on the Twitter worm from earlier this week. To cut a long story short, he reminds us of the importance of sanitizing inputs.

Still, it was more productive than my week with my Open University module that starts in October – T175 (Networked living: exploring information and communication technologies). The OU can be very Windows dependent but this course seems to be pretty much delivered in Virtual Learning Environment (what the OU calls Moodle). I ran the course DVD, which is a Windows Flash standalone thing which got me to revive the OU Ubuntu Users group, sending out emails, starting a mailing list and trying to get things going again.

So why was it unproductive? Well, I haven’t booted Windows in ages – there were a million updates, one of which was for the wireless driver. Update completely borked the wireless and I wound up restoring the drive. That aside, one thing I really like about Ubuntu (and most distributions) is a centralised update manager – Windows has Adobe, Java, Windows Update, Firefox and McAfee all trying to pull updates at the same time. It makes the system completely unusable for the first ten minutes it’s on!

Any way, I decided to build a new WordPress theme. Same colour scheme, more rounded edges – should be available in the next few days.

Bash

Two things that improve my bash productivity – stopping the cursor keys inserting characters in vim and history search in bash.

Edit ~/.vimrc or /etc/vim/vimrc (for system wide) and add turn off vi compatibility:

set nocompatible

The latter can be improved by editing ~/.inputrc (or /etc/inputrc for everyone). Pressing the up key scrolls through all the commands you’ve typed but by adding:

"e[A":history-search-backward
"e[B":history-search-forward

You can type the first letter or two and get the command you need, so if you typed “mysql -u root -p” last Tuesday but can’t remember the options, typing “my” and pressing the up key will find it.

Install web applications locally on Ubuntu

I was talking with someone yesterday who is hacking a WordPress theme together. If you work with web sites, being able to run a site locally allows testing, experimentation, developing new themes and even just checking that a software update isn’t going to break your site. You might want to keep a web application on a local network and away from the Internet – such as StatusNet, a Wiki or a project management application. All we need is to install a LAMP stack – Linux Apache MySQL and PHP. We’ve already got the “L”! So let’s walk through installing WordPress. Continue reading Install web applications locally on Ubuntu