How to start locale settings activity on android from command-line

A useful and handy command specially when you during experimentation, you are stuck because of a changing language settings to an undecipherable foreign language. Bash 1 2 3 adb shell am start -n \ 'com.android.settings/.Settings\$LocalePickerActivity'

Android, Gradle and compile-time only dependencies

Android plugin for Gradle does not support Java-style compile time only dependencies. After spending a few hours on trying to build android app targeted for Amazon SDK (without using Amazon’s Android specific plugin but just their jar stubs for maps, ADM and Home widget), I finally found that the one way to support compile-time dependencies is following. For application project Groovy 1 2 3 4 5 6 7 8 9 10 11 12 13 configurations { provided } dependencies { // ... provided fileTree(dir: "${project.rootDir}/path_to_libs_dir", include: '*.jar') } // Android's version of sourceSets.main.compileClasspath android.applicationVariants.each { variant -> variant.javaCompile.classpath += configurations.provided } For the library project Groovy 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 configurations { provided } dependencies { // ... compile fileTree(dir: 'libs', include: '*.jar') provided fileTree(dir: "${project.rootDir}/patch_to_libs_dir", include: '*.jar') } android.libraryVariants.all { variant -> // Exclude the jar files from making its way into the final apk. // Irrespective of what the path_to_libs_dir is the final jar files end up in libs dir. variant.packageLibrary.exclude('libs/lib1.jar') variant.packageLibrary.exclude('libs/lib2.jar') // ... } References https://stackoverflow.com/questions/16613722/gradle-configurations-not-working-as-expected-in-new-android-build-system https://stackoverflow.com/a/24157721

Mac OS X Primer (Part 2): GNU/Linux -> Mac for software engineers

Booting process The bootloader loads the kernel stored in /mach_kernel. Tip: Use rEFIt as a bootloader for dual booting into GNU/Linux. Kernel launches the launchd process which is equivalent of init in GNU/Linux. launchd loads startup processes from several directories (/System/Library/LaunchAgents, /System/Library/LaunchDeamons, /Library/LaunchAgents, /Library/LaunchAgents and corresponding files in ~/Library directory)

How to compile android emulator on ubuntu 13.10

I was trying to make some modifications to android emulator and was unable to find good set of instructions for the compiling the same. Here are mine. Bash 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # Get the source code. git clone https://android.googlesource.com/platform/external/qemu cd qemu # Install required dependencies. sudo apt-get install gcc-multilib libesd0-dev libx11-dev \ libxext-dev libasound2-dev libpulse-dev \ lib32stdc++-4.8-dev # Install ia32 libraries (missing from default ubuntu 13.10). sudo apt-get install libgtk2.0-0:i386 libpangox-1.0-0:i386 \ libpangoxft-1.0-0:i386 libidn11:i386 libglu1-mesa:i386 # Configure and build the emulator binary. ./android-configure.sh --no-gles --no-tests --cc=/usr/bin/gcc make -j16 # The emulator binaries are in objs directory.

How to send HTML mails using Amazon SES (Simple Email Service)

As the title suggests, I was looking for a way to send HTML mails in python using Amazon SES but did not find anything (or maybe my search skills are bad). So, once I found the solution, I thought I might share it with everyone. The basic idea is that contents of the mail (raw-message) must be a JSON dictionary with “Data” as main key whose value is a key value pair containing entries with keys like “From”, “To” etc. Sample code can be seen below.

Github 101 for hackathons

This blog post is a HOWTO guide for using github while collaborating during hackathons. It does not cover git in detail.

Mac OS X Primer: GNU/Linux -> Mac for software engineers

This blog post contains a collection of small tips for engineers migrating from GNU/Linux to Mac OS X for software development. Note: In another post , I wrote about why there is a dearth of a good GNU/Linux laptop.

How to upgrade Nexus 4 to Android 4.4 Kitkat

Some experience with adb and fastboot preferred (they are part of android SDK )

Understanding Directory Permissions on Linux

This blog post is for those who understand how file permissions work but are looking for an explanation on how file permissions behave when they are applied to directories.

Animation in diagrams (presentations in Latex)

While most people draw diagrams in Xfig (or GIMP) and include them in LaTeX, they can be drawn directly in LaTeX (using tikz package). A major advantage of doing that is animation (\pause) is possible when using these diagrams in presentations(based on beamer) Following is an example demonstrating that (code released under BSD license)