Develop a Chinese-English Translation software based on Web Service in the Android Project (IV)

Source: Internet
Author: User


Since the birth of Android mobile phones and its stride into the business field, it has attracted countless Smart terminal enthusiasts and developers. Bloggers are one of the members of this group, but keep this enthusiasm ). Just like a blogger, how happy it is to have a machine of your own (not counted by the company )~, After two weeks of "Market Research", I decided to brave myself in Zhongguancun! After several twists and turns, I finally got my favorite host and started 3G services for the first time. I believe that the first thing for all the friends who got smart phones is to install several NB and cool software. One is to celebrate that you have finally caught up with the pace of technology, and the other is to look at the wireless network's Internet access function, then the "troubles" will emerge. As far as the blogger is concerned, the 3G business sponsored by the blogger has MB of traffic each month, and the extra money is charged. As we all know, wireless Internet access and PC Internet access are billed in different ways. Both the yearly and monthly subscription modes of the PC network are traffic-free, while wireless connection is different. Although some mainstream traffic statistics software has been installed to monitor their own traffic expenditures in real time, I am still worried that some operations of some software are "necessary, does some software not save the cost for users to earn traffic or click rate?

From the perspective of users-how to reduce the overhead of user traffic?

When designing this software, I will be "querying" (translation, example sentences, single-word bases, voice, etc ......) The operation provides two data acquisition solutions.

Solution 1:

Access to Web Services is indispensable because it is software that calls Web services. As mentioned above, the frequency of access to the Internet is closely related to the number of visits and traffic expenditures, it also affects consumers' nerves and user experience. Therefore, when designing software, we need to add a "repository" (Sqlite) to store users' information obtained from the Internet, when a user accesses the Internet next time, there is no corresponding information in the database first. If yes, the user directly accesses the database. If not, the user accesses the Internet. In this way, you can save a lot of traffic overhead.


Solution 2:

This solution does not conflict with the first one. They both exist. We should also consider the problem from the user's perspective ." The "query" operation can translate words and display the translated text and phonetic alphabet (pinyin). Meanwhile, the Chinese-English Translation Service also provides "example sentences" for developers to use and the pronunciation of words, there are also Chinese international codes, radicals, strokes, and so on. Although rich content is provided, are these all what users want? First, let's take a look at the description of a method in the documentation provided by the Sino-English Translation Service:

This method named Translator is amazing. Why? Because it is the "originator" of the method provided by this service, it returns all the information, for example, if I want to translate the work English word, when I use the Translator method, I will get three DataTable. ableable0 is some basic information about the word, such as the phonetic symbol. If it is a Chinese word, there will be a country code, there are also translations of word and Mp3 file names for pronunciation. Well, I admit that the data in bleble0 can be said to be necessary, but let's take a look at DataTable1 and DataTable2, related terms, example sentences, such "Additional Information" is not necessary, but it is necessary. Providing this additional information to users will make them feel that the software features are rich, but it can only be used as a backup. When the user is interested, it will be displayed again, which will save the traffic expenditure caused by this "extra data" for the user who is not interested. Therefore, you cannot directly use the Translator. by viewing the document, we found that the Sino-English Translation Service also provides three methods for everyone. They have broken down the Transltor:

TranslatorString: The returned content is consistent with the content in ableable0 above. It is a String []

TranslatorReferString: related entry.

TranslatorSentenceString: Example.

When I click the query button, I will only execute the TranslatorString method and display the result with the saved database operation. If you want to use the pronunciation function, the GetMp3 method will be executed to get byte []. When you want to view the example sentence, the TranslatorSentenceString method will be executed and the result will be displayed and the saved database operation will be executed at the same time, so that the Internet can be accessed separately, the traffic overhead is well controlled, rather than getting all the information at a time, resulting in unnecessary waste. (The audio is marked with garbled characters. I will explain the Garbled text later)

When I talk about how to save traffic overhead, we will think that I will provide you with any good technology. Actually, it is not. What I want to say is: I will make good software only when I think about it for users, technology is only a tool, but an aid.

Next article: Some "minor issues" and codes in Sqlite usage

From: One Kid Sky

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: 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.