I really liked new Gingerbread Keyboard but was bugged by the fact that it was missing Croatian language dictionary, so I tried to figure out how to create one.
I made it, and it's working great so I decided to share the procedure here so others can make use of it.
Here it goes...
What you need:
1. Good source for word list frequency
Good prediction Dictionary relies on word list frequency, as defined by the AOSP
http://android.git.kernel.org/?p=pl...33b63a8b8a1043fceae592b567b93ee275504;hb=HEAD
So, you need a source from which you can extract how often different words appear. After some thinking, googling, trial and error I came to conclusion that for smartphone usage there is no better place than big national forum. That's what I used, anyway.
2. OpenOffice (and MS Office) dictionary for your language
You can find it here:
http://extensions.services.openoffice.org/en/dictionaries
You don't want to have misspelled words in the dictionary, right? So, after creating word list from the source, you'll want to throw out the words that are not in this list.
Just to be sure that I'll keep all the 'good' words in the list I also ran MS Office Spelling procedure trough it. Will explain it later on.
3. Tools - GNU Utilities, MS Office, Ultraedit, Wget (HTTrack)...
There are no more powerful tools for stream editing than Unix tools. Period.
At first I tried to do something without it and when I learned a bit about them, realized how great these are for task like this. Get them here:
http://sourceforge.net/projects/unxutils
Windows comes with it's own 'sort' command but you'll want to use the one from GNU utilities, so put it in the directory where you start your commands from.
You'll need to download that forum that I mentioned earlier somehow. I used wget:
http://www.gnu.org/software/wget/
It was pretty slow (took like two days to mirror part of the forum with posts). When I was near the end with the download I learned about HTTrack:
http://www.httrack.com
I tried it out shortly and it seems a lot faster (can do multiple connections!)
4. Makedict
Get it here:
http://softkeyboard.googlecode.com/svn/trunk/DictionaryTools/
For Windows, you need makedict_Windows.bat and makedict.jar
PROCEDURE:
I don't have experience with html, so at first I had to study how is vbulletin forum that I aimed at structured. I wanted to download just the pages that contain posts, and not memberlists etc. At the end I came up to this syntax for wget
Code:
wget -k -m -E -p -np -R member.php*,memberlist.php*,calendar.php*,faq.php*,printthread.php*,newreply.php*,search.php*,*sendtofriend*,sendmessage.php*,*goto=nextnewest*,newreply.php*,misc.php*,forumdisplay.php*,showpost.php*,announcment.php*,image.php*,viewonline.php*,showthread.php*mode*,showthread.php*s=*,showthread.php*page* -o log.txt http://xxxxxxx.hr/
I'm not sure if the syntax is entirely correct, but it worked for me, so I never looked back. Wget started to download only the stuff I wanted - thread pages from forum. It took long time to collect 9 GB of data. Look at the HTTrack. I think it can do it much faster.
Now you want to extract only messages text from the html
Code:
cat showthread* | sed -n "/<!-- message -->/,/<!-- \/ message -->/p > forum0.txt"
Check out what you got. You don't want the quotes included in this because they would pump up the word count for words that appear in them, so strip that out too:
Code:
sed "s/<[^:]*said://g" > forum1.txt
Finally, strip out the rest of HTML code:
Code:
sed -e "s/<[^>]*>//g" forum1.txt > forum2.txt
I noticed that I had some leftover croatian characters represented with their Unicode codes, so I replaced those too:
Code:
cat forum2.txt | sed "s/š/š/g" | sed "s/đ/đ/g" | sed "s/č/č/g" | sed "s/ć/ć/g"| sed "s/ž/ž/g" | sed "s/Š/Š/g" | sed "s/Đ/Đ/g" | sed "s/Č/Č/g" | sed "s/Ć/Ć/g" | sed "s/Ž/Ž/g" > forum.txt
Found the codes here:
http://yorktown.cbe.wwu.edu/sandvig/docs/unicode.aspx
Now you can start to make your word list by throwing out all but words
Code:
cat forum.txt | tr "[:punct:][:blank:][:digit:]" "\n" | grep "^." > unsortedallwordslist.txt
and counting how often they appear
Code:
cat allwordslist.txt | tr "A-Z" "a-z" | tr "ŠĐČĆŽ" "šđčćž" | sort | uniq -c | sort -nr > words.txt
I got around 205.000 counted words after this.
Now when you have it all nicely counted and sorted, you want to throw out misspelled and incorrect words from it. I used Excel for it. But first, I took OpenOffice word list (you can simply unzip oxt file) and cleaned it up a bit.
First, you need it in correct Windows encoding. Ultraedit can do it. In my case I had to convert from iso-8859-2 to win-1250. Open an iso-8859-2 document, go to "view/set code page" and choose "iso-8859-2", than go to: "file/conversions" and choose ASCII to UNICODE, than you will see all characters right, but when you want save edited code/text you must
convert it back, so choose UNICODE to ASCII and save it, that's it.
Also, it had suffixes such as "/AE" here and there so I removed those too
Code:
sed "s/\/[A-Z]*//g" hr_HR.dic > hr_HR.txt
and mad it all lowercase
Code:
cat hr_big.dic | tr "[A-Z]" "[a-z]" | tr "[ŠĐČĆŽ]" "[šđčćž]"
Now I imported both lists in Excel and simply checked if my forum word list words are correct by checking if they can be found in OpenOffice dictionary.
=COUNTIF('openofficedic'!A1:A375541;B1)
After that's finished, copy just the values in new column and delete the column with formulas, so it doesn't go trough it again. Sort by new values you got and keep the ones that passed trough this 'spell check' (I got around 90.000 woords in this step).
Cut&paste rows that have zeros in it in new worksheet. I wanted to compare those with MS dictionary so I don't throw anything out that is not in OpenOffice dictionary. Here is the function I used
Code:
Public Function SpellCheck(rng As Excel.Range) As Boolean()
Dim i as Long, size as Long
Dim objExcel as New Excel.Application
Dim result() as Boolean
size = rng.Cells.Count
ReDim result(1 to size)
for i = 1 to size
result(i) = objExcel.CheckSpelling(rng.Cells(i).Text)
next i
SpellCheck = result()
objExcel.Quit
End Function
The function I found was originally written to act as an array function but I never managed to work. But it worked as normal function and I just invoked it by
Code:
=SpellCheck(B1)
This took reaaaally loooong time. Again copy values to new column and delete the column with formulas so it won't go trough it again. Delete the rows with 'FALSE' in it. Check trough the rest and clean it up a bit - MS spellcheck can act funny sometimes. I got another 20.000 words from this list that weren't recognized by OpenOffice spell check, merged two lists and the final word count for dictionary was now around 110.000. I believe it's optimal, maybe a little on a bigger side, but the final main.dict is just under 900 kB which is more than acceptable.
Now, you have to distribute frequencies in 255 classes for Gingerbread prediction engine. You could do it just by dividing every number with a factor you get by dividing top word count by 255. But look at the scatter plot of this and you'll notice that you'll spend top classes very fast that way. So, I optimized the distribution a bit in a separate calculation. I arranged the word count in top class to be 1 and calculated the rest by using the formula "nextclasswordcount=previousclasswordcount*factor^4". I used Excel Solver to find the factor. Total word count had to match original wordcount (in my case 110.000), obviously. I even corrected it a bit, so that sum in new distribution is only 70.000 (1 in first class and 2000 in last), so that it smooths out the distribution nicely with more frequent words and let the rest of 40.000 fall in class "1". It took some tweaking and you could use better formula maybe, but this worked for me much better than just dividing it with same factor.
I had this calculation in two separate rows and returned the classes back next to the words:
Code:
=IF(ISNA(HLOOKUP(A6;$J$4:$JD$5;2;FALSE));D5;HLOOKUP(A6;$J$4:$JD$5;2;FALSE))
Maybe it's best to d/l xlsm from here so I don't have to explain a lot...
The rest is easy. Create the string needed for correct xml format,
Code:
=CONCATENATE("<w f=";CHAR(34);D2;CHAR(34);">";F2;"</w>")
close the word list with "<wordlist>" in first and "</wordlist>" in last row and add "<?xml version="1.0" encoding="UTF-8" ?>" at the top and finally compile the .dict file:
Code:
makedict_Windows.bat from.xml > main.dict
Phew! A lot of typing.
And here is the LatinIME.apk with croatian layout and dictionary that I got this way:
HR_Gingerbread_keyboard-1.0.apk
I used mobilix's layout (thank you!) with just few my own corrections (corrected & glitches in symbolic keyboard).
And hera are resources where I got inspiration from (thanks Gert Schepens):
http://www.gertschepens.be/android-dictionary-files
http://blog.cone.be/2010/08/19/android-keyboard-dictionaries/
So much for now. Enjoy.
Now, the next step would be to try to include my work in official AOSP or maybe Cyanogen source. I could use few pointers on how to do that. I would prefer to do it simple. I registered on github, but that's where I got for now. I have to do some more reading about it...
Thanks for your guide!
I successfully created a danish dictionary, but how do i implement the main.dict file i just created into the LatinIME.apk?
In the LatinIME.apk file, i tried creating the folder /res/raw-da, and putting the main.dict file there. But it didn't work.
I'm glad you made it!
Be sure to create nice, clean main.dict which we will add to AOSP hopefully.
I used APK Manager to decompile, add 'raw-hr' with my main.dict, recompile and sign the .apk that already had Croatian layout. There was a bug in .apk I used that was preventing language switching and I noticed that the bug was widespread in many LatinIME.apk versions floating around. I don't know where this bug comes from but the problem was in default main.dict file in 'raw' folder which had to be replaced with proper one (I took from Cyanogenmod version of LatinIME, but you can use my .apk).
Can you, please, send me somehow this, already produced Croatian dictionary file in order to incorporate it into mine Gingerbread keyboard?
Thanks.
I presume you're after main.dict...
Use APK Manager, decompile my apk and you'll find it in 'raw-hr' folder.
Sent from my HTC Desire
hi there, i was so grateful to have found this thread after googling for almost 7hours for a tagalog dictionary
although your method of bytestreaming a forum could not work for for me who has no fast internet connection.
so i would like to verify if, upon continuous usage, will the Gingerbread keyboard modify the word frequency over time?
i mean i could modify a script to just assign 0 as frequency value for all words and use make_dict, (or to avoid problems, just assign any random value from 0 - 255)
and as i use my keyboard, will it edit those frequency scores eventually?
anyway, im trying it out right now and would post my results here too.
again thank you very much for your insight
Thank you very much! (Hvala!)
lockzackary said:
hi there, i was so grateful to have found this thread after googling for almost 7hours for a tagalog dictionary
although your method of bytestreaming a forum could not work for for me who has no fast internet connection.
so i would like to verify if, upon continuous usage, will the Gingerbread keyboard modify the word frequency over time?
i mean i could modify a script to just assign 0 as frequency value for all words and use make_dict, (or to avoid problems, just assign any random value from 0 - 255)
and as i use my keyboard, will it edit those frequency scores eventually?
anyway, im trying it out right now and would post my results here too.
again thank you very much for your insight
Click to expand...
Click to collapse
I'm very much looking forward to your results..
it's driving me crazy everytime i reflash my ROM that i need to rebuild my Tagalog user dictionary.
@ytsejam_
Hey there, i was done with the dictionary although i have yet to test it with a compatible rom, and to further complicate thngs, its too tedious to populate the dictionary with tagalog text-speak (e.g.: cnu,sno)
As there are so much variations for a single word, hehe although im still building it up so hehe, i hope other pinoy's can wait for it,
As far as i know this approach on creating dictionaries only work on Samsung devices and not necessarily android so i hope by then they still own their galaxy hehe
Sent from my GT-I9000 using XDA App
Need a keyboard not just dictionary
Hi,
I just wanna add a new language (in this case, Persian) for keyboard.
I Use Cyanogen 7 and it supports Persian and Arabic very well. but it has no layout for Persian (but it has arabic) can you please help me with this?
Just some clue.
thanks
behdude said:
Hi,
I just wanna add a new language (in this case, Persian) for keyboard.
I Use Cyanogen 7 and it supports Persian and Arabic very well. but it has no layout for Persian (but it has arabic) can you please help me with this?
Just some clue.
thanks
Click to expand...
Click to collapse
Copy kbd_qwerty.xml and kbd_qwerty_black.xml to appropriate xml-xx subfolder and edit it in unicode. You should figure it out. It's pretty easy.
Hi, I tried installing it on CM7 Wildfire, but I keep getting App not installed. Do you know the cause maybe?
dcos said:
Hi, I tried installing it on CM7 Wildfire, but I keep getting App not installed. Do you know the cause maybe?
Click to expand...
Click to collapse
If it's just signed with the test-keys it will not install like a normal app. You would have to resign it with your own key.
@navdra
Added post regarding your work on new oxygen forum:
http://forum.oxygen.im/viewtopic.php?id=464
Hope it's ok with you?!
Hvala buraz!! Thank you
vr5411 said:
@navdra
Added post regarding your work on new oxygen forum:
http://forum.oxygen.im/viewtopic.php?id=464
Hope it's ok with you?!
Click to expand...
Click to collapse
It's fine. Just posted there too
Sent from my HTC Desire
Hi,
Did you need to change anything else except adding dictionary in raw-hr folder? I'm trying to add croatian dict to ICS keyboard but it looks like I cannot get system to recognise that dictionary is available.
Maybe some xml files should be updated?
dcos said:
Hi,
Did you need to change anything else except adding dictionary in raw-hr folder? I'm trying to add croatian dict to ICS keyboard but it looks like I cannot get system to recognise that dictionary is available.
Maybe some xml files should be updated?
Click to expand...
Click to collapse
Not sure why it does not work. Try to compile it from source. If you succeeded, share with the rest of us what you did to make it work.
Sent from my Galaxy S II
Has anyone managed to find a solution for this? I'm also looking to add a portuguese dictionary to the keyboard, though after adding the dictionary to latinime.apk it wasn't recognized.
navdra said:
Copy kbd_qwerty.xml and kbd_qwerty_black.xml to appropriate xml-xx subfolder and edit it in unicode. You should figure it out. It's pretty easy.
Click to expand...
Click to collapse
Hi, I'm trying to make montenegrin input language, it is similar to croatioan just two letters more Ś, ś, Ź, ź.
Opening with unicode notepad++ can't edit kbd_qwerty.xml and kbd_qwerty_black.xml
cm7.2
Related
Attention! The function number below may differ. Better check it by decompiling the whole file before decompiling only the single function.
Part 1 - How to remove 01:02 flip:
I write this manual because I find there are people using wrong way to get rid of this nasty "feature", which will cause clock stuck or Manila starts with 0:00AM. Here I provide a proper way to remove this "feature":
1. Download LuaTool(Thanks Co0kieMonster), and make sure you know how to use Command Line.
2. Grab 5fa4d4b7_manila from Manila Home to the same folder as LuaTool.
3. Open Command Line, input "LuaTool /decompile -f 28 5fa4d4b7_manila"(without the quotes) and enter.
4. Open 5fa4d4b7_manila.lua that just generated by LuaTool, you will find something like this:
Code:
Below comes from Manila_Home_2_5_20111612_0, other versions may differ:
local l_28_0 = _application.Store:GetIntValue(Lifetime_Application, "ShowCacheHomePage")
if l_28_0 == 1 then
if _TickControlForClock:CheckBoundary() then
ClockHelper:DoFlip()
else
ClockHelper:SetTimeInstantly()
end
else
local l_28_1 = _application.Store:GetIntValue(Lifetime_Application, "AnimationForHomeKey")
if l_28_1 == 1 then
if _TickControlForClock:CheckBoundary() then
ClockHelper:DoFlip()
else
ClockHelper:SetTimeInstantly()
end
end
end
Simply replace all those "DoFlip" with "SetTimeInstantly", or you can reconstruct the code structure like below:
Code:
local l_28_0 = _application.Store:GetIntValue(Lifetime_Application, "ShowCacheHomePage")
if l_28_0 == 1 then
ClockHelper:SetTimeInstantly()
else
local l_28_1 = _application.Store:GetIntValue(Lifetime_Application, "AnimationForHomeKey")
if l_28_1 == 1 then
ClockHelper:SetTimeInstantly()
end
end
This can reduce internal operations in Manila.
5. After editing the code, save the file and in the Command Line, input "LuaTool /compile -s -r 28 5fa4d4b7_manila 5fa4d4b7_manila.lua" and enter.
6. Overwrite the original 5fa4d4b7_manila with the edited one.
Part 2 - How to make a CDMA SMS fix for Manila 2.5:
This fix can fix the SIM error when you send a SMS from a CDMA2000 phone in Manila 2.5 Classic Messaging Page. To enable Classic Messaging Page, import these registry keys:
Code:
[HKEY_CURRENT_USER\Software\HTC\Manila]
"Manila://PeopleDetail\\peopleMessageClassic.page.hidden"=dword:0
"Manila://PeopleDetail_SIM\\peopleMessageClassic.page.hidden"=dword:0
"Manila://PeopleDetail\\peopleMessage.page.hidden"=dword:2
"Manila://PeopleDetail_SIM\\peopleMessage.page.hidden"=dword:2
Then let's start making this fix:
1. Download LuaTool(Thanks Co0kieMonster), and make sure you know how to use Command Line.
2. Grab 57a92846_manila from Manila People to the same folder as LuaTool.
3. Open Command Line, input "LuaTool /decompile -f 46 57a92846_manila"(without the quotes) and enter.
4. Open 57a92846_manila.lua that just generated by LuaTool, search for "SIM", and you will find something like this:
Code:
if not l_46_2.bIsSIMPresent then
trace("[peopleMessage.lua] : SIM is not present")
ShowDialog(Locale:GetString("IDS_NOSIMCARD"), Locale:GetString("IDS_NOSIMCARD_DESP"), "OK")
return
end
and this:
Code:
if not l_46_2.bIsSIMReady then
trace("[peopleMessage.lua] : SIM is not ready")
l_46_2:OpenPINCodeDialog()
return
end
Simply delete these two part of code.
5. After editing the code, save the file and in the Command Line, input "LuaTool /compile -s -r 46 57a92846_manila 57a92846_manila.lua" and enter.
6. Overwrite the original 57a92846_manila with the edited one.
Nice post.
Thanks for the info... Does by any change do you know or have you found a fix for the rhodium, that by excess of text looks like the rhodium wants to kill itself lol. or I would say another SMS fix
lion75y said:
Thanks for the info... Does by any change do you know or have you found a fix for the rhodium, that by excess of text looks like the rhodium wants to kill itself lol. or I would say another SMS fix
Click to expand...
Click to collapse
I don't use Rhodium, so I don't know, sorry.
For manila Home 2_5_20161714, the clock flip full decompile then recompile did not work for me. It decompiles at 97%, I make the edits, then recompile. When I do a binary compare of original vs. new, the new has a noticeable amount truncated at the very bottom. If I decompile the edited .lua, the bottom section (l_28) is missing.
When I decompiled only function 28, edited, then recompiled, it worked.
luatool /d -f 28 5fa4d4b7_manila
willysp said:
For manila Home 2_5_20161714, the clock flip full decompile then recompile did not work for me. It decompiles at 97%, I make the edits, then recompile. When I do a binary compare of original vs. new, the new has a noticeable amount truncated at the very bottom. If I decompile the edited .lua, the bottom section (l_28) is missing.
When I decompiled only function 28, edited, then recompiled, it worked.
luatool /d -f 28 5fa4d4b7_manila
Click to expand...
Click to collapse
If you re-read my thread, you will find I use replace function when compile instead of compiling the whole script.
cnzqy1 said:
If you re-read my thread, you will find I use replace function when compile instead of compiling the whole script.
Click to expand...
Click to collapse
With all due respect, please re-read my reply. You and and I compiled the same way. By function replacement.
me: luatool /c -s -r 28 5fa4d4b7_manila 5fa4d4b7_manila.lua
you: LuaTool /compile -s -r n 5fa4d4b7_manila 5fa4d4b7_manila.lua [where you said to substitute 28 for n]
I had to decompile just the single function I wanted instead of the whole file.
me: luatool /d -f 28 5fa4d4b7_manila
you: LuaTool /decompile 57a92846_manila
Decompiling, not compiling, is where your experience and mine differed. Perhaps (likely?) due to a different script structure in 2011 versus 2016.
Also, you said "You may not get 100% sucess rate [decompiling] but that's okay.". I don't think I agree with that from my experience at 97%. If it fails to 100% decompile something that I want to edit, then it stands to reason that "garbage in - garbage out". That's why, when the whole decompile failed at 97%, I decompiled just function 28 - and was happy it was 100%.
Anyway, I'm sorry if you perceived my reply to be critical - it was not.
And, I DID forget to say thank you in my original reply - I did not know about this tool. It seems to be a bit buggy as I read the tool author's post - especially for more complex logic expressions.
lion75y said:
Thanks for the info... Does by any change do you know or have you found a fix for the rhodium, that by excess of text looks like the rhodium wants to kill itself lol. or I would say another SMS fix
Click to expand...
Click to collapse
Sorry? Say again?
willysp said:
With all due respect, please re-read my reply. You and and I compiled the same way. By function replacement.
me: luatool /c -s -r 28 5fa4d4b7_manila 5fa4d4b7_manila.lua
you: LuaTool /compile -s -r n 5fa4d4b7_manila 5fa4d4b7_manila.lua [where you said to substitute 28 for n]
I had to decompile just the single function I wanted instead of the whole file.
me: luatool /d -f 28 5fa4d4b7_manila
you: LuaTool /decompile 57a92846_manila
Decompiling, not compiling, is where your experience and mine differed. Perhaps (likely?) due to a different script structure in 2011 versus 2016.
Also, you said "You may not get 100% sucess rate [decompiling] but that's okay.". I don't think I agree with that from my experience at 97%. If it fails to 100% decompile something that I want to edit, then it stands to reason that "garbage in - garbage out". That's why, when the whole decompile failed at 97%, I decompiled just function 28 - and was happy it was 100%.
Anyway, I'm sorry if you perceived my reply to be critical - it was not.
And, I DID forget to say thank you in my original reply - I did not know about this tool. It seems to be a bit buggy as I read the tool author's post - especially for more complex logic expressions.
Click to expand...
Click to collapse
Oh, I'm so sorry... I did read your post carefully and I didn't think that will make any difference, now I confirmed that quite a part is missing. It's my fault, I didn't fully understand how "-r" switch will work until now. Will modify my post, thanks!
cnzqy1 said:
Oh, I'm so sorry... I did read your post carefully and I didn't think that will make any difference, now I confirmed that quite a part is missing. It's my fault, I didn't fully understand how "-r" switch will work until now. Will modify my post, thanks!
Click to expand...
Click to collapse
Cool - glad I could add some value with my post! Thanks again for your post about the tool!
hey dude,why don't you tell me there have a thread you post....
yeah,it fix my question.thx a lot.see you in dft
I'm baaaack
Andrizoid's Linux Deodex Kitchen V4
This has been an ongoing project for a while now.
Since all the other deodexers are windows .bat scripts, i decided to make one for those of us on Ubuntu/Mac/etc
Extract to your desktop and check the README file for full instructions and more information.
Changelog
V4
Fixed some of the code, added the optional make-rom.sh which adds the freshly de-odexed files to the original rom and signs it making it ready to flash.
V3
Everything is fully automated, and will deodex the whole rom rather than one file at a time. Smali and Baksmali version updated to 1.2.3
V2
Added setup.sh to make things easier.
V1
Original script.
Love me or hate me, its a great little setup. It can be used with any rom on any device.
Interesting
Sounds interesting. I'll have to play with it this weekend.
I hope the drama is settled down now... I get enough when my wife watches "real housewives"
theres a few issues, it only de-odexes apk WELL for now. for the framework files it gets kind tricky. ill work on it a bit when i get some time.
I've been looking over your source code, I notice few lines could use simple shortcuts, for example
Code:
/home/ken/deodex-kitchen
you can change that to
Code:
~/deodex-kitchen
~ will tell shell to use current user's home directory, just make it more universal for anyone to use. Just my 2 cents.
it even work with cd, cp, mv, mkdir commands, ~ is very handy, and save you from having to type in full path.
firestrife23 said:
I've been looking over your source code, I notice few lines could use simple shortcuts, for example
Code:
/home/ken/deodex-kitchen
you can change that to
Code:
~/deodex-kitchen
~ will tell shell to use current user's home directory, just make it more universal for anyone to use. Just my 2 cents.
it even work with cd, cp, mv, mkdir commands, ~ is very handy, and save you from having to type in full path.
Click to expand...
Click to collapse
ya, a lot of the code could be cleaned up but thats the very basic version. i put it together to help build my rom, i got it working enough to do that and kinda forgot about it. i need to clean it up and put out another verison
too many projects at once haha.
found few bugs with your make-rom.sh script, on last couples of lines starting with rm will fail, because you forgot to add cd to rom-output and your script also left framework-res.apk at root of rom-output folder which should be moved to /system/framework
in your readme file, you forgot to add a step to run setup.sh script before de-odexing apk/jar files.
firestrife23 said:
found few bugs with your make-rom.sh script, on last couples of lines starting with rm will fail, because you forgot to add cd to rom-output and your script also left framework-res.apk at root of rom-output folder which should be moved to /system/framework
in your readme file, you forgot to add a step to run setup.sh script before de-odexing apk/jar files.
Click to expand...
Click to collapse
ya when i used it i made some heavy modifications to it before i got a rom to boot. i need to update this thing but ive got a few other projects im the making.
not enough people seemed interested in this to make it my priority
Andrizoid said:
ya when i used it i made some heavy modifications to it before i got a rom to boot. i need to update this thing but ive got a few other projects im the making.
not enough people seemed interested in this to make it my priority
Click to expand...
Click to collapse
I use Ubuntu, and your script fit the bill and spare me from having to reboot into windoze to use their crappy batch files. Of course your hands is all tied up with other projects, however I'll be watching this tread once you get around to updating this. Just keep bring out the great stuff!
I like people like you that make contribute back to community such as this valuable tools, unlike other developers which pretty much rather keep it to themselves (I won't list their names here, and not trying to start a flame-war) as the rest of first time ROM cooker have to figure it out the hard way.
I've just been pointed to this thread while looking for a way to deodex
the link works still, but the file has been deleted by Rapidshare, "due to inactivity"
Any chance of it being uploaded again please?
lew247 said:
I've just been pointed to this thread while looking for a way to deodex
the link works still, but the file has been deleted by Rapidshare, "due to inactivity"
Any chance of it being uploaded again please?
Click to expand...
Click to collapse
why not just use dsixda's kitchen?
http://forum.xda-developers.com/showthread.php?t=633246
then you'll also have just about everything you need (not just a deodex-er)
plus, don't think you'll get any "support" on this anymore... whereas, with dsixda's kitchen, you'll have LOTS of support for quite a while
firestrife23 said:
I've been looking over your source code, I notice few lines could use simple shortcuts, for example
Code:
/home/ken/deodex-kitchen
you can change that to
Code:
~/deodex-kitchen
~ will tell shell to use current user's home directory, just make it more universal for anyone to use. Just my 2 cents.
it even work with cd, cp, mv, mkdir commands, ~ is very handy, and save you from having to type in full path.
Click to expand...
Click to collapse
Use $HOME instead of ~. ~ doesn't always refer to the home directory.
I can help you with the need to rename $path in the script before it will work are you interested?
Upload to mediafire please.
Trent said:
Upload to mediafire please.
Click to expand...
Click to collapse
Double that. Please do this, since Multiupload has been closed.
Using a soft keyboard different than the Asus one, when the dock is connected an annoying message pop up telling us that if we don't change the soft keyboard to the asus one, the dock keyboard could not function well.
This is mostly important for non US users, as when the soft keyboard isn't the Asus one, the layout used for the dock is the standard US one.
Root needed
Using Autostarts we can disable the popup when the dock is connected:
Download autostarts from the market, open the app, let it load all the the way, then click on Asus Keyboard under "Docking changed" and disable it
or in terminal
adb shell
su
pm disable com.nuance.xt9.input/.DockEventReceiver
For permanently change the standard layout of the dock keyboard:
Locate your national keychars in /system/usr/xt9/keychars
mine is qwerty-it_IT.kcm
The first 2 character after the - is the language of the keyboard, in my case Italian, the 2 characher after the _ is the country of the keyboard, Italy in my case.
copy this file in /system/usr/keychars
rename the standard one asusec.kcm in asusec.kcm.old for backup purpose.
then rename the one you copied in asusec.kcm
Locate your national layout in /system/usr/xt9/keylayout
mine is qwerty-it_IT.kl
copy this file in /system/usr/keylayout
rename the standard one asusec.kl in asusec.kl.old for backup purpose.
then rename the one you copied in asusec.kl
reboot and you are all done
P.S.
you can use root explorer to copy and rename those files, or you can do it with adb.
If you don't know how to use those, maybe is better to learn before messing around in the system files.
P.P.S.
If anyone know a free app that can replace autostarts, let me know so I can update the guide.
Great guide, thx a lot! If we mess with keychars and keylayout, we could also remap specific keys, right?
For example, I don't really need the three brightness buttons on the dock, i barely change brightness, and if i have to sometimes, i don't mind browsing to settings-->display.
Can we remap these to different keys OR specific apps, OR even better: to key combinations? Would be cool to have cut, copy and paste on the brightness buttons. What do you think?
Plus, one more off topic thing, I think you could know: Is there a file which could change mouse button mapping and perhaps enable additional mouse buttons (thumb mouse buttons for example)? I though of setting the "menu" key to the right mouse button instead of "back" for example.
Regards
qwer23
qwer23 said:
Great guide, thx a lot! If we mess with keychars and keylayout, we could also remap specific keys, right?
For example, I don't really need the three brightness buttons on the dock, i barely change brightness, and if i have to sometimes, i don't mind browsing to settings-->display.
Can we remap these to different keys OR specific apps, OR even better: to key combinations? Would be cool to have cut, copy and paste on the brightness buttons. What do you think?
Plus, one more off topic thing, I think you could know: Is there a file which could change mouse button mapping and perhaps enable additional mouse buttons (thumb mouse buttons for example)? I though of setting the "menu" key to the right mouse button instead of "back" for example.
Regards
qwer23
Click to expand...
Click to collapse
You can remap any key you want, I've seen a guide somewhere in the forums.
For the mouse I don't think you can do anything without some serious hacking, the dock trackpad follow the standard rules for mouses in android: left click = click, right click = back, whell button click = menu.
I also hate how they have implemented the 2 finger scrolling, when you scroll actually the trackpad long click where the cursor is, and invert the axis of the trackpad, so when you scroll down you are in fact long pressing and scrolling the cursor up, and so on.
It messes so many apps, as this simulated long click can be registered by the app
Updated on the first post how to disable permanently the asus keyboad popup when docking
qwer23 said:
Would be cool to have cut, copy and paste on the brightness buttons. What do you think?
Click to expand...
Click to collapse
You can do it with ctrl+x ctrl+c and ctrl+v
I can't see the Thank You button, but I thought I'd just say thanks!
This is an excellent guide and worked perfectly for my UK keyboard!
Much appreciated
I found an alternative to Autostarts, fire this commands in a terminal:
Code:
adb shell
su
pm disable com.nuance.xt9.input/.DockEventReceiver
These are the "cut&paste" commands for changing the layout:
Code:
adb remount
adb shell
mv /system/usr/keychars/asusec.kcm /system/usr/keychars/asusec.kcm.old
mv /system/usr/keylayout/asusec.kl /system/usr/keylayout/asusec.kl.old
cp /system/usr/xt9/keychars/qwerty-it_IT.kcm /system/usr/keychars/asusec.kcm
cp /system/usr/xt9/keylayout/qwerty-it_IT.kl /system/usr/keylayout/asusec.kl
I found my own solution for disabling the dock connected popup.
I modified the XT9IME.apk so that the popup is not displayed and posted it here before stumbling upon this thread.
Would it be possible to make a update zip, to do this in clockwork, ive just insalled a new rom, now i need to redo the fix.
jambo89liam said:
Would it be possible to make a update zip, to do this in clockwork, ive just insalled a new rom, now i need to redo the fix.
Click to expand...
Click to collapse
I could script this and have update.zips for it.
Perhaps someone else could create an app that does it via a menu system to select your country.
Fixed?
Over on http://forum.xda-developers.com/archive/index.php/t-1152317.html the last post says:
"The warning message has now been fixed, after the latest update 8.4.11. It now gives you the option of 'Do not show this again."
So maybe it's now fixed? (Don't have my Transformer at work to check for myself.)
You can use this as an executable (755) script file if you want to use another keyboard with another language
Code:
#!/system/bin/bash
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mv /system/usr/keychars/asusec.kcm /system/usr/keychars/asusec.kcm.orig
cp /system/usr/xt9/keychars/qwerty-de_DE.kcm /system/usr/keychars/asusec.kcm
mv /system/usr/keylayout/asusec.kl /system/usr/keylayout/asusec.kl.orig
cp /system/usr/xt9/keylayout/qwerty-de_DE.kl /system/usr/keylayout/asusec.kl
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
Just replace the "de_DE" parts with your language code.
Just wanted to bump this b/c of the ICS release.
While those ADB commands give me a "segmentation fault"...
Azhad said:
adb shell
su
pm disable com.nuance.xt9.input/.DockEventReceiver
Click to expand...
Click to collapse
the following procedure still works like a charm on ICS!
Azhad said:
Locate your national keychars in /system/usr/xt9/keychars
mine is qwerty-it_IT.kcm
The first 2 character after the - is the language of the keyboard, in my case Italian, the 2 characher after the _ is the country of the keyboard, Italy in my case.
copy this file in /system/usr/keychars
rename the standard one asusec.kcm in asusec.kcm.old for backup purpose.
then rename the one you copied in asusec.kcm
Locate your national layout in /system/usr/xt9/keylayout
mine is qwerty-it_IT.kl
copy this file in /system/usr/keylayout
rename the standard one asusec.kl in asusec.kl.old for backup purpose.
then rename the one you copied in asusec.kl
reboot and you are all done
Click to expand...
Click to collapse
Thanks again for working this out!
can anyone please make the dock keyboard work with latvian? i hate anysoftkeyboard, it stops working and its craching all the time.
i want to use dock like on a normal computer.
Does latvia have its own keyboard layout or do you use one that another country uses as well? Which county abbreviation would it be (like en for English and de for German)?
Doesn't work ?!
modmatt said:
the following procedure still works like a charm on ICS!
Click to expand...
Click to collapse
Doens' work for me, in fact, if I'm copying the de_DE files from Revolver 4 over to my EOS AOSP rom build and put the keychars (asusec.kcm) and the keylayout (asusec.kl) in their respective folders and reboot afterwards, nothing happens to the dock input. Still stays the same old QWERTY like before.
But I can see in file manager that the copying was successfull. New asusec.kl and asusec.kcm are there.
Someone help me ?
You already mentioned the reason yourself, I think. As you are using an AOSP ROM it means that you're using a plain vanilla android basis, which - correct me if I'm wrong - obviously doesn't know anything about asus*.* keyboard files. Just copying some files somewhere is not enough to let the system know what to do with it.
You probably have to deal with some scripts, that are run at every start up, that give proper instructions for the operating system. Unfortunately this is way beyond my knowledge.
modmatt said:
You already mentioned the reason yourself, I think. As you are using an AOSP ROM it means that you're using a plain vanilla android basis, which - correct me if I'm wrong - obviously doesn't know anything about asus*.* keyboard files. Just copying some files somewhere is not enough to let the system know what to do with it.
You probably have to deal with some scripts, that are run at every start up, that give proper instructions for the operating system. Unfortunately this is way beyond my knowledge.
Click to expand...
Click to collapse
What are you going on about? This works just fine on ICS with Revolver, just changed my dock back to azerty. rayman33 just did something wrong.
Please read that rayman33 uses an AOSP ROM that has nothin to do with Asus. You are using Revolver, which is bases on Asus' original ROM - that is why it works for you but not for him.
i just found this post as i'm having the very same issues using my transformer tf300 - currently running official stable CM10
the bad thing about it is only, in my CM10 i don't even have a /system/usr/xt9/ directory and when looking into the backup of my stock ASUS rom, I do have /system/usr/xt9/ and even subdirs keychars and keylayout, but without any content.
it would be lovely if someone would be so kind to suck out the de_CH files for me and could post them here!
[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
a link to the app in the market would be usefull.
Interesting. Was just wondering about coding on my tablet.
Pretty freakin sweet
Thanks for putting this out!
Awesome
The full keyboard alone makes it worth downloading, but the IDE as well - wow!
this is best bro.
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
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
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.
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
Code:
cd ~
Create folder
Code:
mkdir .ssh
Give it some secure permissions
Code:
chmod 700 .ssh
Get in there
Code:
cd .ssh
Now create the keys
Code:
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
Code:
cd ~
You need to know the UID of your app, which is different per phone - use 'id'
Code:
id
That will tell you your user ID / Group ID. Let's say its 10058.
Now to start DropBear
Code:
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..
I'll fix it permanently in a future release, but for now it can be fixed with these 2 commands.
cd into your home dir - Check this is correct on your device
Code:
cd /data/data/com.spartacusrex.spartacuside/files
And start bash with an init file Terminal IDE auto-magically creates..
Code:
./system/bin/bash --init-file ./.init
Everything should now be setup as usual.
Good luck..
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.
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
Now has 3 non-exclusive lock types available in the options :
- CPU Lock
- SCREEN Lock
- WIFI Lock
Set them as you wish...
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!
Very cool stuff
Thanks for creating this.
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?
Sent from my GT-I9100 using XDA App
Do you think its possible to also support compiling C sources directly in your phone
I've been searching for this ever since I got an android.
THANK YOU.
Says that it's incompatible with my OG Droid. Any idea why?
shpen said:
Says that it's incompatible with my OG Droid. Any idea why?
Click to expand...
Click to collapse
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
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.
Sent from my GT-I9100 using XDA App
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..
Hello all. I have written a guide to setting up & using Android ADB, & building Android, with Fedora KDE. Almost every guide that I've ever seen for setting up ADB, & a build environment for building Android, is always written for Ubuntu, & ONLY Ubuntu. But I choose to work with Fedora KDE. Why Fedora with KDE??? Because I hate Ubuntu. !!!HATE!!! I also can't stand gnome 3.X. I'm sure I'm not the only one who feels this way, so that's why I'm writing this guide. I've tried different linux distros, & I've found Fedora to be the best of all. It is my favorite now. They also seem to be one of the few distros that stays on top of the linux kernel updates. As of 03/20/13, they're already on kernel 3.8.3!!! Other distros stay way behind. Also, with KDE, you can keep the "windoze" traditional desktop look & feel, especially when you use the "folder view" activity. It's great!!! Well, let's get started.
!!!WARNING!!! Before anything else, I will mention this right now. The Dolphin file manager can destroy your Android build with hidden ".directory" files. Please keep this in mind. I will explain this at the end of the guide.
INSTALL JDK6
-I guess I'll mention this 1st, since this can actually be one of the most painful & confusing parts of all. You'll need to install the java jdk6. As far as I know, Android stuff won't work with the newer jdk7. You can find it on oracle's page here:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
-Scroll down & you'll see it. Get the "rpm.bin" version. If your working with 64bit, it should look like this:
jdk-6u43-linux-x64-rpm.bin
-Someone by the name of JR already made a very good guide on how to do this. It is what I followed, & you should too. You can find it here:
http://www.if-not-true-then-false.c...java-jdk-jre-6-on-fedora-centos-red-hat-rhel/
NOTE: When following this guide, be sure to go through only steps 3a & 4a when you reach them. Steps 3b & 4b are for the "non-jdk" jre.
NOTE: The "alternatives" listed in step 4 seems to be some kind of program that creates symlinks for whatever you want, & labels them. When you install, or create the symlinks, you can then use "alternatives" to switch back & forth between the different programs that you make the symlinks for. For example, you can make links for java in jdk6 & jdk7, & then switch to either one or the other, as you please. That way, you can have them both installed, while using only one at a time. You can type "alternatives --config java" to switch, or whatever name you used for the link. For help, type "alternatives --help".
INSTALL SDK
-You can follow these:
http://developer.android.com/sdk/index.html
http://fedoraproject.org/wiki/HOWTO_Setup_Android_Development
SETTING UP ADB
-Download the sdk & unpack it somewhere in your home directory. For example, I like to put mine in "~/Android-Development/sdk" (the ~ symbol is short for your Home folder).
-cd to your sdk tools location. For example, from my Home folder, I would type this:
Code:
$ cd Android-Development/sdk/tools
-NOTE: DON'T TYPE THE DOLLAR SIGN!!! I put it there because that's what you see in the terminal. It's only there for reference.
-NOTE: At any time, you can type "ls", or "ls -l" to see everything in the folder you're currently in.
-Now, execute the android program.
Code:
$ ./android
-Install Android SDK Tools & Platform-tools.
-Install 32bit packages. Since Android is a 32bit OS, you must install the 32bit packages regardless if whether your computer is 64bit or not.
Code:
$ sudo yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686
NOTE: In order to install packages with yum, you must do it as su. You can either type sudo before the command, or you can just type "su" & enter your password to become superuser. If you're new to the command line, it's probably better to use "sudo" instead, that way you won't stay logged in as superuser & potentially mess things up.
-Now, it's time to install the udev rules. Basically, they are the rules that govern whatever device you plug in with USB. You can find all the info on this page:
http://developer.android.com/tools/device.html
-Create an empty file named 51-android.rules to write in. We will create it in /etc/udev/rules.d/
Code:
$ sudo touch /etc/udev/rules.d/51-android.rules
NOTE: "Touch" is a linux command that you can use to create a new, empty file. To see more info on it, type "touch --help", or "man touch" to see the manual page for it. Of course, you can always google it, & anything else as well. Google "linux commands touch".
NOTE: Since this file is in the root user's directories, you will need to enter commands as superuser, or else it won't save. Either type "sudo" before the command, or, if you're comfortable with the command line, log in as superuser by typing "su" & entering your password.
-Now, you can use any text editor to write inside that file you just created. I like to use nano from the command line, so let's use that. ("nano --help", "man nano", google "linux commands nano")
Code:
$ sudo nano /etc/udev/rules.d/51-android.rules
NOTE: In linux, you can copy & paste without even "right-clicking" & selecting copy or paste from the menu. Instead, you can just highlight some text, & go somewhere else & press the mouse middle button to paste it. Highlighting text will automatically copy it, & pressing the mouse middle button will automatically paste whatever you highlighted. No need for "right-clicking" anything. You can do this for the next step.
-Now, from the webpage listed above, just copy & paste the lines with the USB Vendor IDs that you want to use. For example, for Asus, HTC, & Samsung, write these:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
-Save & exit the file.
NOTE: In nano, you can always see important commands at the bottom of the screen. For example, to exit, you hold in the "control" button & press "x".
-Now, check the permissions of the file & make sure everyone can read it.
Code:
$ ls -l /etc/udev/rules.d/
-You should see something like this:
Code:
$ -rw-r--r--. 1 root root 639 Feb 5 14:08 51-android.rules
NOTE: The 1st line indicates whether it's a directory or not. The next 3 lines indicate Read, Write, & eXecute permissions for the user. The next 3 lines indicate Read, Write, & eXecute permissions for the group. The last 3 lines indicate Read, Write, & eXecute permissions for others. The 1st "root" means that root is the user. Root owns that file. The 2nd "root" means that the file belongs to the group root.
-If for some reason you don't see the "r" letters (meaning that it's readable) to the left of the file name, then just change the permissions. Add "read" permissions for all.
Code:
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
-Finally, if you didn't do it earlier, now's a good time to do this. Make sure the ADB folders are in your global PATH. This is so that you can use the ADB commands anywhere in the system, no matter what folder you're currently in.
-Return to your home folder.
Code:
$ cd
NOTE: In the linux command line, simply typing "cd" & pressing enter will bring you right back to your Home folder.
-There's a hidden file called ".bash_profile" in your home folder. You can see it if you LIST ALL:
Code:
$ ls -a
-Your global PATH is defined in there. Let's edit it to add the ADB folders.
Code:
$ nano .bash_profile
-You'll see that there's already one line in there with 2 entries that look like this:
Code:
PATH=$PATH:$HOME/.local/bin:$HOME/bin
You can use that as your example as to what the format should look like. The line begins with
Code:
PATH=$PATH:
Then there are 2 entries, with each entry separated by a colon. Each entry must be separated by a colon and NO space.
Code:
$HOME/.local/bin
is one entry, &
Code:
$HOME/bin
is the other entry. Now, we want to add our 2 ADB folders to the list. You can either add each path to your folder separated by a colon & no space, like the example, or you can start your own line. I always like to start my own line underneath that one. So, for example, here's what my new line looks like:
Code:
PATH=$PATH:$HOME/Android-Development/sdk/platform-tools:$HOME/Android-Development/sdk/tools
-Everyone likes to use different folder names. Remember to use the proper path of where you put your folders in.
-Save & exit the file. That's it. Now, reboot your computer, plug in your android device, & test it out. You should be able to type "adb devices" from any folder, & the computer should be able to see it now.
INITIALIZING YOUR BUILD ENVIRONMENT
-For me, this was the hardest part of the whole process, as there wasn't a lot of help on how to do this for Fedora with KDE. Whatever few guides for Fedora I found out there were usually missing something here & there. My goal is to change that & help everyone. I've gone through this multiple times now, including multiple reinstalls of Fedora 18 from scratch.
-You'll need to install lots of drivers & libraries.
NOTE: Use Apper, the software management program, to look up drivers & libs. Apper will show you many different files that have the name that you typed in, whereas yum won't. Personally, I like to look things up with Apper so I can get lots of hits, & then actually download them by typing them in manually with yum. Yum shows you what it's actually doing behind the scenes while it's downloading things, whereas Apper doesn't. If yum gets stuck & hangs, you can actually see what's going on, whereas Apper won't show you anything & will just leave you wondering what's going on.
NOTE: I have found it to be a good idea to always look for the development (-devel) version of anything that you have to install. Not everything has a development version, but some do. For example, if you look up "flex" in Apper, you'll see that there's also a "flex-devel". Be sure to download them both.
-Here is what I went by:
http://fedoraproject.org/wiki/HOWTO_Setup_Android_Development
http://source.android.com/source/initializing.html
http://wiki.cyanogenmod.org/w/Main_Page
http://wiki.cyanogenmod.org/w/Build_for_maguro
-I used the lists on the fedora page, & I also used the lists of required packages for Ubuntu 10.04 & 12.04. I chose to try a build for Samsung Galaxy Nexus, since that's what I have. While going through the Ubuntu lists, you must keep in mind that some of these packages don't exist for Fedora, & many others do exist with slightly different names. It is best to spend some time & look them up 1 at a time using Apper. For example, typing "libxml2-utils" into Apper shows nothing, but typing in "libxml2" shows results. Finally, whatever you still can't find, you must google search it. For example, google search = "fedora libxml2-utils" You'll get clues & answers from what other people have already found about them. I mainly used the Ubuntu lists of necessary libs to download. So, without further ado, here's everything that I did that works for me...
Code:
$ sudo yum install git gnupg gnupg2 flex flex-devel bison bison-devel gperf gcc gcc-c++ make automake kernel-devel zip curl zlib zlib-devel glibc glibc-devel ncurses ncurses-devel xulrunner xulrunner-devel libX11 libX11-common libX11-devel xorg-x11-proto-devel readline readline-devel mesa-libGL mesa-libGL-devel mesa-libGLU
NOTE: You won't need mingw32 & tofrodos.
Code:
$ sudo yum install python-markdown libxml2 libxml2-devel libxslt libxslt-devel perl perl-devel perl-Switch SDL SDL-devel wxGTK wxGTK-devel squashfs-tools pngcrush schedtool
NOTE: If you installed Fedora with the options for development programs, than some of these will be installed already. This list may be a slight bit of overkill, but I purposely wrote down everything anyway, so that way nobody misses anything. I went through hell when figuring this out, so it's better to be safe than sorry.
NOTE: If you've been doing everything logged in as superuser, be sure to exit su when you're not installing things anymore. If you create directories as root user, you won't have permissions to access them under your own name, unless you manually change the permissions. Other permissions issues can arise too.
-After all this, it's just a matter of installing the directories & repo, & following the remaining directions on the CyanogenMod Wiki build guide page. I wanted to sync up with the Jellybean branch, so as an example, I set my directories up like this:
Code:
mkdir Android-Development/Builds/bin
mkdir Android-Development/Builds/CM10.1_Jellybean
-Whenever I download the repo command, I do it like this:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/Android-Development/Builds/bin/repo
-You'll need to add this to your global PATH as well, so be sure to do that, then log out & back in again, or reboot to make it active. Do that, & then continue.
-Then, I go inside the CM10.1_Jellybean folder to do the repo init. (Get ready for repo sync. That takes hours!!!)
-That's pretty much it. : ) Be sure to read through the sites & all their instructions & guides to help you understand everything.
!!!WARNING!!! Here is what I mentioned all the way at the beginning. Please don't forget the most important thing of all: those damn hidden ".directory" files. Any time you change the folder views in Dolphin File Manager, it places a hidden ".directory" file in that folder. THESE HIDDEN FILES WILL DESTROY YOUR BUILD!!! I went through hell with this, trying to figure out what was going on. I always set up the Android folders to show in "details" view mode, so that they're easier to see. Every time I tried to build, it would build for 5 or 10 minutes, & then fail, citing errors in java. I eventually realized that the ".directory" files were the cause of all the problems.
If you change the folder views, you need to get rid of those hidden ".directory" files. You'll have to do it in terminal. A good way to do it is by using the "find" command to find them all, & then pipe the output of that into the "rm" command to remove (delete) them all. ("find --help", "man find", google "linux commands find")
The "find" command can find whatever you're looking for in the current directory, & in all of its sub-directories as well. With the "rm" command, you can also use the "v" option. "V" stands for "verbose". It will show you everything that is being done, as it's being done. As an example, here's how I do it on my computer:
Code:
$ cd ~/Android-Development/Builds/CM10.1_Jellybean
$ find -name .directory -exec rm -v '{}' \;
That will find all of the ".directory" files & delete them all. It works pretty fast too. With the "v" option, it will show you what's going, while it's happening, as well. So, if you're like me & think that it's much easier to see huge lists of folders in "details" view mode, feel free to set it for the current directory & all sub-directories as well. However, DON'T FORGET TO DELETE all of the ".directory" files before you start building, or your build WILL FAIL!!!
Well, as you can see, you can customize some things to your liking. There's plenty of learning involved, so be ready to spend lots of time with everything. Good luck, & have fun!!!
Now, I'd like to add a personal note. After all this, I'm able to build Android from source with no problem now. However, I tried porting CyanogenMod & building ClockworkMod recovery for some Ainol Tab that I have. Long story short, in the end, it didn't work. I learned about having to build your own device tree, & I found myself completely lost in a sea of xml & java that I didn't understand at all. That's when I realized how much I don't know. It's also when I quickly realized the good advice of cyanogen himself...
http://forum.xda-developers.com/showthread.php?t=667298
"... Here's my advice for those looking to make their own Android ROMs.. Stop. Write an app or two first, learn how the system works from a developer standpoint. Learn some Java. ..."
His advice is dead on accurate. Now I know why he says the things he said. I have no previous experience with java, or any other programming language. In trying to do these things, I found myself completely lost in code that I didn't understand at all. How can I possibly mess around with entire ROMs when I don't even know what's going on under the hood???
Since then, I've been concentrating most of my spare time learning java. It's a bit overwhelming to say the least, but I am getting it now. Recently, I took a peek back at all the code that confused me before, & I'm actually starting to understand it all now. I'm no longer lost. Studying java (& xml) is actually working, & quite well too. I can personally confirm cyanogen's advice to be spot on, & well worth listening to.
So, in conclusion, if you're wanting to get into messing around with ROMs & stuff, but you have no programming experience, I think it would be best to take cyanogen's advice & start at the higher levels first. Learn some java (& xml), & learn to build a simple app or two for Android. You'll better learn how the system works that way. That's what I'm doing now, & it's really working for me. Doing this should help you out with ROMs, & app development too. Well, I hope this is helpful to everybody looking to get into all this stuff. Good luck, & have fun!!!
Glad I'm not the only Fedora user building android around here. I admit, I'm no good at java, but I have really only been focusing on kernel stuff for my device. Good luck to anyone using this.
XirXes said:
Glad I'm not the only Fedora user building android around here. I admit, I'm no good at java, but I have really only been focusing on kernel stuff for my device. Good luck to anyone using this.
Click to expand...
Click to collapse
I guess different people will have different experiences depending on what kind of knowledge they have. For me, I ran into trouble when I tried to port CyanogenMod to a different device on my own. I found that my knowledge was not quite up to par. Studying java is helping me in regards to both ROM development, & app development as well. It's just what I need because I also want to make games.
Very nice guide. I can tell you spent a lot of time putting this together. thank you!
I already had a mostly working Android SDK, and was successfully building kernels for my Ainol Elf2. However, I was never able to build the Elf2 ported version (by Christian Troy) of Cyanogen 10. Perhaps after starting over with my Java installs, this will work now. I have had the Android SDK installed for quite some time, but after v4.2, it would no longer update itself. Now it does.
Not that I want to use 4.2 on my Elf2. I hate they dropped Bluez and now USB Bluetooth dongles no longer work. That is a show stopper for my Elf2. However, my newly purchased Samsung GS3 might benefit nicely. I plan on starting to build a new kernel for this tonight.
BTW, I am still on Fedora 14 32bit, because I also hate Gnome 3 and the latest KDE's as well. My F14 is still kicking along just fine, with updates manually compiled by me.
Nice Job!
Thanks for sharing!! Good job!!
lexridge said:
Very nice guide. I can tell you spent a lot of time putting this together. thank you!
I already had a mostly working Android SDK, and was successfully building kernels for my Ainol Elf2. However, I was never able to build the Elf2 ported version (by Christian Troy) of Cyanogen 10. Perhaps after starting over with my Java installs, this will work now. I have had the Android SDK installed for quite some time, but after v4.2, it would no longer update itself. Now it does.
Not that I want to use 4.2 on my Elf2. I hate they dropped Bluez and now USB Bluetooth dongles no longer work. That is a show stopper for my Elf2. However, my newly purchased Samsung GS3 might benefit nicely. I plan on starting to build a new kernel for this tonight.
BTW, I am still on Fedora 14 32bit, because I also hate Gnome 3 and the latest KDE's as well. My F14 is still kicking along just fine, with updates manually compiled by me.
Nice Job!
Click to expand...
Click to collapse
Thanks!!! Yes, I did spend quite a bit of time on it. I always try to do everything as perfect as I can.
What a coincidence... It was messing around with my Ainol Novo7 Crystal tab that really pushed me into this journey of learning. I think that one & the Elfii are almost the same. That Christian Troy guy seems to be an absolute Linux master. I hope I can be as good as him someday.
I think many people should use Fedora. It may not be so easy for beginners, but the more people that help by writing helpful guides for different things, the easier it will be to transition to. It's really great. I even run it on my little Acer Aspire One A522 netbook with no problems.
Sent from my Galaxy Nexus using xda premium
PotatotreeSoft said:
Thanks for sharing!! Good job!!
Click to expand...
Click to collapse
Thank you!!! I hope it helps many people.
Sent from my Galaxy Nexus using xda premium
Thanks for "going the extra mile" (x10!) and taking the time to lay out such a well-organized procedure. Describing potential pitfalls is quite valuable as well. Sharing learning experiences helps everyone. And good luck with Java.
!!!WARNING!!! Here is what I mentioned all the way at the beginning. Please don't forget the most important thing of all: those damn hidden ".directory" files. Any time you change the folder views in Dolphin File Manager, it places a hidden ".directory" file in that folder. THESE HIDDEN FILES WILL DESTROY YOUR BUILD!!! I went through hell with this, trying to figure out what was going on. I always set up the Android folders to show in "details" view mode, so that they're easier to see. Every time I tried to build, it would build for 5 or 10 minutes, & then fail, citing errors in java. I eventually realized that the ".directory" files were the cause of all the problems.
Click to expand...
Click to collapse
You can disable this via:
Menu: Settings > Configure Dolphin > General > Behaviour and set it to common view for all folders. Found here
hi, im stuck ins this step
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/Android-Development/Builds/bin/repo
how can i make this work??
what im missing??
sorry and thanks
plmosqueda said:
hi, im stuck ins this step
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/Android-Development/Builds/bin/repo
how can i make this work??
what im missing??
sorry and thanks
Click to expand...
Click to collapse
Oh, hello. Sorry, I've been away for a very long time. It's cause I'm so busy trying to fix my screwed up life.
Were you still having trouble with this??? Does anything happen at all when you type the command??? I haven't done this in quite a long time now, but if I remember right, I think that this command looks like it doesn't do anything, but it really does. Be sure to check your folders for the repo command afterwards. Curl is a program you can use for downloading things. As long as you have it installed, it should at least tell you something when you type it in. By the way, nice Gameboy.
3ndymion218 said:
Oh, hello. Sorry, I've been away for a very long time. It's cause I'm so busy trying to fix my screwed up life.
Were you still having trouble with this??? Does anything happen at all when you type the command??? I haven't done this in quite a long time now, but if I remember right, I think that this command looks like it doesn't do anything, but it really does. Be sure to check your folders for the repo command afterwards. Curl is a program you can use for downloading things. As long as you have it installed, it should at least tell you something when you type it in. By the way, nice Gameboy.
Click to expand...
Click to collapse
Done XD, i was having ṕroblems with the global path. Well in now in Arch. All works fine, im trying to make a custon recovery for alcatel Ot 983
A bit late to the party but just found this great guide , too bad I didnt find it one year ago It took me almost a full day to figure all this out using Eclipse Kepler to dl the sdk and Nano to write new rules (had to find the rules...) ...
But all in all once you have done it one time seems to me the process is more straitfoward than with a comparable ubuntu system
this well written guide deserves more publicity!
Thanks!