Remote Input method of Android IME extension

Source: Internet
Author: User
Tags iqiyi

in recent years, Internet TV has started hot, music 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, the traditional simple television reception TV has been too traditional. It is time to be revolutionized. 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, only need solutions, services, online booking, direct courier and other ways to greatly reduce costs, the same time can also control inventory, prevention of risk.

At the same time they all insisted that the hardware does not make money, service charges. The potential value of a TV user object is more important. There are more users. Everything is convenient, of course, there is a larger concept of smart home.

In addition to Apple TV, none of the other Android systems are used. But all kinds of internet TV say it is still TV. Unlike mobile phones, tablets, PCs and other electronic products, users are far from it. Users are 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. The input of this TV is OK, just need to be entered directly through the external keyboard, but for a language like Chinese such as the need for conversion, it is troublesome. 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: TV installed a love kick door of the remote input method, the input method connected to the remote terminal of the phone, and then the user 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 remote input method is very easy: to do a special input method, the input method is no longer by touching the soft keyboard to obtain input characters, but through the network directly from the network and one end to get the characters (this character can be in English, also can be Chinese. character) and send the word to the application. The core of the input is two: Inputconnection Committext and sendkeyevent two interfaces, such as the following code implementation:

   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 there is the big head of the code. Network module: the implementation of LAN search services, their own 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

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvsvrszwfrcw==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center "width=" "height=" >

The user installs the Remote IME program on two phones. One of the phones opens the remote IME app. Another phone will choose Input method as Remoteime, and click on the Search button inside, when the status becomes connected, remote input Method application can be input to the remote input method.

Select the Remoteime IME configuration process:

1) Select the language and input method in setting, then select Remoteime

2) then click the default, will pop up the selection box, continue to select Remoteime

3) then enter any program that needs to be entered. You can use Remoteime

If you want to know a lot of other things, you can 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

Related Article

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.