Remote Input method of Android IME extension

Source: Internet
Author: User
Tags iqiyi

in recent years, Internet TV has started to be hot. Le video tv, Millet TV, the recent Iqiyi art is also in the wantonly recruit to do Iqiyi Yi TV. There are, of course, more watched Apple TVs. In fact. This trend is very normal and very reasonable. Traditional television has been too traditional to receive TV, it is time to be revolution. Music as the representative of the next generation of Internet television to take the internet marketing way, do not need physical stores, no physical factory, just need solutions. Services, online booking, direct courier and other ways to greatly reduce the cost, the same time can also control inventory, risk prevention. At the same time they all insisted that the hardware does not make money, service charges, more value TV user Object this potential value.

More users, do anything convenient, of course, there is a larger concept of smart home.

Except for Apple TV. None other than the Android system. But all kinds of internet TV say it is still TV, not like mobile phone, tablet, PC and other electronic products. The user is away from it, the user is not able to directly touch the screen and other ways to enter. So Android soft keyboard mode is really not good enough input interactive mode. For the English Department of the country, this TV input is OK to solve. Just enter it directly from the external keyboard. But for languages like Chinese that need to be converted, it's a hassle. This is because the Android external keyboard can only input English characters, the same time the input method cannot get the external keyboard (only touch soft keyboard characters) input to convert it to Chinese. This reminds me of the title "Remote Input Method".

A very common scenario is: The TV installed a love kick door remote Input method. The input method is connected to the remote input terminal of the phone. Then the user input in the remote input program with its own input method (Sogou input method), and then the input of the content in real-time transmission to the program in the TV.



remote Input Method mechanism

The mechanism of the remote input method is very easy: make a special input method, the input method no longer through the touch soft keyboard to get the characters. Instead, the character can be retrieved directly from the network through the network (the character is English. It can also be Chinese. character) and send the word to the application. The core of the input is two: Inputconnection Committext and sendkeyevent two interfaces. For example, the following code is implemented:

   private void SendText (String text) {if (!isshow ()) {LOG.D (TAG, "IME is hidden");    Return        } final Inputconnection IC = Getcurrentinputconnection ();            if (IC = = null) {LOG.D (TAG, "IC null");        Return    }//Send the text of any language, such as Chinese, to the program Ic.committext (text, text.length ());        } public void senddownupkeyevents (int keyeventcode) {inputconnection IC = getcurrentinputconnection ();        if (IC = = null) return;        Long eventtime = Systemclock.uptimemillis (); Send Delete,backspace special input such as delete character, special input is realized by Key, OH Ic.sendkeyevent (New KeyEvent (Eventtime, Eventtime, key Event.action_down, Keyeventcode, 0, 0, keycharactermap.virtual_keyboard, 0, keyevent.flag_soft_keyboard|        Keyevent.flag_keep_touch_mode));  Ic.sendkeyevent (New KeyEvent (Systemclock.uptimemillis (), Eventtime, keyevent.action_up, Keyeventcode, 0, 0,               Keycharactermap.virtual_keyboard, 0, keyevent.flag_soft_keyboard|    Keyevent.flag_keep_touch_mode)); }

Then is the code of the Big Head, Network module: the implementation of LAN search services. Self-active connection, network data transmission.


remote Input Method installation and use and source code

The following is my remote Input method interface and the use of the interface

The user installs the Remote IME program on two phones, one of them opens the remote Input method application, the other one selects the input method as Remoteime, and clicks the search button inside. When status becomes connected. The remote Input method application can enter content for the remote input method.

Select the Remoteime IME configuration process:

1) Select the language and input method in the setting. Then select Remoteime

2) then click Default. The selection box will pop up and continue to select Remoteime

3) then enter any program you need to enter, you can use the Remoteime

Suppose you want to know a lot of other things. Able to find my source code for this project on GitHub:

Https://github.com/itleaks/RemoteIme

Assuming that it is just a test, you can directly use the remoteime.apk in the item, the source code is only the 0 base version number, we can change the improvement together.


PostScript:

This blog will be followed in the next--------the Android Input method extension outside the keyboard Chinese input


/********************************

* This article from the blog "Love Kick Door"

* Reprint Please indicate the source : Http://blog.csdn.net/itleaks

******************************************/

Remote Input method of Android IME extension

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.