yashsingh1/xdaforums huggingface dataset:
[Android Software Development] spartacusrex:
[UPDATE]

BusyBox 1.19.2

Bash 4.2

Midnight Commander 4.8

TMUX 1.5 - That's right, full terminal multiplexer..

Vim 7.3

Terminal IDE ASCII Soft keyboard first round bug fixes complete.

It's the addition of TMUX and MC that really excites..

--------------------------

Well,

As the only people I know who might even be interested in this, I would like to announce the release of Terminal IDE v1.0.

A complete Java / Android Development Environment that runs on the device itself, with a nice telnetd / sshd feature.

For Android. Of course... Eat this you IPhone Hounds..

Woo HOO!!

The application is available on Android Market.

https://market.android.com/details?id=com.spartacusrex.spartacuside

As what I can only describe as 'dark days' finally draw to an end, I am very pleased with this first draft.

PLEASE give it a go, log in over telnet for a smoother ride, and let me know how it goes..

DO THE TUTORIAL! Does it work ?!

I have released the whole project GPLv2! Yeah, Who Knew!?

http://code.google.com/p/terminal-ide/

BOOOOOM!

Spartacus
[Android Software Development] a user:
a link to the app in the market would be usefull.
[Android Software Development] Bratag:
Interesting. Was just wondering about coding on my tablet.
[Android Software Development] artlan:
Pretty freakin sweet :D

Thanks for putting this out!
[Android Software Development] 1up:
Awesome

The full keyboard alone makes it worth downloading, but the IDE as well - wow!
[Android Software Development] budingyun:
this is best bro. :D
[Android Software Development] takkun1946:
I randomly found this last night while looking for a decent mobile IDE for my tablet. I was looking for a simple text editor with syntax highlighting and you've taken that extra step to include other tools for ssh, telnet and compilers. Much appreciated.

One question, how do you start the ssh server? sshd doesn't seem to do it. I would like to scp files to my device from my desktop in order to work on my commute.

Thanks
[Android Software Development] spartacusrex:
The sshd app is actually called Dropbear.

You also have Dropbearkey.

You use Dropbearkey to generate the sshd certificates you need.

I really need to add a tutorial on setting the sshd keys up :-p

For now Google has a couple of articles on it.

For file transfers you also have busybox FTP but I admit not terribley secure..

Allthough SSH is provided, and I wonder whether an SSH pipe can be created..?

And lastly you can just copy the files over to your sdcard via USB..

Will look into it & add tutorials asap.
[Android Software Development] spartacusrex:
Ok. So I now have SSHD working..

But there is a slight issue.. basically when you log in you have to start bash manually.. unless you have the file /etc/shell with the correct shell to use.. Which requires a rooted phone.

Since Terminal IDE is for non-ROOT users, I will have to recompile the code to allow a shell to be specified on the command line.. Soon..

FOR NOW - This is how to connect to the phone via SSH (There are other ways using public keys but this is one way)

So - Once in Terminal IDE

2) You need to create a couple of server ssh keys

Start in $HOME

cd ~

Create folder

mkdir .ssh

Give it some secure permissions

chmod 700 .ssh

Get in there

cd .ssh

Now create the keys

dropbearkey -t dss -f dropbear_dss_host_key
dropbearkey -t rsa -f dropbear_rsa_host_key

ok - That's almost it. Just need to start dropbear with the correct parameters now. [Probably want to keep this in a script]

Back HOME

cd ~

You need to know the UID of your app, which is different per phone - use 'id'

id

That will tell you your user ID / Group ID. Let's say its 10058.

Now to start DropBear

dropbear -A -N username -U 10058 -G 10058 -C password -d ~/.ssh/dropbear_dss_host_key -r ~/.ssh/dropbear_rsa_host_key -F -E -p 8090 -P PidFile

This will start it running in the foreground with password set to 'password' on port 8090.

Then you can connect, like telnet, and simply use 'password' for the password.

Now for the issue. It will start a simple shell session in / with no ENVIRONMENT variables or anything.. :mad:

I'll fix it permanently in a future release, but for now it can be fixed with these 2 commands. :p

cd into your home dir - Check this is correct on your device

cd /data/data/com.spartacusrex.spartacuside/files

And start bash with an init file Terminal IDE auto-magically creates..

./system/bin/bash --init-file ./.init

Everything should now be setup as usual.

Good luck..
[Android Software Development] takkun1946:
Very awesome and thank you sir. Works like a charm.

One thing to clarify for those "braving" this (not that it's all that insane to try)... the '-N' is setting the username (in the case of the example, setting it to 'username').

Also, it gives a permission denied for scp, I'm assuming since it doesn't init/run the shell. Should be fine since FTP is included. Haven't tried this option yet. Not too worried about security at the moment, since I'll only run it on a private network.

May I make a (maybe) small feature request? Is it possible to include a "keep screen awake" option in the options menu? I have my Xoom config'd to turn off the wifi when the screen is off for power saving (can go ~4 days on 1 charge), so it will kill my connections if I let this happen. I know not everyone has this config set, but it'd be a nice option.

NOW, if I wasn't lazy, I could probably add this myself and build since I've dl'd the source. But, lazy and working on a few projects already.

Again, much thanks.
[Android Software Development] spartacusrex:
And as if by magic..

Funnily enough I was having the exact same issue last night while using wget to transfer a big file to my device..

NEW VERSION UPLOADED v1.13 :D

Now has 3 non-exclusive lock types available in the options :

- CPU Lock

- SCREEN Lock

- WIFI Lock

Set them as you wish...
[Android Software Development] takkun1946:
Saw that this morning when I was on the bus (Thursday morning here in Hong Kong). Very awesome and much appreciated.

As well, thanks for open-sourcing it. +1 for you sir!
[Android Software Development] myn:
Very cool stuff :)

Thanks for creating this.
[Android Software Development] Schindler33:
Great app! However I can't compile .java files. I always get an error that it can't unzip a file in /android.policy.jar. Any idea?
[Android Software Development] DroidVPN:
Do you think its possible to also support compiling C sources directly in your phone :)
[Android Software Development] Smasher816:
I've been searching for this ever since I got an android.

THANK YOU.
[Android Software Development] shpen:
Says that it's incompatible with my OG Droid. Any idea why?
[Android Software Development] cdesai:
Most likely seems to be due to the ROM you are using and/or the market version

can u post the build.prop here?

/system/build.prop

also, try going back to market 2.x, 3.x market(s) do loads of checks
[Android Software Development] Schindler33:
Does anybody know why I can't compile java files? I always get the following error:

Error reading /system/framework/android_policy.jar cannot read zip file.

Any ideas? Could anyone upload there android_policy.jar because that might cause the error.
[Android Software Development] spartacusrex:
Hi Schindler33.

Can I ask, have you followed the tutorials, say the first helloworld example TO THE LETTER?

Does the helloworld example work?

The parameters have to be correct, and as always exact, and the BOOTCLASSPATH variable must be set.

If so, is it a custom ROM?

Does that policy jar file exist and is it readable by non root users?

As much info as possible good..
[Android Software Development] spartacusrex:
Yep.. need to cross compile the cross compiler.. :p
[Android Software Development] Schindler33:
Jep file exists and is readable. I am on a custom sgs2 rom.

I followed the tutorial but even the hello world java file could not be compiled.

How do I set enviroment variables on android?

Thanks for the help
[Android Software Development] spartacusrex:
hi schindler33,

what is the output from

javac hello.java - in the 1st tutorial.

copy and paste it here. in verbose mode there will be much useful info..
[Android Software Development] Schindler33:
here is the output:

USER CLASS PATH : .

SOURCE CLASS PATH : .

[parsing started RegularFileObject[hello.java]]

[parsing completed 11ms]

error: error reading /system/framework/android.policy.jar; cannot read zip file

[search path for source files: .]

[search path for class files: /data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar,/system/framework/core.jar,/system/framework/bouncycastle.jar,/system/framework/ext.jar,/system/framework/framework.jar,/system/framework/android.policy.jar,/system/framework/services.jar,/system/framework/core-junit.jar,.]

[loading ZipFileIndexFileObject[/data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar(java/lang/Object.class)]]

[loading ZipFileIndexFileObject[/data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar(java/lang/String.class)]]

[checking hello]

[loading ZipFileIndexFileObject[/data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar(java/lang/System.class)]]

[loading ZipFileIndexFileObject[/data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar(java/io/PrintStream.class)]]

[loading ZipFileIndexFileObject[/data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar(java/io/FilterOutputStream.class)]]

[loading ZipFileIndexFileObject[/data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar(java/io/OutputStream.class)]]

[total 347ms]

1 error
[Android Software Development] spartacusrex:
Ok, by the looks of things it doesn't like the android.policy.jar.

The classpath you have is the same as the output on my device so that is a little odd.

maybe it is a corrupted file..?

Anyway, you can attempt a fix by removing it from the $BOOTCLASSPATH. [Since not sure you need it anyway.]

if you type this

echo $BOOTCLASSPATH

you should get

/data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar,/system/framework/core.jar,/system/framework/bouncycastle.jar,/system/framework/ext.jar,/system/framework/framework.jar,/system/framework/android.policy.jar,/system/framework

so you need to export it without the android.policy.jar

export BOOTCLASSPATH=/data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar,/system/framework/core.jar,/system/framework/bouncycastle.jar,/system/framework/ext.jar,/system/framework/framework.jar,/system/framework

try now..
[Android Software Development] Schindler33:
Did not help. Now I get the following output:

Dalvik VM unable to locate class 'com/spartacusrex/spartacuside/external/javac'

java.lang.NoClassDefFoundError: com.spartacusrex.spartacuside.external.javac

at dalvik.system.NativeStart.main(Native Method)

Caused by: java.lang.ClassNotFoundException: com.spartacusrex.spartacuside.external.javac in loader dalvik.system.PathClassLoader[/data/app/com.spartacusrex.spartacuside-1.apk]

at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)

at java.lang.ClassLoader.loadClass(ClassLoader.java:551)

at java.lang.ClassLoader.loadClass(ClassLoader.java:511)

... 1 more

Anyway thanks for the help
[Android Software Development] takkun1946:
If this helps, I'm running a stock Xoom and my $BOOTCLASSPATH is:

/data/data/com.spartacusrex.spartacuside/files/system/classes/android.jar:/system/framework/core.jar:/system/framework/apache-xml.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar

I can build and run with no issuess.
[Android Software Development] spartacusrex:
Well something happened..

try this.

first

cat `which javac`

this will show you what javac is actually calling.

Then try

dalvikvm

on its own to see if it works as is.

Then see if it can read the $APK file with -cp.. and so on.. so you see where the problem lies.

Sorry I can't be more help. Really need to give your system a good thrashing but that's hard to do remotely..
[Android Software Development] spartacusrex:
NEW VERSION 1.21

- MIDNIGHT COMMANDER 4.8 :D [Works well, VFS all installed]

- NEW System 1.2

- Lots of bugs fixed.

- Soft Keyboard finally all working, F1-F4 aswell.

- HARD KEY Mappings for CTRL and ESC [Look in Options]

- Few tweaks..

I recommend you do an 'OVERWRITE ALL' for the system install as there is a new .bashrc and .vimrc so that mc works well.

Set xterm as the default TERM value, so watch out for apps that either break or are fixed because of this..

This now pretty stable.

Thanks for reporting all the bugs!
[Android Software Development] TearsDontFalls:
Can you pls reupload the v1.21 apk to googlecode? I got a parsing error with my galaxy 3 and i cant install it from market, because my screen resoulution(240x400) is not supported, i think.

Edit: Sorry i didnt read, that i need android 2.3, i have only 2.2
[Android Software Development] spartacusrex:
All versions are available for download at the Google project. They may have been deprecated so select ALL downloads for an older version.

http://code.google.com/p/terminal-ide/

And of course on Android Market.

But yes 2.3 min..
[Android Software Development] spartacusrex:
TTTMMMUUXXX!!!

Ahem.. TMux 1.5.

Coupled with MC and the rest of the available apps, i ThinK, my android command line setup is now as hardcore as my regular Linux setup..

:D
[Android Software Development] fermy:
To bad it wont run on my revue.
[Android Software Development] takkun1946:
I just saw on the latest release you seem to have integrated GIT. Haven't been able to test just yet (still updating on both NS and Xoom), but if this is the case and we have (at least) 99% GIT capability... I will... Well... I just might cry sir. :D

edit: it is... it does... I'm in tears from your awesomeness sir. You've made my dev life that much more wonderful.
[Android Software Development] spartacusrex:
Very happy to hear that :D

Thank you.

( actually I was an SVN man, but GIT totally rocks.. )
[Android Software Development] takkun1946:
That it does. Used SVN for many years. Wasn't really a SVN person, but... I am a GIT person. :D Thanks again!
[Android Software Development] wiffeltje:
And another big thanks from me too. This is just great.

Having VIM and TMUX on my Galaxy Tab makes it suddenly worth a lot more.

I managed to 'openvpn' into my work network, 'ssh' into our servers, use 'luajit' in tmux mode. ..

Works like a charm.

Thanks again for the effort you have put into this.
[Android Software Development] karo:
success report

Hello,

first: Great work, thank you very much and a nice new year!

Maybe it is of interest for somebody:

I own a sony tablet s since a few days.

I tested the remote access via ssh as described in this thread.

-> works.

And the real benefit of your system: The only really working way to

exchange data with both, the sdcard which is mounted to /sdcard2 and the

internal user memory which is mounted on /sdcard on this (afaik non rootable very nice but very closed sony device) is the use of rsync

- I use this a long time to sync my linux system, a shorter time to sync a

mac notebook and a long time ago with a windows system via cygwin (as far as I remember).

I tried it with my Linux-Server and it works very well in my first try.

Copy a directory of my holiday-pictures -> need some time

delete one picture on android, rsync again and very fast it copies only

the missing file.

I use the following short script to sync from linux to Android. (Other way: change source and destination).

Warning: I use the script on linux, but I have no experiences with android, I just tried to copy files, I don't know what's about timestamps etc, so before I would risk to really syn sensible data I would do a backup :-)

The script is appended, by default I assume that dropbear is running on port 5022.

Thangs again

Karsten

the flags:

-r recursive

-l preserve links (not needed?)

-t preserve time

-u only update (important)

-v be verbose

-z use rsync compression. Maybe I should throw this away, cause afaik ssh also

compresses - doesn't it?

Obviously the following is no php code, but it looks better then as normal text and a BASH-Tag does not work ;-)

#!/bin/bash
echo "sync to the android tablet"
echo "flags -rltuvz, use port 5022"
port=5022
#can be changed by third argument
if [[ $# -eq 3 ]]
then
port=$3
fi
echo "source $1"
echo "dest $2"
echo "Port $port"

echo "If you set source $1 without ending / "
echo "so you create in dest $2 a subdir with the name of source $1 !!!"
echo "you can now give some options eg -n or --dry-run for a dry run :-)"
echo " or --delete to delete files on dest"
echo "just enter to continue without additional options, ctrl-c"
read a
rsync -rltuvz $a -e "ssh -p $port" --rsync-path='/data/data/com.spartacusrex.spartacuside/files/system/bin/rsync' $1 $2
[Android Software Development] Smasher816:
Must say amazing work on the app so far.

However, I need some help/guidance. How would you compile projects that used libraries and other dependencies? It works fine for simple apps, but more complicated apps such as those dependencies make compiling a lot harder.
[Android Software Development] jgrimberg1979:
Can someone tell me the commands to decompile and compile apk using terminal ide (if possible) Thanks
[Android Software Development] Delgoth:
I must say sir, good job. I have a xoom I've been wanting to start developing. And with my Bluetooth keyboard, your build.environment already has me on my way.

Maybe now ill learn something a.bit more useful :-)

I know that with a host cable i can connect my infuse 4g to my xoom, it helps out when trying to read and type in console. Plus i can develop for my phone from my tablet.now!

Now i just have to figure out GIT so i can get a couple repo's downloaded.
[Android Software Development] Yuretsz:
To simplify life for the newcomers you can create a dummy executable file in

/data/data/com.spartacusrex.spartcuside/files/bin/sshd

with the following message

echo 'You can use dropbear to start ssh server. how-to: http://xdaforums.com/showpost.php?p=19402417&postcount=9'
[Android Software Development] Droidzone:
I needed to do:

ssh -t user,project@anywhere.com create

Unfortunately, it seems to give an error message that hostname "user" cannot be found. The exact same command works on Ubuntu. Do I need another version of this?

Swyped on my Htc Desire running on Supernova Extreme - Gingerbread goodness with 2 GB of Internal memory
[Android Software Development] spartacusrex:
DNS hostname resolution does not work..

well - not unless you have root and a /etc/resolv.conf file..!

So - use jping to get the Number IP and use that instead.

# jping www.google.com

Will give you googles ip.
[Android Software Development] Droidzone:
Its actually the format for ssh to sourceforge. If I leave the user,project@hostname, and use user@hostname, it does connect to sourceforge. Sourceforge actually then reports that I don't have an active shell, and that I should first create one in the format mentioned. Hence I'm thinking it does not have issues resolving the hostname, but in the way it interprets the syntax. I'm rooted btw.. when I tried to give the ide superuser permissions,it told me that I'm unknown uid 0.

Swyped on my Htc Desire running on Supernova Extreme - Gingerbread goodness with 2 GB of Internal memory
[Android Software Development] spartacusrex:
Terminal IDE doesnt have any superuser apps..

It doesnt have su or sudo.. no need.. everything runs as normal user.

Your super user logon is not working for other reasons.

Can you tell me what that ssh line does?

Are you trying to log onto an ssh server? What does the create bit do..?
[Android Software Development] Droidzone:
Yes, it creates a new shell session on Sourceforge.

I believe it's because you use dropbear. No chance of getting openssh, I suppose..

Edit: I've cross compiled my own openssh binary.

Swyped on my Htc Desire running on Supernova Extreme - Gingerbread goodness with 2 GB of Internal memory
[Android Software Development] mateorod:
I am just digging into this, but i should have known it came from xda. I found it by accident researching ways to run a Java program on my Nook Color. I have been playing with opkg, gcc-utils and Python through the alpha release of another member's project called Botbrew. I know almost nothing about this stuff, but using your tools is helping. Your app itself is just beautiful.

I am intending on running a classes.dex file through a dexdump and dedexer .jar script, so i will let you know how it goes. Thanks!

Do you think that I now have the most powerful nook color on the planet? You can be honest.
[Android Software Development] duclet:
Any way to include ssh-keygen into this? I can live without it but I would really like it so that I don't have to type in my password every time I ssh to my remote box.

Or for the person that managed to compile openssh, can you post it?
[Android Software Development] inportb:
What about dropbearkey from the dropbear project? I've a precompiled binary that you could try.

You could compile your Java program to a Dalvik program (using the dx tool from the SDK) and run it using the dalvikvm.
[Android Software Development] duclet:
I ended up with a way to generate the keys. The problem is that when working thru git, it is not using my keys :(
[Android Software Development] mateorod:
Spartacus-

I don't know if you monitor this thread that often, but I have a question. I have installed the system, and am trying to run a smali editor through the Terminal IDE. I am super new to all sorts of programming, so if this is simply not what the app is supposed to do, let me know. This is on a nook color running cm7.2.

I have tried running these commands for recompiling a services.jar file with a program baksmali.jar in order to enable the ICS supercharger as my test run

su

cd /sdcard/C. ->path to where the baksmali.jar and services.jar are stored

java -jar baksmali.jar -x services.jar -o classout

Trying to get a classout folder with the classes decompiled.

Instead of a classout, I get a java I/o exception, failed to loaddex. Baksmali.jar not found among other info. If you can tell me how to copy it, I will paste it here. I am r/w everywhere I can think of. Do I need to place my files somewhere specific, internally maybe?

Like I said, I'm real new, so any help would be welcome, from any source.
[Android Software Development] inportb:
Incidentally, I recently saw this toolkit on hacker news. And another fun toy.
[Android Software Development] gnagnone:
what about jruby/ruby?

Hello all,

I just discovered this great app, (thank you spartacus)

did someone try to install ruby or jruby on it?

with curl working it would be possible to install RVM ( ruby version manager ) and this can be a good step in the right direction...

bye

Gnagnone
[Android Software Development] Jake33108:
I installed this from the market last week, and just stumbled upon this thread browsing just now. Great work! Being able to use ADB on my phone from my tablet has been amazingly useful.
[Android Software Development] gnagnone:
@spartacus,

is there a tutorial to test if everything is working correctly? I can't find the link to it but I saw you refering to it, can you please link it?

thanks
[Android Software Development] PsychoPomp:
using scripts

First off, thank you for this app, it makes life a lot easier.

Can anyone point me to some reliable information regarding running a .sh script? I have a few commands I want to execute to setup my environment but cannot figure out how to do it. I have a file titled 'setup.sh' on the root of my sd and I want to run it on startup. I have already tried chmod 777 and +x with no success. I keep getting 'permission denied errors' when trying to run './setup.sh' the script.

Any help would be appreciated, as I am new to linux and am not sure of where I may be going wrong.

Update: I figured it out. The script cannot be on the sdcard. It works fine when I moved it to ~/bin/