Skip to content

Instantly share code, notes, and snippets.

@kaecy
Last active March 6, 2018 17:19
Show Gist options
  • Save kaecy/b30ef9cd707ba91e4cc5a4c8282beb9f to your computer and use it in GitHub Desktop.
Save kaecy/b30ef9cd707ba91e4cc5a4c8282beb9f to your computer and use it in GitHub Desktop.

Code The Old Way With Android SDK

What you need:

  • JDK (Java Development Kit)
  • Ant (Build System)
  • ADK (Android Development Kit)

Download:

JDK (you can download OracleJDK or you can download an OpenJDK binary here https://github.com/ojdkbuild/ojdkbuild)

Ant (https://ant.apache.org/)

ADK (install version 25.2.5 https://androidsdkoffline.blogspot.co.uk/p/android-sdk-tools.html)

Once you have all of these installed you can begin coding the old way.

Both OpenJDK and Ant files can be unzipped anywhere but make sure there's no space in the path. And add an entry in your path environment for both.

But wait the ADK takes a bit of configuring. When you have the ADK installed and it's in your path environment, type android in the console and install the SDK Platform Tools, SDK Build Tools and target android files you want to develop for, example if you want to develop for android 4 install "android 4 (api 14)".

Now you're all set.

Type android create project -n main -a Main -k name.pkg -p testapp -t android-14 to create a project.

-t means the android version you target. Put the version you installed here when you configred the Android SDK.

Now, cd the to project and type ant debug to debug. That is compile the project and build a debug version of the .apk file in bin directory and that apk can be installed on a device. I don't recommend emulators, they're slow, but you can if you want. The SDK comes with an emulator. Type android avd.

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