Skip to content

Instantly share code, notes, and snippets.

@denzildoyle
Forked from dwayne/basics.md
Last active December 31, 2015 20:48
Show Gist options
  • Save denzildoyle/8042166 to your computer and use it in GitHub Desktop.
Save denzildoyle/8042166 to your computer and use it in GitHub Desktop.

Basics

The best guide for getting up to speed with Android Development that I've come across has to be the Getting Started Training Guide from the Android Developers website. There has to be better and low and behold I found this and this, i.e. How to Program for Android and Android Bootcamp Series 2012 Video Tutorial.

For beginners, the ADT (Android Developer Tools) Bundle is recommended for quickly starting Android development.

If you don't already have the JDK installed on your system you'd need to install it. For Ubuntu users, you can follow the instructions here.

Essentially:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer

For instructions about setting up your Android SDK for the first time, read Setting Up the ADT Bundle.

To access Android SDK tools from the command line, add this to your .bashrc.

# Android SDK
export ANDROID_HOME=path/to/sdk
export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH

Next step: Follow along with the provided training material.

  • Go to the Settings menu and scroll down to About phone. Tap it.
  • Scroll down to the bottom again where you see build number.
  • Tap it 7 times and the Developer Options will appear on the Settings menu.
  • In the AndroidManifest.xml file, add android:debuggable="true" to the element.

  • Enable USB debugging on your device - On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development > USB debugging. - On Android 4.0 and newer, it's in Settings > Developer options > USB debugging.

  • Set up your system to detect your device (If you're developing on Windows). - Connect your Android-powered device to your computer's USB port. - Right-click on Computer from your desktop or Windows Explorer, and select Manage. - Select Devices in the left pane. - Locate and expand Other device in the right pane. - Right-click the device name (such as Nexus S) and select Update Driver Software. This will launch the Hardware Update Wizard. - Select Browse my computer for driver software and click Next. - Click Browse and locate the USB driver folder. (The Google USB Driver is located in [sdk]\extras\google\usb_driver.) - [sdk] C:\users\username\AppData\Local\Android\android-studio\sdk - Click Next to install the driver.

Resources

Just adding this in case I decide to use it in the future but I need to understand vanilla Android before I start adding extra layers of complexity into the workflow.

Requirements

  • Install the JDK if it's not on your system already
  • Install the Android SDK
  • Add the SDK to $ANDROID_HOME as an absolute path (Java does not expand tildes ~)
  • Add the SDK's tools/ and platform-tools/ directory to your $PATH

Ruby

Install jruby. You can use rvm.

$ rvm install jruby

Ruboto

$ gem install ruboto

Setup

You can easily check or install the requirements above:

$ ruboto setup

Read

The Android Stack

From top to bottom:

  • Applications
  • Application Framework
  • Libraries
  • Linux Kernel

Why Linux Kernel?

  1. Runs on many different devices. It's easily portable since the driver model is well known.
  2. Secure. We know quite a bit about its security model.
  3. Open Source.
  4. Cost.

Dalvik VM is Android's implementation of the Java VM.

Dalvik is optimized for mobile devices:

  • Battery consumption
  • CPU capabilities

Key differences:

  • Register based vs. stacked based
  • Dalvik runs .dex files
  • More efficient and compact implementation
  • Different set of Java libraries than JDK

Dalvik executable + Resources + Native Libraries = APK

Side loading = Putting APK on device

It is possible to create an internal application directory.

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment