JavaIDEdroid

What is JavaIDEdroid?
Getting started
Manage projects
BeanShell scripts
Tools tab
Using with other applications
Debugging
Legal issues

1. Introduction

JavaIDEdroid (in the following termed "the APP") is an integrated development environment which runs on Android and allows to create native Android applications without the need to use the Android SDK on Windows or Linux. It runs on Android 2.3.3 or higher.

There is a free version and a PRO version of the APP. The PRO version supports features that makes developing a lot easier and more efficient.

Author:Tom Arn, www.t-arn.com
Project home page
and support:
http://code.google.com/p/java-ide-droid/

Currently, following tools are integrated into the APP:

top

2. Getting started

To get started, follow these steps:

  1. Install the APP
  2. Copy the Android SDK Classes (android.jar) from the Android SDK to your storage card. For some API levels, you'll find the android.jar also in the download area of the JavaIDEdroid Project Website
  3. Define "Development root dir" and "Full path of android.jar" in the Settings
  4. Create your first project

top

3. Project Support (PRO version only)

In the PRO version you can define and manage software projects. In the project menu you have following options:

top

3.1 Create a new project

You can define following information for a project:

After defining the project root directory, you can press the 'Create project files from template' button and have the APP create a skeleton project for you from the chosen template file. The HelloWorld template is automatically extracted from the app package when it is not found on the storage card. You can customize this template to fit your needs and/or add your own templates.
The project root directory must NOT exist at the time when you press the button, to avoid existing data from being overwritten. So, if you use the browse button for the project root directory, you need to enter the last directory of the path by hand.

When you press the 'Save' button, the project specific information is stored in the project definition file (.jip files) in the root directory of the project. The path of the project root directory is not stored in .jip file. Instead, when opening a .jip file, the project root directory is set to the directory where the .jip file is located. This way, your project tree stays portable. The important thing to keep in mind is, that you must never manually move the .jip file away from the project root directory, or the APP will set a wrong project root directory for this project!

top

3.2 Open project

You can open a project by browing the development tree and picking the .jip file. You can also quickly open recent projects by picking them from the recent project list (see below). After opening a project, the project file manager is shown in the 'Project' tab of the APP.

top

3.2.1 Project file manager

The project file manager lets you browse and work with all the files of the opened project. When you long-press a file, you get a context menu with following items:

The 'Directory list' button lets you quickly change to another directory of the project. When you long-press a directory, you get a context menu with following items:

top

3.3 Recent project list

You can open an existing project by picking it from the 'Recent project list'. This list is updated every time you save or open a project. The list is ordered by usage, the last used project is always on top.

top

3.4 Compile and build a project

When you select the menu items for compiling or building the project, the default BeanShell scripts /sdcard/.JavaIDEdroid/versionCode/compile.bsh or /sdcard/.JavaIDEdroid/versionCode/build.bsh are executed. These scripts should work for almost every project, because they get the project specific information from the currently opened project. You can customize these scripts to fit your specific needs.

If you have a project that cannot be compiled/built with the default scripts, you can copy the default scripts into the project root directory and customize them there for the specific project. When choosing 'compile' / 'build' from the project menu, the APP will then use these project specific scripts instead of the default scripts.

If your APP contains external Java libraries (*.jar) that are too large and generate an out-of-memory-exception when dexing, you can dexify those classes on your PC and then copy them to the dexlibs subdirectory of your project`s bin directory on your Android device. E.g. use following command on your PC to dexify ecj.jar:
dx.bat --dex --output=dexlibs\ecj.jar.dex.zip libs\ecj.jar
Make sure your dex libs have the extension .jar.dex.zip or the default build script will not be able to perform the dex merging. When the script finds ecj.jar.dex.zip and this file is newer than ecj.jar it will not try to generate it and you can therefore avoid the out-of-memory-exception.

top

3.5 Installing project APK

If you choose the menu option 'Install project APK', the APK file will be passed to the package manager and installed on your device.

top

4. BeanShell

The integrated BeanShell interpreter allows you to automate and customize the build process by writing your own BeanShell scripts.

4.1 Writing scripts

BeanShell scripts can access the functionality built into the APP by using the pre-defined variable G.
This variable references G.class with following accessible variables and methods:

Meaning of the script return value:

   0:   OK
   1:   warning
   >1:  error
   99:  no defined return value / exception
   

Example for calling ecj:
int rc = G.ide.fnCompile("--version");

top

4.2 Running scripts

BeanShell scripts must be stored somewhere on the Storage Card. You can enter the path and filename of the script in the edit field or choose the script by tapping the folder icon (or choose it in the 'Project Filemanager'). The ">" button will start the specified BeanShell script.

The result of the script execution is displayed in the ScrollView which has a context menu with following options:

top

5. Tools

This tab provides a direct access to the built-in tools without the need for a BeanShell script. All arguments need to be entered in the edit field. This tab is primarily used to see the help for the tools and try things out.

top

6. Using with other applications

The APP supports the "android.intent.action.VIEW" intent action for the text/x-beanshell MIME type. If you define this type for the .bsh extension in your Android file manager (e.g. ASTRO) you can click a .bsh file and the APP will be started and the script path and filename prepopulated in the edit field.

The APP supports the "android.intent.action.SEND" intent action and can be called from other applications using following code:

ComponentName cn = new ComponentName("com.t_arn.JavaIDEdroid", "com.t_arn.JavaIDEdroid.MainActivity");
// PRO version: ComponentName cn = new ComponentName("com.t_arn.JavaIDEdroidPRO", "com.t_arn.JavaIDEdroidPRO.MainActivity");
Intent intent = new Intent("android.intent.action.SEND");
intent.setComponent(cn);
intent.putExtra("android.intent.extra.ScriptPath", "/sdcard/AndroidDev/mydomain/HelloWorld/build.bsh");
intent.putExtra("android.intent.extra.ProjectFilePath", "/sdcard/AndroidDev/mydomain/HelloWorld/HelloWorld.jip"); // PRO version only
intent.putExtra("android.intent.extra.ScriptAutoRun", true);  // default = false
intent.putExtra("android.intent.extra.ScriptAutoExit", true); // default = false
intent.putExtra("android.intent.extra.WantResultText", true); // default = false
startActivityForResult(intent,123);

In the Extra Bundle, you can pass following information:

You can get the data returned from the APP in the onActivityResult method with following code:

Bundle extras = intent.getExtras();
if (extras != null) 
{
   int iScriptResultCode=extras.getInt("android.intent.extra.ScriptResultCode",-1);
   String stResultText=extras.getString("android.intent.extra.ResultText");
}

ScriptResultCode is always returned and contains the value of G.iScriptResultCode. If the script sets this variable, its value is returned to the calling app when JavaIDEdroid is finished automatically or by the user.

You can also get the script output of the BeanShell tab by reading the log file /sdcard/.JavaIDEdroid/LogOutput.txt. Of course, this only works if you have checked the setting 'Log output to file'

top

7. Debugging

If you have problems with the APP, you can set the Log Level in the APP settings to analyse them. If you define a value higher than NONE, the APP will log informationen to the logcat. The highest amount of information is written with log level VERBOSE.

top

8. Legal issues

Thank you for choosing this SOFTWARE! You may only use this SOFTWARE if you agree with the conditions listed further below:

COPYRIGHT
This SOFTWARE has been developed by Tom Arn, www.t-arn.com, (in the following termed AUTHOR). All rights reserved.

NO WARRANTY
The SOFTWARE is provided AS IS without a warranty of any kind. All express, implied or statutory warranties, including any implied warranty of merchantibility or fitness for a particular purpose, are hereby excluded. The AUTHOR does not warrant that the SOFTWARE is fail-safe or error-free. The user must bear all risks when using the SOFTWARE.

NO LIABILITY
In no event will the AUTHOR be liable for direct, indirect or consequential damages related to the use (or the inability of the use) of the SOFTWARE, even if the AUTHOR has been advised of the possibility of such damages.

top