5,599,077 Members 32,342 Now Online
XDA Developers Android and Mobile Development Forum

[MOD] HTC_IME (8th June) v27: Small fix

Tip us?
 
jonasl
Old
(Last edited by jonasl; 30th August 2010 at 07:09 AM.) Reason: Updated source link
#1  
Senior Member - OP
Thanks Meter 168
Posts: 379
Join Date: Nov 2009
Location: San Francisco, CA
Default [MOD] HTC_IME (8th June) v27: Small fix

I'm now taking a break from the work on this mod due to serious lack of time. I've spent a huge amount of time on this mod already and also shared all my code and methods. I hope the community has benefited from this. You are all free to do whatever you want with my code if you want to make further improvements. I hope I can find some time to continue this little project later this summer. Thanks for all the encouraging words, feature suggestions and bug reports. Couldn't have done this without you all


Credits:
  • The old low res hack is based on the version posted by Cyanogen.
  • The new low res and high res hack is based on the version posted by modaco.
  • JesusFreke for smali/baksmali.
Couldn't do this without them.

Features:
(Compacted this list to save space, the point is that there are many features not to make this list readable )

Customizable language settings, Smileys hacked into the hide key (see screen shots), Swap Smiley/12# button, Custom smileys, Custom word candidate bar that raises the keyboards so dictionary won't cover the app you type in, Position of word candidate list is saved if you long press and move it, Left align word candidate list, Prediction in fields with own suggestions (search bar etc.), Prediction in fields that sets the filter flag, Prediction in URL fields, Disable automatic capitalization, Play sounds in silent mode, Set sound level, Custom sounds, Automatic space insertion, Enable prediction with cursor in or adjacent to existing words (QWERTY only), Enable a space bar key in URL keyboard, Support for German QWERTZ hard KB layout, Show voice input button for all keyboards with a settings button, Disable key preview popup, Use Google development server for voice (supports German but isn't online 24/7), MANY HTC bugs fixed, the changelog for a few of them, Droid SE X10 landscape support, User dictionary import/export, User dictionary accepts any character, not just HTC approved ones, Custom vibration length, Character replacement (can remove diacritic chars), Pipe key in qwerty mode, Move cursor with volume keys (for Sony Ericsson Xperia X10), Easier access to language specific chars in qwerty popups, Configurable gesture (swipe) actions, Gesture actions: Delete word, delete sentence, shift, hide kb, cursor after word, voice input, switch language, switch keyboard, Use phone keypad / compact qwerty symbol kb for QWERTY, Toggle accept dict. suggestion by space / period / comma, Fast language and keyboard switching by gestures, Version tracking by aTrackDog, Custom domains for .com key

And not least:
My source code is now available for your own modding pleasure

All hacks are configurable in the settings dialog.

Changelog for latest versions
Code:
/*
 * 27
 * Fixed: T9 is now disabled when adding words manually (sorry, missed that bug report on v26b1)
*/

/*
 * 26
 * Separate version for Froyo (2.2) due to changed voice input API:s
 * Fixed: User dictionary should now be saved correctly on Sense ROMs (if installed correctly!)
 * Fixed: Slightly better SMS detection
 * Fixed: Custom popup domains will work without enabling custom popup time (caused by typo)
 * Fixed: Smiley insertion right after period removed first smiley char
 * Fixed: Settings not remembered for some locales
 * Fixed: Tweaked space insertion around parentheses some
 * Fixed: Fixed "Predict in Browser" option on Froyo (workaround for Android issue #8563)
 * Fixed: Space deleted after period insertion and use of chars from symbol KB (HTC bug)
 * Fixed: No auto add words didn't always work
 * Fixed: Smiley button didn't work on symbol KB
 * New: Calibration is considered for all layouts
 * New: Modify button height/width on all layouts 
 * New: €  added to f popup 
 * New: T9 toggle settings now remembered
 * New: Export/import settings to/from SD card
 * New: Pipe added to alt. symbol keyboard (page 4)
 * Gesture: Cursor before word
 */

/*
 * 25
 * New: Move lang. specific popup chars closer to pressed key (help me support more langs!)
 * Option: Replace chars only for SMS
 * Option: Custom domains for .com key
 * Option: Insert period on double space
 * Option: Toggle accept dict. suggestion by 12# key
 * Option: Configurable custom sounds
 * Option: Change language with volume keys
 * Option: Adjust portrait QWERTY key width
 * Changed: Delete last sentence breaks on comma again.
 * Fixed: Space insertion disabled for URI fields (causing problems)
 * Fixed: Space insertion tweaked for French
 * Fixed: Removed Romanian since not working (blame HTC)
 * Fixed: Don't insert space if prediction is disabled in browser
 * Fixed: Predict in URL working again.
 * Fixed: Sound for HW KB working again
 * Gesture: Toggle QWERTY prediction on/off
 */
Download
v27
High resolution version
High resolution version (Froyo/2.2)

Low resolution version for Android 1.6 and up
Low resolution version for Android 1.5 (no voice input)

Instructions:
  • Download and unzip (not flashable update.zip!)
  • Install the two apks (HTC_IME & Clicker) using your favorite method (via a file manager or adb install -r). Sense users shouldn't (and needn't) install Clicker.
  • There is no need to push anything to /system
  • Go to Menu, Settings, Language & Keyboard. Activate "HTC_IME mod"
  • To change keyboard, long press on lower left key on stock keyboard or any input field. Select input method in the menu.
  • See note below if you have earlier versions than v22 installed already!

Requirements:
  • Android
  • Compatible resolution screen
  • Compatible CPU. Sorry can't say which they are but I know some Samsung phones are not supported. This is due to the included HTC native prediction library.

Configuring my hacks
All configuration is now done in the settings dialog. No need for config files on SD card (v22 and up).
Some options modifies stuff that are set when the keyboard first loads. Thus you need to kill it for changes to take effect (or reboot).

Upgrade notes
Starting with v22 I now use my own java package name. This means that it can be installed in parallel with stock HTC_IME (no root needed on Sense).
Settings from v21 and earlier can't be read from v22 and up. You must enter them again. The user dictionary can be exported from v21 and imported into v22. Both versions can coexist during this process. This inconvenience will only happen between v21 and newer. Sorry for this, but this change will enable me do to more advanced mods in the future.
v23 has a hires Clicker. You should install it if not using Sense


Source code
Interested in how I do this? I've decided to share the sources for the mod so that the project can live on when I get tired of it. You can study it just for learning or implement your own mods. You are free to do whatever you want with if as long as you buy me a beer
Download source code

Please spend a few hours trying to set it up and figure out some stuff on your own before bombarding me with questions...

Feeling thankful?
Donations are appreciated. Donate here.

Changelog:
  • Version 25 Highres pre Froyo, High res Froyo, Lowres >= 1.6, Lowres 1.5
  • Version 24 hires lowres: Fixed: Droid/Milestone/X10 landscape kb broken due to upscaling, Alt. symbol kb. not set correctly on start input, FC on boot when using some locales, Delete last sentence tweaked
  • Version 23 hires lowres: Fixed: User dictionary broke in v22 due to changed package name. Sorry!
  • Version 22 hires lowres: New: My own package name, Fast language & keyboard switching by gestures, Settings dialog redesigned, No more .htcime on SD, all is now GUI based, Hires Clicker, Version tracking by aTrackDog. Fixed: Scale landscape KB on Droid/Milestone/X10, Add word dialog now shows kb automatically, FC on show add word dialog in landscape, Proper hires settings icon from Incredible, P and W in phone number keyboard, Workaround for back button bug in xScope browser Option: Configurable gesture actions, Show current language on start, Kill keyboard from settings, Disable voice button also for English, Use phone keypad / compact qwerty symbol kb for QWERTY, Toggle accept dict. suggestion by space, Toggle accept dict. suggestion by separators, Volume keys for dpad up/down, Gesture: Delete last sentence, Move to end of word, Cycle language, Cycle keyboard types
  • Version 21 hires lowres: Options: Move cursor with volume keys, Move Scandinavian popup chars closer to pressed key Fixed: More swipe detection tuning, Less laggy sound and vibration feedback with swiping enabled, Space insert more robust
  • Version 20 hires lowres: Options: Swipe up for shift, Swipe while composing a word (dict. showing), Swap Smiley/12# button, Insert word entered in add word dialog into edited text. Fixed: Swiping more robust, Long press on symbol key now working again, Tweaked candidate bar height calculation (Droid 2.1), Improved HTC popup timer when lag is detected (HTC bad design), Android smiley is :-\ and not :-/ , Bug in landscape autocompletion (gmail compose etc.), Autocap issues in certain cases (blame HTC :P), Better handling of (pseudo) multi touch events (easier to press space and periods etc. more quickly)
  • Version 19 hires lowres:Lowres!, Options: Clear user dictionary, Swipe down to hide keyboard, Swipe left to delete last word, Character replacement (can remove diacritic chars), Custom smileys. Changed: Import/export of user dictionary is now threaded, Pipe key added to qwerty symbol keyboard, Fixed voice hack was enabled by default even if disabled in settings
  • Version 18: Changed: Hid HTC hidden settings again (caused too much trouble). Option: Smiley button instead of hide kb button, Custom vibration length, Toggle smiley dashes. Fixed: User dictionary editor no longer FC's on modaco custom rom, Word candidate bar now works on Droid 2.1
  • Version 17: Option: Toggle prediction on/off for single line browser forms
  • Version 16: Fixed: space insertion is now disabled for password fields with compact qwerty & phone keypad, Prediction cache was not emptied in some cases resulting in weird behavior when starting input next time (prediction continued where you left off last input)
  • Version 15: Fixed URL KB space hack caused FC on slash key in compact qwerty and phone keypad
  • Version 14: Option: Disable automatic adding to user dictionary, custom popup delay for secondary characters, swipe right for voice input, toggle space insertion after separators, access hidden HTC internal settings (control vibrator etc. TAKE CARE IN HERE!), prediction in URL fields, disable key preview popup. Fixed: cleaned up settings dialog a bit, deleting voice text by back space now works again, space insertion is now always disabled in some fields (browser URL etc. caused problems). New: My own (experimental!) hard keyboard mapping code (enables space in URL for hard KB, removes need for QWERTZ hack etc.), apk version now shows my version instead of HTC's version (smoother upgrades, more logical), Import/export user dictionary, Can now enter any character into user dictionary (HTC just allowed letters and digits)
  • Version 13: Option: left align word candidate list. Fixed: experimental Droid 2.1 landscape support, more robust period insertion on space double tap, rare FC when moving the candidate list (HTC bug), typing " I'm " with compact qwerty (HTC bug), FC when clicking on disabled T9 toggle button (HTC bug), better compatibility between space insertion and smileys, User dictionary is no longer a pain to manage due to scrolling (consequence of HTC incompetence, learn how to use ListViews and Adapters guys!)
  • Version 12: Fixed rotation issues in some apps (ie Terminal). T9/ABC setting is now remembered when switching between letter/number views (HTC's bug, not mine)
  • Version 11: Fixed saving position of word suggestion list (a typo caused the same value to be used for all orientations). Fixed auto cap in browser with physical keyboard.
  • Version 10: Many new options (see feature list). Fixes: voice input in all keyboards, voice input didn't capitalize correctly, "speak now" dialog showing to early, prediction not showing for passwords anymore, auto capitalization for T9/compact QWERTY now works in browser, smoother movement of word suggestion list, settings button showed "EN" (now scaled icon from lowres), Landscape now works on Droid (with resolution related glitches)
  • Version 9: Fixed the screwed up enter key in v8. Added experimental voice server settings. For German to work you will have to use the alternative server.
  • Version 8: Added custom word candidates bar. Fixed wacky SHIFT key. Word candidate list position now remembered. Configurable in settings dialog. Added some Extras to voice input Intent copied from stock KB (missed earlier). One step closer to Droid landscape support.
  • Version 7: Fixed compatibility with Terminal Emulator in CyanogenMod, KB going haywire in CoPilot and word candidate list shows to low (hid active input field sometimes like in stock messaging app). Lowered android:minSdkVersion from 7 to 3. This could mean stock Droid support, but don't complain when it FC's on Cupcake
  • Version 6: Tweaks to the sentence auto capitalization code. Should now work in most web browser forms such as the message composer on this forum. Tweaked enter key behavior a bit.
  • Version 5: Show voice input button for all languages instead of EN button in all keyboards that uses the same layouts as the English ones. To fix this in all other layouts, modding binary XML is required. I need help with that. Voice input seems to use your current locale if supported, and English as fallback.
  • Version 4: New voice input control logic that doesn't break Google Voice search. Changed voice processing URL from dev server to stock keyboard settings.
  • Version 3: Fixed FC in User Dictionary editor. Fixed HTC not obeying EditorInfo.imeOption flag flagNoEnterAction (caused two sends in stock messaging app)
  • Version 2: Fixed FC in user database
  • Version 1: Initial release featuring language settings hack with .htcime and dictionary support in web browser forms. Tested on N1. Clicker is low res for now.
Old low res:
  • Version 4: Better support for OpenEclair (at least one reported succes with Dutch on it)
  • Version 3: Supports Samsung Galaxy/Spica (this version has never been featured on xda)
  • Version 2: Dictionary support in web browser forms
  • Version 1: Initial release featuring language settings hack with .htcime
Attached Thumbnails
Click image for larger version

Name:	1.jpg
Views:	78511
Size:	24.1 KB
ID:	310087   Click image for larger version

Name:	2.jpg
Views:	64180
Size:	24.6 KB
ID:	310088   Click image for larger version

Name:	3.jpg
Views:	43116
Size:	24.0 KB
ID:	310089   Click image for larger version

Name:	4.jpg
Views:	34903
Size:	23.5 KB
ID:	310090   Click image for larger version

Name:	5.jpg
Views:	30882
Size:	20.7 KB
ID:	310091  

Click image for larger version

Name:	6.jpg
Views:	26737
Size:	21.6 KB
ID:	310092   Click image for larger version

Name:	7.jpg
Views:	37498
Size:	24.1 KB
ID:	310093   Click image for larger version

Name:	8.jpg
Views:	24822
Size:	26.3 KB
ID:	310094  
The Following 46 Users Say Thank You to jonasl For This Useful Post: [ Click to Expand ]
 
Driskol
Old
#2  
Driskol's Avatar
Senior Member
Thanks Meter 1
Posts: 399
Join Date: Sep 2008
Location: Sevilla
Hi

Is working right on lanscape?
The Following User Says Thank You to Driskol For This Useful Post: [ Click to Expand ]
 
sinbonders
Old
#3  
Junior Member
Thanks Meter 1
Posts: 20
Join Date: Jan 2010
Is this still the pixelated 320 pixel one?
The Following User Says Thank You to sinbonders For This Useful Post: [ Click to Expand ]
 
jonasl
Old
(Last edited by jonasl; 27th January 2010 at 11:27 PM.)
#4  
Senior Member - OP
Thanks Meter 168
Posts: 379
Join Date: Nov 2009
Location: San Francisco, CA
Yes it does work in landscape, although It doesn't cover the whole screen. It's still usable in my opinion. All other versions of HTC_IME has this behavior on nexus. It's because it's designed for lower resolutions. I haven't changed this.

Edit: It's also pixelated due to the higher resolution on Nexus. Maybe we can use something from the upcoming Bravo. Time will tell.
 
Driskol
Old
#5  
Driskol's Avatar
Senior Member
Thanks Meter 1
Posts: 399
Join Date: Sep 2008
Location: Sevilla
And what about the HD2 skin

Never edited this apk, so i dunno if can be do it
 
samawil
Old
#6  
Member
Thanks Meter 0
Posts: 58
Join Date: Nov 2006
Nice one. thanks for this.
I've been looking for a way to do this.

Since you can't post the link could you please tell me what file I need to change on the cyanogen version so that I can have multiple languages?

I've been paying around with it but wasn't successful.

Thanks

Lou
 
t0pgun
Old
#7  
Member
Thanks Meter 0
Posts: 55
Join Date: Jan 2010
Location: Stockholm
Default Swedish user

Works great! Thanks!
 
jonasl
Old
#8  
Senior Member - OP
Thanks Meter 168
Posts: 379
Join Date: Nov 2009
Location: San Francisco, CA
I'm still waiting for a mod to approve me as a non spammer so I can post the link

The main edit is done in SIPUtils.smali. This method originally loads languages from htc's customization provider.

.method public static localeLanguagePicker(Landroid/content/ContextI

I have replaced its content entirely. This is where I load the info from .htcime or in it's absence fall back on default values.

The key points here is the variables
Lcom/htc/android/htcime/HTCIMMData;->mSettingsLocaleData:[[Ljava/lang/String;

Lcom/htc/android/htcime/HTCIMMData;->mSettingsLocaleNumber:I
You must populate the array with your languages and set the number correctly.

In Java terms you have for example
Code:
int dims[] = new int[]{19, 2};
String[][] d = (String[][]) java.lang.reflect.Array.newInstance(String.class, dims);
        	
d[0][0] = "English";
d[0][1] = "0";
        	
d[1][0] = "Arabic";
d[1][1] = "14";
        	
mSettingsLocaleData = d;
mSettingsLocaleNumber = 2;
This would give you English and Arabic. localeLanguagePicker must return the current selected language id as int, so you must read that from SharedPrecerences (key is "keyboard_language")

I have also removed a to call ListPreference.setValueIndex from
.method private localePicker
in KeyboardSettings.smali to avoid a FC.

It's complicated to explain in an easy way... I'll pm you the URL for my mod. baksmali it and diff it to cyanogens
 
blunden
Old
#9  
Senior Member
Thanks Meter 93
Posts: 840
Join Date: Jun 2009
Location: Stockholm
This is the link to jonasl's work.

http://www.mediafire.com/file/gonyzg...m_settings.zip
 
samawil
Old
#10  
Member
Thanks Meter 0
Posts: 58
Join Date: Nov 2006
thank you so much for this. I hope you can post this soon because many people have been waiting for this.

MERCI
GRACIAS
THANKS.

Tags
htc ime
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes