0% found this document useful (2 votes)
887 views

AIDE (Android Integrated Development Environment)

AIDE is an Android app that allows users to develop other Android apps directly on their Android device. It provides an integrated development environment (IDE) with tools to build apps using Java, XML, and C/C++. AIDE has been optimized to work with the limited resources of Android devices using techniques like incremental compilation of only changed files. It has over 1 million downloads per year and allows developers to work on their projects anywhere without needing a desktop computer. The presentation demonstrates AIDE's capabilities and discusses the technical challenges of running an IDE on resource-constrained devices.

Uploaded by

zzalyoreo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (2 votes)
887 views

AIDE (Android Integrated Development Environment)

AIDE is an Android app that allows users to develop other Android apps directly on their Android device. It provides an integrated development environment (IDE) with tools to build apps using Java, XML, and C/C++. AIDE has been optimized to work with the limited resources of Android devices using techniques like incremental compilation of only changed files. It has over 1 million downloads per year and allows developers to work on their projects anywhere without needing a desktop computer. The presentation demonstrates AIDE's capabilities and discusses the technical challenges of running an IDE on resource-constrained devices.

Uploaded by

zzalyoreo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

AIDE

Develop apps with an app


appfour GmbH

Hans Kratz
Dennis Strein

www.android-ide.com
What is AIDE

• An Android app to make Android apps


• Android Integrated Development Environment

• Android SDK apps with Java & XML


• Android NDK apps with C/C++
• Phonegap/Cordova apps with HTML5 &
JavaScript (with AIDE for PhoneGap)
Session Overview

• Introduction to AIDE
• Demonstration time
• The magic of AIDE
• Questions
AIDE Popularity
1.000.000 downloads/year
Install AIDE on your device!
• In Google Play search for „AIDE“ or just „IDE“
Demonstration time
The magic of AIDE

• Java build process


• Native build process
• Interactive tutorials
Android Build Process (1)
Android Build Process (2)
Technical Challenge: Memory

• Device RAM
• Dalvik VM heap size: <= 256 MB for 80% of users
(Oct. 2013), e.g. Galaxy S2 with Android 2.x has
64 MB
• AIDE (200 kloc) build with Eclipse requires 2 GB
heap

• Objective: Build 200 kloc on a low-end device


Technical Challenge: Performance

• ARM optimized for battery life (not speed)


• Dalvik VM is slow (5x slower than HotSpot on the
same hardware in relevant benchmarks)
• ART is a bit better but not widely supported yet

• Objective: Build 200 kloc after code changes


within seconds on a low-end device
AIDE's Build: Asset Packaging
• Android Asset Packaging Tool (aapt) takes
resource files (AndroidManifest, XMLs, …) and
compiles them

aapt binaries for ARM and x86


Taken from official Android source code
Tweaked to compile for Android
AIDE's Build: Java Compiler
• Java Compiler compiles Java source files into
.class files

Incremental compilation: Compile only Java


files needed
Custom Java compiler, optimized for memory
& performance
Runs as a service in extra process
Compilation service in separate Process
• Declare „android:process“
<service
android:exported="false"
android:name=".CodeAnalysisEngineService"
android:process=":EngineService" />

• Use IPC with AIDL for communication


interface ICodeAnalysisEngineService {
oneway void build();
oneway void rebuild();
AIDE's Build: Dexer
• Dex tool converts the .class files to Dalvik byte
code as one large dex file

Incremental dexer, dexes only changed .class


files
Highly optimized custom dex merger, merges
all individual dex files in one step
AIDE's Build: Packaging

• Dex file and compiled resources are packaged


into a (signed) APK file

Java ZIP API for APK building


Tweaked open source Zipsigner
AIDE's Build: Native code

• C/C++ files are compiled into a shared library


using the GCC toolchain

 Custom NDK based on the Google Linux NDK.


 Cross-compiled for ARM
 Statically compiled against GNU libc
 Officially supports only ia32/ia64 on Windows,
Linux and Mac OS X
 Bundle Busybox for UNIX tools
AIDE's Build: Java console applications

Java code is compiled to .class files


Dexing those .class files creates .dex file
An extra activity in an extra process is started
The .dex file is loaded using DexClassLoader
The main method is invoked using Reflection
Custom console view for I/O
Giving back to the community

• NDK is part of the Android Open Source Project


(AOSP) under the Apache 2.0 licence.

• Our modifications and build scripts are on


GitHub:
https://github.com/android-ide/aide_ndk

• Cave: The build process is a bit complex.


Interactive tutorials
Courses

• Java

• Android

• Games with libgdx


Recap

• Develop Android apps with your Android device

• Improve your skills using interactive tutorials

• Work on your Eclipse & Android Studio projects


on-the-go

• AIDE magic makes it happen


We are hiring

• Want to work on cool stuff like this at


appfour?

Talk to us or contact [email protected]


Meet the SPEAKERS
@speakerlounge

1. OG DIREKT ÜBER DEM EMPFANG

You might also like