Secure Android Development, project preparation, a cold and a new year

It’s been a mixed start to the new year. Watching what I eat for the rest of January, damn you Christmas. Back at work after three weeks off, achieved nothing and left by eleven. My ego got the better of me and I went for a run despite having a cold, so am now suffering. Need to shift it with the first cross country league race on Wednesday. I can’t help wondering why generic medicines are so much cheaper than brand names.

Finally got around to ordering a replacement Acer V3-112P screen. Replacement was straight forward. Like most avionics technicians, I breathed a sigh of relief when the LED panel lit up proving the fault. The old girl is now sitting running a million updates courtesy of Microsoft.

While many Linux advocates eschew Microsoft, I prefer Office (Home Use Program). Like current, I take the path of least resistance and I use Word and Excel so often I know them inside out. Linux is an outstanding development platform, I’m using it for TM470.

TM470 project preparation continues, reviewing both TM353 and TM354. FutureLearn is a fantastic resource with a course on Secure Android Development. Delivered by the University of Southampton, it started last week. I haven’t decided the tool chain yet, particularly versioning. I have used SVN and Bazaar, which I prefer as it integrates well with Launch Pad. I won’t be using LP though so should investigate Mercurial and Git.

Read Original Sin too – best Marvel I’ve read in ages. Like Murder She Wrote in space. A real page turner, I read it in one sitting.

Something that didn’t grip me was the Assassin’s Creed movie. It starts off quite well, with a similar story to the games. It suffers the same problem as earlier games though – the present interrupts more interesting stories in the past. What I don’t get though is why option a game as a property then try not to appeal to that market?

What I haven’t made time for though is the Nintendo Classic Mini. I played a little Ghosts ‘n Goblins – damn I forgot how hard games were then. I always thought as a kid that I’d somehow be better at them as an adult but I guess I didn’t factor in reactions.

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.

Developing concurrent distributed systems (M362)

I’ve just started this Open University module. From the module description’s computing requirements:

If you have an Apple Mac or Linux computer – please note that you can only use it for this course by running Windows on it using Boot Camp or a similar dual-boot system.

I started with the OU in 2008 and it’s good to see things have changed – back then it wouldn’t have mentioned Linux at all.

Joking aside things are changing. Algorithms, data structures and computability (M269), which I’m taking concurrently, has Linux software available with instructions on how to install and configure. I can understand why M362 staff would want specific versions of NetBeans and the JDK installed – the forums are already filling up with questions about various incompatibilities and conflicts and that’s just with Windows.

Fortunately the University has a Dreamspark Premium membership – so I was able to download Windows XP and a license key to install in a VirtualBox instance.

Virtual Box running OU software

I hope we continue to see progress with regards to platform neutrality – I’d like to spend more time learning computer science and mathematics and less time worrying about my choice of operating system.

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.

Well that’s a shame

From Sourceforge’s blog (emphasis mine):

Thanks to DevShare, we are now able to offer a bundle program that is fully compliant with Google’s strictest policies. This includes a solid compliance process for both open source applications and third party offerings. The whole installation flow is clean and has no misleading steps. Uninstallation procedures are exhaustively documented and all applications are verified to be virus and malware free.

I notice the linked example, Filezilla, has a clearly labelled download button with the file name on it. Except you’re actually downloading a completely different file name. Continue reading Well that’s a shame

Nexus 7 custom firmware

Although the Google Nexus 7 is pretty muck stock Android, I thought I’d give Cyanogenmod a try. Installing a custom firmware involves three steps – unlocking, installing a custom recovery mode, and installing the custom firmware. Oh and I’m doing this in Windows 7. There is also a very good guide on the Cyanogenmod Wiki which I followed. As I often do, this blog post is more to remind me what to do.

Setting up the tool chain

The Android Development Kit provides two useful tools – Android Debug Bridge (adb) lets you communicate with a connected Android device; and Fastboot which when in a boot loader allows flashing, erasing and rebooting. Once downloaded, unzip it to your folder of choice and add the sdk/platform-tools folder to your path (in Windows 7 you can do this by going to the folder in question, copying the address line and then right clicking My Computer→Properties→Advanced System Settings→Environment Variables, select Path and Edit then add the line with a leading semi-colon). The ADK requires the Google USB Driver and that you enable USB debugging (Settings→About and tapping “Build number” until Developer mode is enabled, then you can select USB debugging from Settings→Developer Options).

Unlocking the device

Connect the Nexus 7 via USB and open a command prompt in Administrator mode. Type:

adb reboot bootloader
fastboot oem unlock

The Nexus 7 will display a disclaimer – use the volume buttons to scroll through options and the power button to accept. Reboot the Nexus 7.

Custom recovery console

Turning the Nexus 7 on by holding down the volume up, volume down and power buttons. The stock recovery partition lets you do a factory reset but not much else so I replaced it with ClockworkMod which will install custom firmware and allow you to make backups.

First download the image, the Nexus 7 is available here. From the terminal:

adb reboot bootloader
fastboot devices

If there is no device listed, then you should check that the USB drivers are installed correctly. Ensure you’re in the correct folder and flash the Nexus 7:

fastboot flash recovery RECOVERY_FILE_NAME.img

Finally reboot into the new recovery image:

fastboot boot RECOVERY_FILE_NAME.img

Installing Cyanogenmod

Download Cyanogenmod – I choose the nightly build. You can also download Google apps here. ClockworkMod can install from SD card, which the Nexus 7 doesn’t have – but there is a folder called /sdcard/. From the terminal, use ADB to push the two files (obviously use the filenames you downloaded):

adb push cm-10.1-20130706-NIGHTLY-grouper.zip /sdcard/
adb push gapps-jb-20130706 /sdcard/

Now using the volume and power buttons to navigate the ClockworkMod menus:

  1. Back up the Nexus 7 (backup and restore→backup)
  2. Wipe data/factory reset
  3. Install the two zip files (install zip from sdcard→choose zip from sdcard)
  4. Reboot (reboot system now)

You should now have Cyanogenmod installed.

Developing a developer

Still some way to completing my degree part-time (at the end of this academic year I’m half way). I’m not soliciting my services – just looking for advice from the community and if anyone has a few minutes it’d be very much appreciated.

I enjoy mathematics and programming, my degree modules have revolved around the two, covering Java and VB.Net (its a very Windows centric place the Open University but it’s getting better). I’m in the UK and would like to go back to Edinburgh for family reasons when I leave the services in a couple of years time. Looking at the job boards, there’s a lot of Java contracts in the area.

Has anyone got a job with only open source experience? Does anyone know of any open source projects that are Java based and would be a good starting point to build on the fundamentals? Are there other qualifications or courses that you recommend? What are employers looking for? Does anyone work in a specific field that utilises both maths and programming? Is there a language that is in particular demand or do you find that good experience is more value? What’s a realistic starting salary?

Café

Well that was emotional, the TU100 forums opened yesterday. My poor co-moderator Nicky got thrown in to the deep end (I was at a mess top table).

I checked in before work, and there were a few posts (about two dozen) so I thought we’d be OK. Checked in earlier and there’s several hundred!

I’m studying for MS221 and MT264 but it’s clear I’m going to have to put some time in this weekend reading through TU100’s material – especially with Sense, which seems to have captured student’s imaginations.

Exploring Psychology

The course material for DSE 212 just arrived. Once I’d got over the weight of the package, I opened it to discover that it consists of a number of large text books, a couple of DVD, CDs, software and the usual assorted paraphernalia – part threes, course updates and errata. Looking over the course material, it seems well structured and nicely presented. The study calendar would suggest that this is going to be intensive, with the first TMA due on the 11th November.

If you’re still reading – you might wonder what this has to do with Ubuntu. Well it comes down to the course software – a large part of the course is centred around the data mining software SPSS. Now of course you might well suggest free alternatives such as R or PSPP, indeed PSPP is intended as a replacement and is very similar. It’s not the same however and the big difference is that the course material is geared to step by step work in SPSS version 14.

The version is important, from what I can ascertain – SPSS version 17 is available for Linux. IBM has acquired the company so this may well continue. That said, version 14 is what has been supplied. This is not uncommon with the OU – MST121 for example uses Mathcad 2000.

Now, how about running in Wine you might say – the software has a little license validation applet that doesn’t seem to agree with Wine but I might be doing it wrong. However, for many studying is already expensive – why should it also involve complicating installation?

It has been suggested the Open University is not at all open to open source software. I don’t know if this is a policy or not but I do know that the Windows based software they supply is outdated. I can understand that this is probably for the same reason that Linux is not supported – that it would mean making substantial changes to the course material.

Course tutors I have spoken to have been extremely favourable to the idea of packaging software for Ubuntu and distributing it with course material. There are issues here, licensing and maintaining spring to mind – no to mention support. There is no way the OU Computing Helpdesk are going to support Ubuntu so that leaves the community.

Where does one draw the line between the desire to use open source software and the ease of using a provided solution? Am I putting myself at a disadvantage to my peers? Although I am confident with statistics, I’m effectively learning two systems as the course teaches one and I apply it to another system. Even if this entails five minutes an assessment, it’s five minutes that Windows users are excused. Moreover I’ve paid for it through course fees, can I get that refunded?

What surprises me is that the OU is about accessibility – anyone can study with them, except it would seem those who choose not to use Windows. Shouldn’t the Open University be Open?