[ROM] NAVDROID ION work-in-progress - G1 Android Development

I am going to be making a ION based build for lightweight speedy access of the phone. i don't know how to do crap at the moment, but i learn quick and i love stimulants LOL.
PLANNING ROADMAP
LEARN ECLIPSE AND JAVA
MODIFY ION AND REMOVE RINGTONES AND ADD MY OWN BUILD NAME
INTEGRATE SWAPPER
DO NOT CATER TO THE APPS2SD CROWD
INTEGRATE OVERCLOCK WIDGET
UPLOAD FIRST RELEASE
???
PROFIT
if any helpful developers want to lend a helpful hand. i am running windows xp in a virtualbox and have my development environment there. the final goal of this release is to have the smallest footprint possible and the most stable environment to make calls, send and receive txts, get email and use msn, but above all, PLAY MUSIC UNINTERRUPTED. i know i could achieve this with a simple stock firmware, but i see this as the anti modified firmware. everyone focuses on bleeding edge OMG HERO OMG NEW FEATURES NO ONE WILL USE. i call, i use my data plan, and i listen to my 2gigs of OGG files.
thank you
- NAVDROID

Read Java Head First
I would suggest running a Linux distro to do your editing in...sign in windows thats about it. Cygwin is not worth the trouble IMO

wat? there is an issue with my fedora wanting to run....
http://bayimg.com/AaBEFaaCF
if i could fix this issue then hellz yea i could try to do this native on my fedora, but alas it dosent wanna work.

Looks like you have an issue with you Java VM. You need to be using Sun's Java

Try this..these are about a year old so slight changes might need to be made to JRE and JDK
1. Remove all installed packages related to java:
Code:
$ sudo apt-get remove eclipse sun-java6-*
2. Download self extracting versions of JRE and JDK for Linux (jdk-6u4-linux-i586.bin and jre-6u3-linux-i586.bin). I will assume that you downloaded them in your Desktop for the rest of the instructions (~/Desktop).
3. Create the /usr/lib/jvm directory and extract the JRE and JDK binaries there:
Code:
$ sudo mkdir /usr/lib/jvm
$ cd !$
$ sudo sh ~/Desktop/jre-6u3-linux-i586.bin
$ sudo sh ~/Desktop/jdk-6u4-linux-i586.bin
4. Install java plugin for Firefox:
Code:
$ sudo ln -s /usr/lib/jvm/jre1.6.0_03/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/firefox/plugins/libjavaplugin_oji.so
5. Update alternatives for JDK (I don't really know why we must do this, any comments to clarify this will be appreciated):
Code:
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_04/bin/java" 1
6. Set /usr/lib/jvm/jdk1.6.0_04 as your first java option:
Code:
$ sudo vim /etc/jvm
The file must have in the first line /usr/lib/jvm/jdk1.6.0_04 to set that directory as your first JVM search option:
Code:
# This file defines the default system JVM search order. Each
# JVM should list their JAVA_HOME compatible directory in this file.
# The default system JVM is the first one available from top to
# bottom.
/usr/lib/jvm/java-6-sun
/usr/lib/jvm/java-gcj
/usr/lib/jvm/ia32-java-1.5.0-sun
/usr/lib/jvm/java-1.5.0-sun
/usr
6. Verify your JRE plugin installation for Firefox by visiting http://www.java.com/en/download/installed.jsp and click on "VERIFY INSTALLATION" button.
7. Verify your JDK installation by typing the following in the console:
Code:
$ java -version
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)
And that's it! You're now able to run Easyeclipse.
Happy hacking!

java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)
if this dont work, then i slit wrists and just continue using windows xp virtual machine

Woo hoo double post, I'm in the car with my dad, so excuse any android mispellings. Umm, I plan on starting with the obvious HELLO WORLD stuff, but if anyone wants to give me a quick and dirty introduction to simple update.zip editing, post it plox.

Anyone else think it's strange and a little funny that the OP makes an official ROM thread for a rom he plans to make and first on his list of things to do is learn Java?

navdroid said:
I am going to be making a ION based build for lightweight speedy access of the phone. i don't know how to do crap at the moment, but i learn quick and i love stimulants LOL.
PLANNING ROADMAP
LEARN ECLIPSE AND JAVA
MODIFY ION AND REMOVE RINGTONES AND ADD MY OWN BUILD NAME
INTEGRATE SWAPPER
DO NOT CATER TO THE APPS2SD CROWD
INTEGRATE OVERCLOCK WIDGET
UPLOAD FIRST RELEASE
???
PROFIT
if any helpful developers want to lend a helpful hand. i am running windows xp in a virtualbox and have my development environment there. the final goal of this release is to have the smallest footprint possible and the most stable environment to make calls, send and receive txts, get email and use msn, but above all, PLAY MUSIC UNINTERRUPTED. i know i could achieve this with a simple stock firmware, but i see this as the anti modified firmware. everyone focuses on bleeding edge OMG HERO OMG NEW FEATURES NO ONE WILL USE. i call, i use my data plan, and i listen to my 2gigs of OGG files.
thank you
- NAVDROID
Click to expand...
Click to collapse
Please don't keep the swapper bull**** in your roadmap. Apps2SD > Swapper for performance until they fix some of the durability issues surrounding mSDHC.
Just a suggestion.

Pinesal said:
Anyone else think it's strange and a little funny that the OP makes an official ROM thread for a rom he plans to make and first on his list of things to do is learn Java?
Click to expand...
Click to collapse
Yeah I LOL'd.
My plans to become an astronaut:
1. Learn physics.
2. ....
3..........
4. WIN.
I know it's where we all started at some point in life on SOMEthing, but it is funny for someone to call it out.
****, I'm a C# guy by trade, so for me those were the first two steps also. Learn a bit about Eclipse and refresh on Java (since that was my foundation going into C#).

No it is ****ing foolish of myself to go into this head first, but seriously how hard could it be to learn the basics of this. Unless another developer wants to take my ideas and apply them.

I have an ion r1 rom that's sort of slimmed down to things I use; I removed amazon mp3 store, email app (not gmail), talk, voice search, and voice dialing. Removed all ringtones, notifications, and alarms and replaced them with one of each taken from the htc build, removed apps2sd (seriously, who needs it when you have 89mb free at /data), pushed the overclock widget (odexed and slimmed apk), terminal, removed all locales but english, and most of the htc apks and framework libraries that haykuro had tossed in there.
You'll notice one thing when you do it, though, removing a lot of things from /system will be pretty useless because you don't even have access to it by default anyway, so making space by removing apks or media will really yield nothing. Now, if we had an spl that partitioned the nand to give system only about 64 mb (my system.img is 62 mb), and the rest to /data, you'd be looking at having about ~100 mb free from a clean install. Who really has more than 30 mb worth of apks? (and actually uses them all, calm down, apk pack rats). You'd also wouldn't have to worry about a2sd biggest flaw; no hot-swapping.

navdroid said:
No it is ****ing foolish of myself to go into this head first, but seriously how hard could it be to learn the basics of this. Unless another developer wants to take my ideas and apply them.
Click to expand...
Click to collapse
how hard is it to learn basics?...you'll see..

Hey jubeh, that modding you did is exactly what I'm going to do.

im sorry navdroid i no this isnt relevant but how is the gtx280 running on fedora lol just curious

Good luck. I'd ask you to cater to the "apps2sd crowd", but seeing as this is a rom that's supposed to be minimalistic, that would be somewhat contradictory.
Do you plan to remove the camera?

navdroid said:
Hey jubeh, that modding you did is exactly what I'm going to do.
Click to expand...
Click to collapse
sorry about posting and then seeming to disapear. the rom I made was already installed in my phone, then i deleted the update and i have the backup as a nandroid backup. I won't share that because it's got personal information. I'll try to re-make the rom and then megaupload it or rs it, or whichever one i can do quick, painless, and free. I'll need a day (not that i need all day to work on it, but I have a life too).

navdroid said:
INTEGRATE SWAPPER
DO NOT CATER TO THE APPS2SD CROWD
Click to expand...
Click to collapse
Thanks, but I'd rather stick to actual builds that allow me to use my phone to its fullest potential.

i like using a phone where i can pull the sd card out at any time without it breaking and requiring a reboot, plus i dont need 500 mb worth of fart apps (85% of market apps suck)

The issue isn't that you have a lot to learn before doing it...the issue is that really the changes that you're making can be done in about 10 minutes..it doesn't really need a new rom name for that. We're getting so many 'flavors' out there of everything that it's getting hard to keep up with it all.
* LEARN ECLIPSE AND JAVA
Click to expand...
Click to collapse
Not necessary for almost all ROM 'development'
* MODIFY ION AND REMOVE RINGTONES AND ADD MY OWN BUILD NAME
Click to expand...
Click to collapse
adb remount
adb shell rm -rf /system/media/audio/ringtones/*
* INTEGRATE SWAPPER
Click to expand...
Click to collapse
Didn't you say you wanted performance?
* DO NOT CATER TO THE APPS2SD CROWD
Click to expand...
Click to collapse
Didn't you say you wanted performance?
* INTEGRATE OVERCLOCK WIDGET
Click to expand...
Click to collapse
echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
* UPLOAD FIRST RELEASE
Click to expand...
Click to collapse
That's really on a roadmap?
* PROFIT
Click to expand...
Click to collapse
Good luck with that
That being said - I'm not bashing the idea of contribution to the platform, it's just that in all honesty you aren't doing anything that's justifiable of calling it a new ROM...it's not. The things that Cyanogen/JF/Haykuro have done and the path that JAC is headed towards is more in line with what are considered truly real ROMs -- *shrug* maybe i'm just grumpy this morning.

Related

Jesusfreke. Can you or another programmer please consider this.

In the next update on the recovery console, would it be possible to add a script that when you type /? like in old dos commands, that you will get a list of bash commands? Or does such an animal already exist.
I have a copy of about 5 sheets of paper listing all linux bash commands (similar to dos but without all the syntax).
While updating one day, I messed up and started from that point on trying to learn the linux commands that copy files, rename files, remount /sdcard and so on. Its fairly simple, but it would be nice to do for example remount/? and give you the proper usage of remount and so on. I know most of you all are not DOS fans, but I need a ground zero to start from if i wanna learn the way this runs, without carrying around a stack of papers with me .
--help works eg. ls --help
dont have a g1 yet so cant try it out, but what if you try remount --help or maybe its just one -
i will try that
I didn't see it in the list.
i dont think that wud the greatest thing becuz wat if ur typing a message anything you type in can damage your phone
kay11224 said:
i dont think that wud the greatest thing becuz wat if ur typing a message anything you type in can damage your phone
Click to expand...
Click to collapse
Huh? Wah?
Well I tried --help
This only helps if you happen to know the bash command. It is a step in the right direction.
What I am referring to is a list of /? help files.
It is a list of commands to include such commands as ls, cp, rm, remount, cd .. and so on. The reason why I say it is because with a small description of the bash commands people that have a working knowledge of computers, but not neccessarily of linux would be able to use it.
I know eventually I will probably remember the commands or at least the ones most important to me. I only ask because it took me about 1.5 hours to figure out a simple delete filename X.zip (rm update.zip), Copy filename X.zip to /sdcard (cp blahblah.zip /sdcard), mv blahblah.zip update.zip.
It took me using another computer to figure out those simple commands. I know it seems like I am asking something very redundant and simple, but I don't understand why linux command line doesn't have a help list of terms.
It wasn't until I read these bash commands that it dawned on me that recovery.sh was the recovery script to be executed from the command line. I couldn't have used it anyways, because by then I had already messed that up too.
Suffice to say I got my phone up and running and I am feeling a little proud of figuring it out on my own.
Brutal-Force said:
This only helps if you happen to know the bash command. It is a step in the right direction.
What I am referring to is a list of /? help files.
It is a list of commands to include such commands as ls, cp, rm, remount, cd .. and so on. The reason why I say it is because with a small description of the bash commands people that have a working knowledge of computers, but not neccessarily of linux would be able to use it.
I know eventually I will probably remember the commands or at least the ones most important to me. I only ask because it took me about 1.5 hours to figure out a simple delete filename X.zip (rm update.zip), Copy filename X.zip to /sdcard (cp blahblah.zip /sdcard), mv blahblah.zip update.zip.
It took me using another computer to figure out those simple commands. I know it seems like I am asking something very redundant and simple, but I don't understand why linux command line doesn't have a help list of terms.
It wasn't until I read these bash commands that it dawned on me that recovery.sh was the recovery script to be executed from the command line. I couldn't have used it anyways, because by then I had already messed that up too.
Suffice to say I got my phone up and running and I am feeling a little proud of figuring it out on my own.
Click to expand...
Click to collapse
"bash comes with help for all built-in commands. To see a list of all built-in commands, type help. To obtain help on a specific command, type help command, where command is the command you need help on. Here's an example:
bash> help alias
...some help text...
Obviously, you can obtain detailed help on the bash shell by typing man bash at your command prompt at any time."
The shell on the G1 doesn't seem to support it though...you would be better off getting comfortable in a real Distro and then apply the knowledge on the much less robust G1
This isn't quite so simple on Android.
First, you're not using bash. You're using either the android shell which is pretty limited or you're using the busybox shell (reachable with "busybox sh") which, I believe, is bourne shell compatible, but lacks some new features of bash.
Busybox is an single executible that implements a bunch of the common linux command line utilities. You're intended to symlink a bunch of command names back to busybox, but last I checked, this wasn't done so as to avoid stomping on the native android commands. You may need to type "busybox <command>" to run the right one.
To get a list of supported commands, run busybox with no arguments. Some commands have a --help option, but that won't be helpful for much of them unless you're already familiar with them.
The full documentation for any command is available as a "man" page (manual) on most linux systems, but you're not going to see it on an embedded system like android. But if you do a google search for "man <command>", you can easily find them. Many of the less basic options listed in the man page may not be available in the busybox version.
To get a list of busybox commands just type 'busybox'
If it flies off the top of the screen, type 'busybox | more'
I hope that helps.
Thanx everyone for the replies.
I had already printed out a command list which I googled. I will definitely try the busybox command. Although computers are not new to me, linux is. I am just having a slow time getting started, especially since busybox really isn't linux.
Why developers won't implement this request:
Brutal-Force: It's good that you got an answer by printing out a reference. That definitely will help you. Most of the utilities in JF's images support the standard GNU format of --help instead of /? so you're most of the way there.
Now, here are some reasons you won't get your actual request.
1) ? in the sh style shells is a protected character. To get remount /? you would actually have to type remount /\? or remount '/?'
2) All of the applications themselves would the have to be changed. Their relevant "getopts" or self-implemented methods of reading cmdline options would have to have the /? added to them. There's not a common point to change there. A quick count shows me over 150 different applications that would have to be changed.
3) It's ridiculous to cater to such a small crowd for something that is so labor intensive and can be done better with a simple documentation search.
Now go forth and RTFM. You'll be a better hacker for it.
note: JF likes notes. So do I.
note: A "hacker" is somebody like JF who makes hackable things do what hacker wants. Those other malicious @$$holes are called crackers. We don't like them.
whoa whoa whoa
First and most importantly,
BASH != DOS
Ever. Period. Don't even compare the two.
That said, learn how to google. BASH is very complicated with tons of command, keywords, etc. It is a scripting language after all.
Now, I do not see how it took you 1.5 hours (!) to figure out cp, as the first result of 'bash + how to copy files' in google gives you a link to all you could want to know.
For a complete list of command, type 'man busybox' in google and you are all set. Infact 'man YYY' will give you the manual for any command in Linux. Bash is not for those who do not want to learn, but, if one does learn it, there is no turning back from its goodness
Ok, Please take it easy on me.
This was not a "compare dos with linux" thread.
It was not a make my work a little easier thread.
I was updating 1.41 RC33 themes "AS USUAL". One of the theme designers made a boo boo. My phone went into loop while I was at work. The only computer I have access too does not have a USB port and is a Network computer that does not allow me access to this site. That being said, the only reference I had was to google linux commands. From the printout I had to figure out what does what. cp does not equal copy even though it shares two of the same letters. mv does in no way resemble rename so how on earth was I supposed to equate the two.
The problem with most people who already know linux is that they are not as helpful as a Dos or Windows "?" If they were I am sure there would be alot more people willing to give it a try. This is not really a rant, but I was asking for help, not begging to be tortured.
A few of the answers i.e. busybox helped. I did not know this, and at the time I could not look on the forum for help. I do not know about these other commands as well. Despite all that I was able to figure it out from a printout, I was just saying that knowing the list of Android based unix commands with a small one or two word description would go a long way.
P.S.
Thanx Just, Tiber and Boogie for helping me and not flaming me.
Bagkawilo
"Now, I do not see how it took you 1.5 hours (!) to figure out cp, as the first result of 'bash + how to copy files' in google gives you a link to all you could want to know."
See here is where you let your mightier then thou attitude get in your own way. For the record, that was exactly the pages I have printed out. Additionally, those pages give you way to much information to perform a specific task such as copy. Now, if i had gone to cp (Which again by the way does not mean copy to me, yes I might have figured it out quicker) but to me cp might as well have been cd.
Before I even got to that command I first had to figure out how to even access my sdcard. Next because this IS NOT DOS changing directories is, while similar, NOT THE SAME. What you have been practicing for quite some time may seem quite trivial to you, but for others its like learning a new language. I could perform the same functions in Dos or Paschal (The programmers language I learned in 15 years ago), BUT I am trying to learn YOUR language.
Seriously, I hope you never have kids who ask you how to do homework.
Just a thought
Brutal - I hope you don't think I was flaming you (you didn't mention me), because I certainly wasn't. It does come to my attention, though, that perhaps having root access on a bleeding edge image on a Linux based phone without any Linux experience is maybe like learning to pilot the Death Star before you figure out how to change the batteries in your light saber. It's good that you're learning along with the rest of us, hang in there. My recommendation: go download a copy of Slackware Linux and install it in a VirtualBox machine. Break it. Fix it. Learn how you fixed it. Break it some more.
/Just sayin...
ccosby said:
It does come to my attention, though, that perhaps having root access on a bleeding edge image on a Linux based phone without any Linux experience is maybe like learning to pilot the Death Star before you figure out how to change the batteries in your light saber.
Click to expand...
Click to collapse
As much as I enjoy a good Star Wars reference, this is a little off. I think it's more like learning to pilot a Speeder Bike before you figure out how to change the batteries in your light saber. We all know an Ewok can do it but just like the furball it's easy to go flying into a tree!
ccosby said:
go download a copy of Slackware Linux and install it in a VirtualBox machine. Break it. Fix it. Learn how you fixed it. Break it some more.
Click to expand...
Click to collapse
I'm not denying that is not a great way to learn, but unless you have a goal you're trying to accomplish it usually doesn't accomplish much. In my case I'd played with a copy of red hat years ago but without purpose so I didn't gain much. Recently I purchased a new router and loaded on a copy of DD-WRT. I had read about using it directly as a server (ftp/web/dlna) and even a bit torrent client. I wanted to use these features, so it took me a week of learning linux to get them installed. I broke the new features alot, but I didn't break my router.
So where am I going with this? I think perhaps instead of telling people to go out and learn it somewhere else, providing the answer and pitfalls to avoid would be more productive.
Like Benmeyers said.
I have had a couple different linux os's on my machine over the years, but they were only installed a very short while. I didn't see the "necessity" over windows.
Like Benmeyers said now I have a need for it. As many have pointed out, the busybox is not actually linux. What I need is to learn all of the busybox commands, which many have given me useful tips. Installing a while distribution of linux on my computer might just be overkill, and with root, I can do it just as well, after all.. it is like installing debian on my phone.
While I lived in Germany for 8 years, I HAD to learn to speak German, I went to a German Trade School because there were no American ones, and people at the one I went to did not speak English. My point is out of neccessity I had to learn it, and there were Germans who were proud that I was taking the time to learn THEIR language. I became very fluent because people took the time to help me. The ones that just laughed at me are the same ones that complained that the stinking Americans and other foreigners never bother to learn their language.
Anyway, thanx for all the help.

C Code in G1? JF? Anyone?

I'm just wondering is anyone trying this yet? i mean is it even possible?
Just a thought for you big shot android devs out there JF, Haykuro, LucidREM
Google "android jni"
Well, a quick trip around google would have helped you.
Android is using java, and currently it's not possible to use anything else.
But anyway, would you rather compile all of your code for multiple architectures? J makes things easier here...
You can write cli-apps in C though... i heard something about that there was plans to make other languages available in android, but i wouldn't hold my breath
Also, why is this related to JF/Haykuro/LucidREM?
I think you can do this with JNI: http://en.wikipedia.org/wiki/Java_Native_Interface
Using an ARM native compiler (such as the ones at CodeSourcery, http://www.codesourcery.com/sgpp/lite/arm/portal/[email protected]=lite) you can compile your apps and run them fine on the G1
Code:
$ arm-none-linux-gnueabi-gcc -static foo.c -o foo
$ adb push foo /data/foo # we are pushing to /data as it is +rwx (read, write, execute) for a standard user.
$ adb shell /data/foo
a=1
b=2
foo=a+b
foo=3
^^^
OH I love when I stumble across a post like this and have something new to play with.
The problem is due to the different location of the linker and mainly the different libc you have to statically link everything.
I have been having a hell of a time getting DPKG to build statically.
I picked up a copy of the newly released book, Unlocking Android, at Barnes and Noble yesterday. There is a whole chapter devoted to writing native apps using C (and ARM assembler) with the CodeSourcery tools linked above. The author walks through the steps you need to do to dynamically link the libraries so you don't end up with enormous statically linked executables. Well worth the price.
It is surprising what you can do with C on the phone, its actually not too difficult. The method outlined below doesn't use the non native toolchains and if you use the sourcery toolchain (as mentioned above) you will end up with bigger binaries as you need to link in a standard glibc and not androids bionic libc. This may or may not be important for your project.
The other advantage of the steps below is that you will build and link against any library that is available to the android platform
The easiest way that I've found to start when porting or writing new applications is this method.
1) Check out the current git android source.
2) Build the entire tree, "make" in the top level directory.
3) Create a new directory in mydroid/external/packagename/
4) Copy one of the simple android Android.mk (Make) files from a "like" target.
(If doing a library, choose a library, if coding an executable , choose that).
5) source the mydroid/build/envsetup.sh in the users bashrc
6) cd to your directory, then instead of the usual "make" do an mm.
This should create a binary, which you can adb push to the phone and run at the console.
You can do all the usual things if linked properly, like write the framebuffer using sdl, play sounds, create network connections.
Just remember that you dont have a standard libc (glibc) to play around with you have "bionic". If you are missing your favourite glibc function , it is probably intention and not abug. You'll either need to port it or make do with the functions provided by bionic.
These instructions are for a "pure" C program. you can mix the java like dex calling by 'shelling' out to the C application when you need performance, however premature optimization is the root of all evil, you'll be surprised what performance you can pull from davlik (And I expect the VM guys to improve this even further).
I know that is a lot to digest. Will do the best I can to answer your questions. I'm by no means an expert in the area, but have learned a bit about C on android.
Well I don't know much about all this but what i know is that e.g.
ScummVM IS written in C++ , and so is g-arcade.
His FAQ says:
"How did you do this? Is it Java?
No. ScummVM is a C++ program. For this port, I turned it into a really big JNI library so Android still thinks it's running a Java program, but almost all of it is implemented in C++."
(http://sites.google.com/site/scummvmandroid/faq#TOC-How-did-you-do-this-Is-it-Java-)
So if some1 wanna port MAME, feel free to xD

JIT in Dalvik JVM

Hello,
Do you know that it is possible to enable JIT in Dalvik JVM?
http://groups.google.com/group/0xlab-devel/browse_thread/thread/1edef26f4e5b7427
According to the Dalvik developers it is possible to backport JIT to the Donut tree and gain ...1.74x in performance!!! It would be awesome if someone could spend some time and create a ROM with that patches applied.
Anyone?
Karol
I think you misread somewhere.
It is a *new feature* they are *adding in*. The current JIT in AOSP/master is in development (i.e. incomplete). You can play with it if you want, but you should consider this to be a future new feature that will be added to official builds.
Well, I though that this is xda developers forum, place where even experimental Android features are welcome (vide extra memory hack and others...
And while English is not my native language I doubt that I have misread it. The current master tree ALREADY contains JIT implementation PLUS there are patches which allow using it in the Donut tree. So even though it is experimental it is worth checking out because it apparently it can be compiled and tested...
I would do this by myself, but since a week or so I am unable to update my donut tree, I am getting "fatal: The remote end hung up unexpectedly" messages
The current master branch in AOSP is eclair. If you use repo to sync the AOSP source, then build, the branch it pulls out (according to the output from envsetup and the lunch menu I receive) is eclair (2.0). I doubt that the donut branch has the code for the Dalvik JIT.
It *may* be possible to backport it to donut (1.6), but why when 2.0 is running on the Dream except for some AV/codec issues without problem?
Let me quote developers behind JIT in Dalvik....
NOTE: the results were measured in Donut based environment. That is,
there are some changes for Eclair backport to Donut without replacing
the libcutils and bionic, which were modified a lot in Eclair.
If you would like to introduce Eclair's Dalvik VM in Donut based
products (especially for 3rd-party components compatibility), feel
free to apply the attached patches and rebuild Android.
Here are the instructions:
# cd android-donut
# mv dalvik dalvik-orig
# . build/envsetup.sh
# git clone git://android.git.kernel.org/platform/dalvik.git
# cd dalvik
# git apply dalvik-eclair-backport.patch
# mm
# cd ../frameworks/base
# git apply frameworks-base-eclair-backport.patch
# mm -B
# cd ../../
(Do copy out~system to your target.)
Click to expand...
Click to collapse
This is from the link I pasted in my first message...
And why? Well, because there will be no full Eclair build for G1 until HTC releases some closed source components which currently doesn't work with the Eclair kernel. So this is still worth trying out, I doubt that those components will be released in near future...
karolbe said:
Let me quote developers behind JIT in Dalvik....
This is from the link I pasted in my first message...
And why? Well, because there will be no full Eclair build for G1 until HTC releases some closed source components which currently doesn't work with the Eclair kernel. So this is still worth trying out, I doubt that those components will be released in near future...
Click to expand...
Click to collapse
Ah, I stand corrected. It looks like it is indeed workable to get 1.6 with a JIT Dalvik. However, once HTC (or Qualcomm) releases the needed A/V drivers, 2.0 will be fully functional on the Dream. But, this might be nice in the interim.
Is that just the Eclair Dalvik version, or is it also the JIT-enabled Eclair Dalvik?
There /is/ a difference between the two.
I've had the JIT-enabled Dalvik running for a bit (on CM 4.2.5), but it's a memory hog and has a weird performance profile. It will shave 4 seconds off your "Benchmark PI" score, but interactivity of the device suffered. And it crashes sometimes.
If you want to try it (CM-4.2.5 only), here's a copy of the file:
http://n0rp.chemlab.org/android/testing/libdvm.so
Yeah, I tried it out, and the phone seemed to be less responsive. When I tried to install an app the phone rebooted, and now it seems to be booting to a certain point and then shutting down again. Nice progress though.
cyanogen said:
I've had the JIT-enabled Dalvik running for a bit (on CM 4.2.5), but it's a memory hog and has a weird performance profile. It will shave 4 seconds off your "Benchmark PI" score, but interactivity of the device suffered. And it crashes sometimes.
If you want to try it (CM-4.2.5 only), here's a copy of the file:
http://n0rp.chemlab.org/android/testing/libdvm.so
Click to expand...
Click to collapse
Memory Hog.
That's what I was afraid off, that a JIT would hog memory. And if there's 1 thing that my G1 is really short of, it's memory. RAM for running applications. So no please no more memory hoggging on my G1! ;-)
I'm afraid that memory hogging is kind of unavoidable for a JIT.
Just my 2ct.
--Tim
Anyone tried this with the memhack and CompCache running?
EDIT: Running it myself now. Can't see any lagginess; everything seems to be running quite snappily. Going full-time with it now.
I haven't done any java stuff for a while, so I might be off. Anyways, since this is a vm library change, I assume it runs in mixed mode (dynamnically compiles the java byte code when needed), which may cause performance issues. Is there a way for us to pre-compile all the java code in the apps with jit? and have the apps run natively without the dalvik vm at all? This would be the most desirable. I think the biggest weakness in android is the dalvik vm. It is a huge memory hog. If we can use jit to compile the apps into native instructions then theoretically we shouldn't need the vm to run at all.
If this jit is run in mixed mode, if it is done correctly it should still help. You should see performance increases on the second time you run the app.
If this jit is run in mixed mode, if it is done correctly it should still help. You should see performance increases on the second time you run the app.
Click to expand...
Click to collapse
Umm... that's just not how JIT interpreters work.
Seriously -- JIT compilers don't change the core data of the application at all; they just translate bytecode into machinecode within the runtime environment in order to speed up the execution of frequently-encountered "strings" of code within the application as they are encountered.
Seriously: try this link [ http://psyco.sourceforge.net/doc.html#how-does-it-work ] to get a better understanding of why what you just suggested displays a bit of ignorance regarding the topic-at-hand.
A bit of ignorance is a compliment. Like I said I have not done any java work for a long time. What I don't understand about jit the way it is done, is why not go all the way and generate the native code similar to the odex files, and just by pass the vm all together. If they are going to the trouble of compiling byte code into native instructions anyway.. why not just do it once and get it over with instead of compiling it over again and again... for short running tasks like most apps on android, it may very well be a perf hinderance.
IConrad01 said:
Umm... that's just not how JIT interpreters work.
Seriously -- JIT compilers don't change the core data of the application at all; they just translate bytecode into machinecode within the runtime environment in order to speed up the execution of frequently-encountered "strings" of code within the application as they are encountered.
Seriously: try this link [ http://psyco.sourceforge.net/doc.html#how-does-it-work ] to get a better understanding of why what you just suggested displays a bit of ignorance regarding the topic-at-hand.
Click to expand...
Click to collapse
why not just do it once and get it over with instead of compiling it over again and again... for short running tasks like most apps on android, it may very well be a perf hinderance.
Click to expand...
Click to collapse
Well, I can think of a few reasons.
1) High-level programming languages are just plain easier to write for. Python, for example, uses an interpreter (VM) as well -- though you can compile it once and be done with it. High-level languages, as such, typically don't compile well because of the lack of "symmetry" that you get between higher-level languages and actual machine code. (Remember, my friend, the The Story of Mel )
2) JIT compilation in interpreters get you //near// compiled performance from non-compiled code. In other words; you write the program to the VM once. The VM then gets compiled one time for each platform, (Remember; despite being essentially the same hardware the Dream is somehow two different boards each of which would require a separate compile... :/) and this will only get worse over time. Now, the programmer doesn't have to specifically call up devices based on the platform but rather on the VM. He doesn't have to re-compile for each CPU/integrated-board circuit. You don't have to store, for example, one version of an app for Dreams/MT3G's, one for Heroes, one for Droids... and down the road, one for the MIPS chips, etc... Saves massively on storage considerations for centralized distribution repositories like the Market itself is.
3) VMs can be functionally isolated, preventing most forms of malicious program code escalation. Sandboxing programs is far easier when those programs are running in their own VMs. Each program/task is initiated within its own VM, which makes initialization and garbage-cleanup rather simple. For such an open-to-communications platform as a mobile phone, that can only be a good thing. Natively compiled code typically doesn't play so well with such sandboxing.
Those are just the thoughts off of the top of my head. I feel it important to note that IANAP.
I'm trying the libdvm.so cyanogen posted on my 32A magic (288MB of RAM) and so far it's all working well, and it seems much faster
Using 4.2.5 on 32A Magic with 4.2.4 Radix Kernel with New JIT Based libjvm.so
Everything Works Well and Never had any Force Close but is that 4.2.4 Kernel from Radix actually uses JIT.
@cyanogen 32A have 288 MB ram i can test JIT based Dalvim if you want me to test it
Ok, I integrated this lib with Cyan 4.2.5. Running comp-cache and Ram hack, 16GB class 2 SD.
Initial impression (based on 20 minutes of playing);
No change in OS speed. No crashes yet. Apps (especially game emulators) have a noticeable increase in speed. I have no technical information to back up my claims, nor do I have the possibility of an ABX comparison. Sorry.
Thanks for the explanation, I buy #3 as far as security is concerned, we all know those virus taking advantage of overflow instructions in windows. But As for #2 I don't mean to have developers compile the byte compile to native, but have the vm on our phone compile it on first run and save the native instructions in file similar to how it generates the dex files on first run. This way it'll not have to recompile every time it runs. I just wish there is a way to avoid the dalvik-vm.
I irks me how much memory the dalvik-vm hogs up. A simple battery widget takes 12-16mb of memory.. It has a few pics and bytecode that simply goes to the system driver go get a number. I mean the whole ext3 filesystem driver uses less memory. Same with those widgets for task killing, they take up well over 10 mbs, which kind of defeats the whole purpose. I could write a simple tiny script that uses kill and do the same job without taking up 10m+ in the background.
We all here complain about our hardware, but I feel like these are more of software problems. anyways, that's just my rant... i hope the memory issues in vm gets better in later release.
IConrad01 said:
Well, I can think of a few reasons.
1) High-level programming languages are just plain easier to write for. Python, for example, uses an interpreter (VM) as well -- though you can compile it once and be done with it. High-level languages, as such, typically don't compile well because of the lack of "symmetry" that you get between higher-level languages and actual machine code. (Remember, my friend, the The Story of Mel )
2) JIT compilation in interpreters get you //near// compiled performance from non-compiled code. In other words; you write the program to the VM once. The VM then gets compiled one time for each platform, (Remember; despite being essentially the same hardware the Dream is somehow two different boards each of which would require a separate compile... :/) and this will only get worse over time. Now, the programmer doesn't have to specifically call up devices based on the platform but rather on the VM. He doesn't have to re-compile for each CPU/integrated-board circuit. You don't have to store, for example, one version of an app for Dreams/MT3G's, one for Heroes, one for Droids... and down the road, one for the MIPS chips, etc... Saves massively on storage considerations for centralized distribution repositories like the Market itself is.
3) VMs can be functionally isolated, preventing most forms of malicious program code escalation. Sandboxing programs is far easier when those programs are running in their own VMs. Each program/task is initiated within its own VM, which makes initialization and garbage-cleanup rather simple. For such an open-to-communications platform as a mobile phone, that can only be a good thing. Natively compiled code typically doesn't play so well with such sandboxing.
Those are just the thoughts off of the top of my head. I feel it important to note that IANAP.
Click to expand...
Click to collapse
cyanogen said:
I've had the JIT-enabled Dalvik running for a bit (on CM 4.2.5), but it's a memory hog and has a weird performance profile. It will shave 4 seconds off your "Benchmark PI" score, but interactivity of the device suffered. And it crashes sometimes.
If you want to try it (CM-4.2.5 only), here's a copy of the file:
http://n0rp.chemlab.org/android/testing/libdvm.so
Click to expand...
Click to collapse
Could anyone upload that again? The link is dead.

Compile and execute programs on Android 2.2

Hello friends,
I am in need of an installation of gcc such that I can execute the gcc command in the terminal emulator.
My aim is to be successful in writing and compiling programs on my Android (LG Optimus One P500) during travelling and other wasted time.
Thanks.
Probably not exactly what you want but here's the closest I've got for you, http://code.google.com/p/android-scripting/
I'm looking at the same thing on my debian machine and from what i gather the android sdk devel tools along with nvidia's tegra addon give you an arm cross compiler and the include files and kernel headers you'd need.
d0ugie said:
Probably not exactly what you want but here's the closest I've got for you, LINK
Click to expand...
Click to collapse
Thanks for the link. I am trying them out tonight.
gitorious.org/android-toolchain > Someone please try this out and tell me if it works (I will try it out by myself this weekend anyway... So if you have time )
touchqode - mobile code editor and SL4A
I'm not sure if I can post links, but you can search the Internet and/or market to find it. I've played with it for a minute, but plan to use it along with SL4A since they both support Javascript. I don't think Sl4A supports PHP at the moment, but I'm pretty sure it'll be added at some point. I hope this helps.
Topcheese said:
I'm not sure if I can post links, but you can search the Internet and/or market to find it. I've played with it for a minute, but plan to use it along with SL4A since they both support Javascript. I don't think Sl4A supports PHP at the moment, but I'm pretty sure it'll be added at some point. I hope this helps.
Click to expand...
Click to collapse
I am quite satisfied with the range of languages I have. Python + Lua + Perl
My goal was to make g++ and gcc run on Android, but I think I am done for now. Next would be making Debian work for my LG

Development Environment Setup: Hardware?

Asking this question because the attempt to get TWRP on my device is becoming a compound problem as the distance to being able to build it approaches 1. Otherwise known as the law of inverse noobness: Hindsight is always 20/20. Personally, not even half way to 1 in being able to do this, as am fairly new to doing things at the operating system level of programming. Not brand-new though, and knowing how and where to look things up helps, so if you have hints or can point me in the right direction that'd be great. First question is sort of along the lines of "how do you setup your dev environment" if you want to make it modular? More precisely:
So right now, the build page for AOSP concerning my device says to use Ubuntu 14.04 and do all those things to set it up for that. Do I need to do that in order to get TWRP built for my device? To have it set up the same way as the AOSP advises? Having a different computer for each dev environment would be a bit much, but running them in qemu seems even more ridiculous. Perhaps a better idea is to set up a "build environment" on bootable USB sticks that do all the work? That would simply a lot of things, like not having to swap out hard drives, and being able to easily clone a USB drive to "just work" and build AOSP/TWRP at will on any computer.
For reference, it is the Moto G Power (2021) "Sofia" device. They've released sources for it, but not much development going on. So learning how to do this for my device might just unlock TWRP (and with it, probably the Nethunter kernel/chroot environment) for other devices not yet supported.
Help me, help you. Thanks.
(Have other questions, too).
Why not use WSL2?
How to install Linux WSL2 on Windows 10 and Windows 11
The latest version of the Windows Subsystem for Linux is a significant upgrade; for most, it's now easier than ever to install.
www.windowscentral.com
jwoegerbauer said:
Why not use WSL2?
Click to expand...
Click to collapse
I don't use windows.
Bump.
Asking this because it seems that, being new to programming and having no formal training, I'm missing something from tutorials (like the TWRP git page, or some of the tutorials here on this forum that haven't been updated since 2013) and other material that might be thought to be "known" or "implied" and I just can't seem to understand what. Because when I go to build projects or whatever, following tutorials to the letter, still end up with errors and other problems that aren't covered in the tutorial. Part of that problem is installing dependencies, and then having them conflict with other installed things, like having two of python and three versions of java. So having a "build environment" to prevent conflicts is something that wasn't taught, but learned through trial and error, but that isn't the only problem I'm having.
McChadwicke said:
For reference, it is the Moto G Power (2021) "Sofia" device.
Click to expand...
Click to collapse
Hmm. I have the same model, but it's "borneo".
Did you build TWRP for your device? Any pointers or tips?
I usually just modify stock recovery to have rooted, permissive ADB.
I really don't need more than that in a recovery.
I haven't done much with my GP21 since the Firehose loader is restricted.
Renate said:
I usually just modify stock recovery to have rooted, permissive ADB.
I really don't need more than that in a recovery.
I haven't done much with my GP21 since the Firehose loader is restricted.
Click to expand...
Click to collapse
Not sure why the last reply didn't quote you...
Setting up a build environment is an evolving problem. As of this writing it seems the Ubuntu team is switching to a "pro version" system, a paywall, for some services...
Also, AOSP recommends Ubuntu 14 for a build environment. Gave up trying to run it from USBs lol, it is running on a dedicated system. But android-sdk is no longer available in apt, while running Ubuntu 14.04 + latest updates? So went to check why and now AOSP is using its own system for build environment setup and management. Tried running it in Ubuntu 14, but gave errors with the setup script provided.
Seeing now if I can't get the android sdk to run in Mint-XFCE... Will check back. TWRP build page says I need these things to build it (TWRP), right?
Also, how much of the preinstalled vendor crud can be pruned before it breaks?
Thanks.
Edit: reference on the TWRP guide I'm using is https://forum.xda-developers.com/t/...ompile-twrp-from-source-step-by-step.3404024/ (posted 2016)
I think that all build environments are getting more restricted.
"Just do it OUR way" seems to be the new corporate slogan.
I build Android apps without Android Studio, Gradle or an IDE.
Renate said:
I think that all build environments are getting more restricted.
"Just do it OUR way" seems to be the new corporate slogan.
I build Android apps without Android Studio, Gradle or an IDE.
Click to expand...
Click to collapse
Does TWRP have its own build control system? Considering all these changes, should it?
To keep things isolated, clean and manageable on host system, that has no dev tools
or anything extra besides standard desktop stuff. (under main linux distros)
#1 For smallest , fastest deployment of various build/dev environments i use schroot
on devuan/debian , it is a system to manage/automate the use of chrootable containers.
like regular manual chroot but most thigs are automated/preconfigured with
just a few commands and config files.
Basicaly a new root filesystem (userspace) that is independent of hosts root filesystem and just
uses hosts kernel (or as much/little acces to kernel as you give it trough schroot config files)
has its own packages and dependencies and will only see specific sections of hosts filesystem sections you give it access to like say /src/myproject from host. can be a separate /home
or shared with host, all depends on your config.
Using debootstrap to create the filesystems for containers of specific distributions/verions.
Or can just manualy copy an install and rip out the kernel etc...
(Can install ubuntu userspace in debian with debootstrap , if need be.)
(like lineageOS was hard to find all the correct/matching dev tools under devuan, so ubuntu it was)
#2 For something a bit beefier LXC on top of libvirt.
(regular chroot wont run services, or have its own networking , LXCs can , with some extra configuration)
#3 For when you just need an actual full blown VM os installation use KVM/qemu on top of libvirt .
(like installing 15 year old redhat 5.1 in a container wont work, kernels and main libs too far apart)
(or anything that is just too different from current linux kernel , other OS s etc...)
virt-manager is nice for graphicaly managing VMs and LXCs
#1 But schroot is essential and will suffice for more then 90% if not whole 100% of your needs.
if you want a clean host system from being clobbered by constant installing and testing and such . Keeps the environment contained in its own filesystem namespace , have as many as you need .
start fresh,rollback,clone etc.............
Once configured just start another tab in a terminal emulator and schroot in to the container
and your main host system in unaffected, always clean .
#4 Running all of this on top of ZFS takes it a step up, to the next level of effeciency.
zfs helps quite a bit with cloning,branching,snapshots, rollbacks but not essential,
like git versioning for things that are too big for or are not made for git management
(but is another system on to itself to learn, so ignore it if new to linux )
just cloning a 300Mb-1Gb base bootstrap install folder takes no time on regular filesystem on ssds .
With these 3 tools , you can have 10s if not 100s of different environments on a single host
quickly deployable once you get to know the procedures. all usable at the same time without
reboot,
#5 The most important is learning how to hunt for the right version of tools and all of the
dependencies and the correct versions of those , as each project will have their own
and will base it on their own distribution of choice at a specific point in time.
(by being able to install/test/restart in container makes this whole process , easier)
you can test many different ideas at the same time , and merge what works in
to your own dev-build-env for a specific project.
(like hunting down correct tutorial for specific/old/obscure phone and a rom and recovery
and rooting tools associate from a time long past. using wayback machine to source
correct versions of each , as normal web has erased them )
even used schroot to install games for nephew from untrusted sources without hesitation,
and just delete the container when done, but that was a bit more involved as proprietary
nvidia drivers had to be installed on host and partially in containers.
dandudikof said:
To keep things isolated, clean and manageable on host system, that has no dev tools
or anything extra besides standard desktop stuff. (under main linux distros)
#1 For smallest , fastest deployment of various build/dev environments i use schroot
on devuan/debian , it is a system to manage/automate the use of chrootable containers.
like regular manual chroot but most thigs are automated/preconfigured with
just a few commands and config files.
(like hunting down correct tutorial for specific/old/obscure phone and a rom and recovery
and rooting tools associate from a time long past. using wayback machine to source
correct versions of each , as normal web has erased them )
Click to expand...
Click to collapse
neat. schroot looks like a solution. answers a lot of questions, anyway. that last part scares me though. using the wayback machine to source things jeez. there's gotta be a better way, but probably not unless i want to do it myself which will only add time to "the project".
McChadwicke said:
neat. schroot looks like a solution. answers a lot of questions, anyway. that last part scares me though. using the wayback machine to source things jeez. there's gotta be a better way, but probably not unless i want to do it myself which will only add time to "the project".
Click to expand...
Click to collapse
That was just worse case scenario if you get in to very obsolete/old/abandoned stuff (10-20 year old) projects/hardware etc...
dandudikof said:
10-20 year old
Click to expand...
Click to collapse
yeah some of the hardware is in that range. actually upgraded one of the old rigs (because parts are cheap) from an athlon to a phenom lmao thing has 16gb ram, it is stacked now with top of the line things from that era. keeping it around for nostalgia's sake at this point since it still works.
xmrig gets abysmal hash rates, not even worth running on older hardware.

Categories

Resources