Go To Market 技术资源推荐

Highfishfish 2013-10-16 11:01:24
加精
基于数据集成、数据质量、主数据管理和信息生命周期管理四大系列产品,Go To Market 提供最新的产品介绍、深入的行业分析和解决方案,助您释放信息潜能。

了解 PowerCenter,成为Hadoop 开发人员
从传统商业智能到大数据分析
您的企业是否为大数据做好了准备?
...全文
6265 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
rist916 2014-06-30
  • 打赏
  • 举报
回复
具体都有什么
xiongyw 2013-10-22
  • 打赏
  • 举报
回复
看看是什么?
line_us 2013-10-16
  • 打赏
  • 举报
回复
具体都有些什么呢。
欧阳丁 2013-10-16
  • 打赏
  • 举报
回复
混点积分真难啊
bichenghui88 2013-10-16
  • 打赏
  • 举报
回复
楼主有没有技术方案提供提供
DayDayUpCC 2013-10-16
  • 打赏
  • 举报
回复
楼主有没有技术方案提供提供
cx_mdzlhnb 2013-10-16
  • 打赏
  • 举报
回复
PowerCenter和Hadoop 的关系,想看看资料还那么麻烦
bbyright 2013-10-16
  • 打赏
  • 举报
回复
现在这些大型计算机帮助我们发展和创新,同时也将我们带入了计算机时代是不错,但是对数据的隐私也有所担忧啊
bbyright 2013-10-16
  • 打赏
  • 举报
回复
比较冷门
FKL 2013-10-16
  • 打赏
  • 举报
回复
这是复习及备战六级的秘籍,很赞的资源哦2008年6月大学英语六级A卷真题 Part I Writing (30 minutes) Will E-books Replace Traditional Books? 1.随着信息技术的发展,电子图书越来越多; 2.有人认为电子图书将会取代传统图书,理由是… 3.我的看法。 Part Ⅱ Reading Comprehension(Skimming and Scanning)(15 minutes) What Will the World Be Like in Fifty Years? This week some top scientists, including Nobel Prize winners, gave their vision of how the world will look in 2056, from gas-powered cars to extraordinary health advances, John Ingham reports on what the world’s finest minds believe our futures will be. For those of us lucky enough to live that long, 2056 will be a world of almost perpetual youth, where obesity is a remote memory and robots become our companions. We will be rubbing shoulders with aliens and colonising outer space. Better still, our descendants might at last live in a world at peace with itself. The prediction is that we will have found a source of inexhaustible, safe, green energy, and that science will have killed off religion. If they are right we will have removed two of the main causes of war-our dependence on oil and religious prejudice. Will we really, as today’s scientists claim, be able to live for ever or at least cheat the ageing process so that the average person lives to 150? Of course, all these predictions come with a scientific health warning. Harvard professor Steven Pinker says: “This is an invitation to look foolish, as with the predictions of domed cities and nuclear-powered vacuum cleaners that were made 50 year ago.” Living longer Anthony Atala, director of the Wake Forest Institute in North Carolina, believes failing organs will be repaired by injecting cells into the body. They will naturally go straight to the injury and help heal it. A system of injections without needles could also slow the ageing process by using the same process to “tune” cells. Bruce Lahn, professor of human genetics at the University of Chicago, anticipates the ability to produce “unlimited supplies” of transplantable human organs without the need for human donors. These organs would be grown in animals such as pigs. When a patient needed a new organ, such as a kidney, the surgeon would contact a commercial organ producer, give him the patient’s immunological profile and would then be sent a kidney with the correct tissue type. These organs would be entirely composed of human cells, grown by introducing them into animal hosts, and allowing them to develop into an organ in place of the animal’s own. But Prof. Lahn believes that farmed brains would be “off limits”. He says: “Very few people would want to have their brains replaced by someone else’s and we probably don’t want to put a human brain in an animal body.” Richard Miller, a professor at the University of Michigan, thinks scientist could develop “authentic anti-ageing drugs” by working out how cells in larger animals such as whales and human resist many forms of injuries. He says: “It is now routine, in laboratory mammals, to extend lifespan by about 40%. Turning on the same protective systems in people should, by 2056, create the first class of 100-year-olds who are as vigorous and productive as today’s people in their 60s” Aliens Colin Pillinger, professor of planetary sciences at the Open University, says: I fancy that at least we will be able to show that life did start to evolve on Mars well as Earth.” Within 50years he hopes scientists will prove that alien life came here in Martian meteorites(陨石). Chris McKay, a planetary scientist at NASA’s Ames Research Center. believes that in 50 years we may find evidence of alien life in the ancient permanent frost of Mars or on other planers. He adds: There is even a chance we will find alien life forms here on Earth. It might be as different as English is to Chinese. Princeton professor Freeman Dyson thinks it “likely” that life form outer space will be discovered before 2056 because the tools for finding it, such as optical and radio detection and data processing, are improving. He says: “As soon as the first evidence is found, we will know what to look for and additional discoveries are likely to follow quickly. Such discoveries are likely to have revolutionary consequences for biology, astronomy and philosophy. They may also change the way we look at ourselves and our place in the universe.” Colonies in space Richard Gott, professor of astrophysics at Princeton, hopes man will set up a self-sufficient colony on Mars, which would be a “life insurance policy against whatever catastrophes, natural or otherwise, might occur on Earth. “The real space race is whether we will colonise off Earth on to other worlds before money for the space programme runs out.” Spinal injuries Ellen Heber-Katz, a professor at the Wistar Institute in Philadelphia, foresees cures for injuries causing paralysis such as the one that afflicted Superman star Christopher Reeve. She says: “I believe that the day is not far off when we will be able to prescribe drugs that cause severed (断裂的) spinal cords to heal, hearts to regenerate and lost limbs to regrow.” “People will come to expect that injured or diseased organs are meant to be repaired from within, in much the same way that we fix an appliance or automobile: by replacing the damaged part with a manufacturer-certified new part.” She predicts that within 5 to 10 years fingers and toes will be regrown and limbs will start to be regrown a few years later. Repairs to the nervous system will start with optic nerves and, in time, the spinal cord.” Within 50 years whole body replacement will be routine,” Prof. Heber-Katz adds. Obesity Sydney Brenner, senior distinguished fellow of the Crick-Jacobs Center in California, won the 2002 Nobel Prize for Medicine and says that if there is a global disaster some humans will survive-and evolution will favour small people with bodies large enough to support the required amount of brain power.” Obesity,” he says.” will have been solved.” Robots Rodney Brooks, professor of robotics at MIT, says the problems of developing artificial intelligence for robots will be at least partly overcome. As a result, “the possibilities for robots working with people will open up immensely” Energy Bill Joy, green technology expert in California, says:” The most significant breakthrough would be to have an inexhaustible source of safe, green energy that is substantially cheaper than any existing energy source.” Ideally, such a source would be safe in that it could not be made into weapons and would not make hazardous or toxic waste or carbon dioxide, the main greenhouse gas blamed for global warming. Society Geoffrey Miller, evolutionary psychologist at the University of New Mexico, says: The US will follow the UK in realizing that religion is not a prerequisite (前提)for ordinary human decency. “This, science will kill religion-not by reason challenging faith but by offering a more practical, universal and rewarding moral framework for human interaction.” He also predicts that “absurdly wasteful” displays of wealth will become unfashionable while the importance of close-knit communities and families will become clearer. These three changer, he says, will help make us all” brighter, wiser, happier and kinder”. 1.What is john lngham’s report about? A) A solution to the global energy crisis B) Extraordinary advances in technology. C) The latest developments of medical science D) Scientists’ vision of the world in half a century 2. According to Harvard professor Steven Pinker, predictions about the future_____. A) may invite trouble B) may not come true C) will fool the public D) do more harm than good 3. Professor Bruce Lahn of the University of Chicago predicts that____. A) humans won’t have to donate organs for transplantation B) more people will donate their organs for transplantation C) animal organs could be transplanted into human bodies D) organ transplantation won’t be as scary as it is today 4. According to professor Richard Miller of the University of Michigan, people will____. A) life for as long as they wish B) be relieved from all sufferings C) live to 100 and more with vitality D) be able to live longer than whales 5.Priceton professor Freeman Dyson thinks that____. A) scientists will find alien life similar to ours B) humans will be able to settle on Mars C) alien life will likely be discovered D) life will start to evolve on Mars 6.According to Princeton professor Richard Gott, by setting up a self-sufficient colony on Mars, Humans_____. A) might survive all catastrophes on earth B) might acquire ample natural resources C) Will be able to travel to Mars freely D)Will move there to live a better life 7.Ellen Heber-Katz, professor at the Wistar Institute in Philadelphia, predicts that_____. A) human organs can be manufactured like appliances B) people will be as strong and dynamic as supermen C) human nerves can be replaced by optic fibers D) lost fingers and limbs will be able to regrow 8. Rodney Brooks says that it will be possible for robots to work with humans as a result of the development of _____ 9. The most significant breakthrough predicted by Bill Joy will be an inexhaustible green energy source that can’t be used to make__. 10. According to Geoffrey Miller, science will offer a more practical, universal and rewarding moral framework in place of_______. Part III Listening Comprehension (35minutes) Section A 11. A) The man might be able to play in the World Cup. B) The man’s football career seems to be at an end. C) The man was operated on a few weeks ago. D) The man is a fan of world-famous football players. 12. A) Work out a plan to tighten his budget B) Find out the opening hours of the cafeteria. C) Apply for a senior position in the restaurant. D) Solve his problem by doing a part-time job. 13. A) A financial burden. B) A good companion C) A real nuisance. D) A well-trained pet. 14. A) The errors will be corrected soon. B) The woman was mistaken herself. C) The computing system is too complex. D) He has called the woman several times. 15. A) He needs help to retrieve his files. B) He has to type his paper once more. C) He needs some time to polish his paper. D) He will be away for a two-week conference. 16. A) They might have to change their plan. B) He has got everything set for their trip. C) He has a heavier workload than the woman. D) They could stay in the mountains until June 8. 17. A) They have to wait a month to apply for a student loan. B) They can find the application forms in the brochure. C) They are not eligible for a student loan. D) They are not late for a loan application. 18. A) New laws are yet to be made to reduce pollutant release. B) Pollution has attracted little attention from the public. C) The quality of air will surely change for the better. D) It’ll take years to bring air pollution under control. Questions 19 to 22 are based on the conversation you have just heard. 19. A) Enormous size of its stores. B) Numerous varieties of food. C) Its appealing surroundings. D) Its rich and colorful history. 20. A) An ancient building. B) A world of antiques. C) An Egyptian museum. D) An Egyptian Memorial. 21. A) Its power bill reaches £9 million a year. B) It sells thousands of light bulbs a day. C) It supplies power to a nearby town. D) It generates 70% of the electricity it uses. 22. A) 11,500 B) 30,000 C) 250,000 D) 300,000 Questions 23 to 25 are based on the conversation you have just heard. 23. A) Transferring to another department. B) Studying accounting at a university C) Thinking about doing a different job. D) Making preparations for her wedding. 24. A) She has finally got a promotion and a pay raise. B) She has got a satisfactory job in another company. C) She could at last leave the accounting department. D) She managed to keep her position in the company. 25. A) He and Andrea have proved to be a perfect match. B) He changed his mind about marriage unexpectedly. C) He declared that he would remain single all his life. D) He would marry Andrea even without meeting her. Section B Passage One Questions 26 to 29 are based on the passage you have just heard. 26.A) They are motorcycles designated for water sports. B) They are speedy boats restricted in narrow waterways. C) They are becoming an efficient form of water transportation. D) They are getting more popular as a means or water recreation. 27.A) Water scooter operators’ lack of experience. B) Vacationers’ disregard of water safety rules. C) Overloading of small boats and other craft. D) Carelessness of people boating along the shore. 28.A) They scare whales to death. B) They produce too much noise. C) They discharge toxic emissions. D) They endanger lots of water life. 29.A)Expand operating areas. B) Restrict operating hours. C) Limit the use of water scooters. D) Enforce necessary regulations. Passage Two Questions 30 to 32 are based on the passage you have just heard. 30.A) They are stable. B) They are close. C) They are strained. D) They are changing. 31.A) They are fully occupied with their own business. B) Not many of them stay in the same place for long. C) Not many of them can win trust from their neighbors. D) They attach less importance to interpersonal relations. 32.A) Count on each other for help. B) Give each other a cold shoulder. C) Keep a friendly distance. D) Build a fence between them. Passage Three Questions 33 to 35 are based on the passage you have just heard. 33.A) It may produce an increasing number of idle youngsters. B) It may affect the quality of higher education in America. C) It may cause many schools to go out of operation. D) It may lead to a lack of properly educated workers. 34. A)It is less serious in cities than in rural areas. B) It affects both junior and senior high schools. C) It results from a worsening economic climate. D) It is a new challenge facing American educators. 35. A) Allowing them to choose their favorite teachers. B) Creating a more relaxed learning environment. C) Rewarding excellent academic performance. D) Helping them to develop better study habits. Section C I'm interested in the criminal justice system of our country. It seems to me that something has to be done if we’re to (36) ___ as a country. I certainly don't know what the answers to our problems are. Things certainly get (37) ____in a hurry when you get into them. But I wonder if something couldn't be done to deal with some of these problems. One thing I'm concerned about is our practice of putting (38) _____ in jail who haven't harmed anyone. Why not work out some system (39) _____ they can pay back the debts they owe society instead of (40) ___ another debt by going to prison, and of course, coming under the (41) ____of hardened criminals? I'm also concerned about the short prison sentences people are (42) ______ for serious crimes. Of course, one alternative to this is to (43) ______ capital punishment, but I'm not sure I would be for that. I'm not sure it's right to take an eye for eye. (44) _____. I also think we must do something about the insanity plea. In my opinion, anyone who takes another person’s life intentionally is insane; however, (45) _____. It’s sad, of course, that a person may have to spend the rest of his life, or (46) ______. Part IV Reading Comprehension (Reading in Depth) (25 minutes) Section A Questions 47 to 51 are based on the following passage. If movie trailers(预告片)are supposed to cause a reaction, the preview for "United 93" more than succeeds. Featuring no famous actors, it begins with images of a beautiful morning and passengers boarding an airplane. It takes you a minute to realize what the movie’s even about. That’s when a plane hits the World Trade Center. the effect is visceral(震撼心灵的). When the trailer played before "Inside Man" last week at a Hollywood theater, audience members began calling out, "Too soon!" In New York City, the response was even more dramatic. The Loews theater in Manhattan took the rare step of pulling the trailer from its screens after several complaints. “United 93” is the first feature film to deal explicitly with the events of September 11, 2001, and is certain to ignite an emotional debate. Is it too soon? Should the film have been made at all? More to the point, will anyone want to see it? Other 9/11 projects are on the way as the fifth anniversary of the attacks approaches, most notably Oliver Stone's " World Trade Center." but as the forerunner, “United 93” will take most of the heat, whether it deserves it or not. The real United 93 crashed in a Pennsylvania field after 40 passengers and crew fought back against the terrorists. Writer-director Paul Greengrass has gone to great lengths to be respectful in his depiction of what occurred, proceeding with the film only after securing the approval of every victim's family. "Was I surprised at the agreement? Yes. Very. Usually there’re one or two families who're more reluctant," Greengrass writes in an e-mail. "I was surprised at the extraordinary way the United 93 families have welcomed us into their lives and shared their experiences with us." Carole O'Hare, a family member, says, “They were very open and honest with us, and they made us a part of this whole project.” Universal, which is releasing the film, plans to donate 10% of its opening weekend gross to the Flight 93 National Memorial Fund. That hasn't stopped criticism that the studio is exploiting a national tragedy. O’Hare thinks that’s unfair. “This story has to be told to honor the passengers and crew for what they did,” she says. “But more than that, it raises awareness. Our ports aren’t secure. Our borders aren’t secure. Our airlines still aren’t secure, and this is what happens when you’re not secure. That’s the message I want people to hear.” 47. The trailer for “United 93” succeeded in ________ when it played in the theaters in Hollywood and New York City. 48. The movie “United 93” is sure to give rise to _______________. 49. What did writer-director Paul Greengrass obtain before he proceeded with the movie? 50. Universal, which is releasing “United 93”, has been criticized for _________. 51. Carole O’Hare thinks that besides honoring the passengers and crew for what they did, the purpose of telling the story is to _________ about security. Part IV Reading Comprehension (Reading in Depth) (25 minutes) Section A Questions 47 to 51 are based on the following passage. If movie trailers(预告片)are supposed to cause a reaction, the preview for "United 93" more than succeeds. Featuring no famous actors, it begins with images of a beautiful morning and passengers boarding an airplane. It takes you a minute to realize what the movie’s even about. That’s when a plane hits the World Trade Center. the effect is visceral(震撼心灵的). When the trailer played before "Inside Man" last week at a Hollywood theater, audience members began calling out, "Too soon!" In New York City, the response was even more dramatic. The Loews theater in Manhattan took the rare step of pulling the trailer from its screens after several complaints. “United 93” is the first feature film to deal explicitly with the events of September 11, 2001, and is certain to ignite an emotional debate. Is it too soon? Should the film have been made at all? More to the point, will anyone want to see it? Other 9/11 projects are on the way as the fifth anniversary of the attacks approaches, most notably Oliver Stone's " World Trade Center." but as the forerunner, “United 93” will take most of the heat, whether it deserves it or not. The real United 93 crashed in a Pennsylvania field after 40 passengers and crew fought back against the terrorists. Writer-director Paul Greengrass has gone to great lengths to be respectful in his depiction of what occurred, proceeding with the film only after securing the approval of every victim's family. "Was I surprised at the agreement? Yes. Very. Usually there’re one or two families who're more reluctant," Greengrass writes in an e-mail. "I was surprised at the extraordinary way the United 93 families have welcomed us into their lives and shared their experiences with us." Carole O'Hare, a family member, says, “They were very open and honest with us, and they made us a part of this whole project.” Universal, which is releasing the film, plans to donate 10% of its opening weekend gross to the Flight 93 National Memorial Fund. That hasn't stopped criticism that the studio is exploiting a national tragedy. O’Hare thinks that’s unfair. “This story has to be told to honor the passengers and crew for what they did,” she says. “But more than that, it raises awareness. Our ports aren’t secure. Our borders aren’t secure. Our airlines still aren’t secure, and this is what happens when you’re not secure. That’s the message I want people to hear.” 47. The trailer for “United 93” succeeded in ________ when it played in the theaters in Hollywood and New York City. 48. The movie “United 93” is sure to give rise to _______________. 49. What did writer-director Paul Greengrass obtain before he proceeded with the movie? 50. Universal, which is releasing “United 93”, has been criticized for _________. 51. Carole O’Hare thinks that besides honoring the passengers and crew for what they did, the purpose of telling the story is to _________ about security. Section B Passage One Questions 52 to 56 are based on the following passage. Imagine waking up and finding the value of your assets has been halved. No, you’re not an investor in one of those hedge funds that failed completely. With the dollar slumping to a 26-year low against the pound, already-expensive London has become quite unaffordable. A coffee at Starbucks, just as unavoidable in England as it is in the United States, runs about $8. The once all-powerful dollar isn’t doing a Titanic against just the pound. It is sitting at a record low against the euro and at a 30-year low against the Canadian dollar. Even the Argentine peso and Brazilian real are thriving against the dollar. The weak dollar is a source of humiliation, (屈辱),for a nation’s self-esteem rests in part on the strength of its currency. It’s also a potential economic problem, since a declining dollar makes imported food more expensive and exerts upward pressure on interest rates. And yet there are substantial sectors of the vast U.S. economy-from giant companies like Coca-Cola to mom-and-pop restaurant operators in Miami-for which the weak dollar is most excellent news. Many Europeans may view the U.S. as an arrogant superpower that has become hostile to foreigners. But nothing makes people think more warmly of the U.S. than a weak dollar. Through April, the total number of visitors from abroad was up 6.8 percent from last year. Should the trend continue, the number of tourists this year will finally top the 2000 peak? Many Europeans now apparently view the U.S. the way many Americans view Mexico-as a cheap place to vacation, shop and party, all while ignoring the fact that the poorer locals can’t afford to join the merrymaking. The money tourists spend helps decrease our chronic trade deficit. So do exports, which thanks in part to the weak dollar, soared 11 percent between May 2006 and May 2007. For first five months of 2007, the trade deficit actually fell 7 percent from 2006. If you own shares in large American corporations, you’re a winner in the weak-dollar gamble. Last week Coca-Cola’s stick bubbled to a five-year high after it reported a fantastic quarter. Foreign sales accounted for 65 percent of Coke’s beverage (饮料)business. Other American companies profiting from this trend include McDonald’s and IBM. American tourists, however, shouldn’t expect any relief soon. The dollar lost strength the way many marriages break up-slowly, and then all at once. And currencies don’t turn on a dime. So if you want to avoid the pain inflicted by the increasingly pathetic dollar, cancel that summer vacation to England and look to New England. There, the dollar is still treated with a little respect. 52. Why do Americans feel humiliated? A) Their economy is plunging B) Their currency has slumped C) They can’t afford trips to Europe D) They have lost half of their assets. 53.How does the current dollar affect the life of ordinary Americans? A) They have to cancel their vacations in New England. B) They find it unaffordable to dine in mom-and-pop restaurants. C) They have to spend more money when buying imported goods. D) They might lose their jobs due to potential economic problems. 54. How do many Europeans feel about the U.S with the devalued dollar? A) They feel contemptuous of it B) They are sympathetic with it. C) They regard it as a superpower on the decline. D) They think of it as a good tourist destination. 55. what is the author’s advice to Americans? A) They treat the dollar with a little respect B) They try to win in the weak-dollar gamble C) They vacation at home rather than abroad D) They treasure their marriages all the more. 56. What does the author imply by saying “currencies don’t turn on a dime” (Line 2,Para 7)? A) The dollar’s value will not increase in the short term. B) The value of a dollar will not be reduced to a dime C) The dollar’s value will drop, but within a small margin. D) Few Americans will change dollars into other currencies. Passage Two Questions 57 to 61 are based on the following passage. In the college-admissions wars, we parents are the true fights. We’re pushing our kids to get good grades, take SAT preparatory courses and build resumes so they can get into the college of our first choice. I’ve twice been to the wars, and as I survey the battlefield, something different is happening. We see our kids’ college background as a prize demonstrating how well we’ve raised them. But we can’t acknowledge that our obsession(痴迷) is more about us than them. So we’ve contrived various justifications that turn out to be half-truths, prejudices or myths. It actually doesn’t matter much whether Aaron and Nicole go to Stanford. We have a full-blown prestige panic; we worry that there won’t be enough prizes to go around. Fearful parents urge their children to apply to more schools than ever. Underlying the hysteria(歇斯底里) is the belief that scarce elite degrees must be highly valuable. Their graduates must enjoy more success because they get a better education and develop better contacts. All that is plausible—and mostly wrong. We haven’t found any convincing evidence that selectivity or prestige matters. Selective schools don’t systematically employ better instructional approaches than less selective schools. On two measures—professors’ feedback and the number of essay exams selective schools do slightly worse. By some studies, selective schools do enhance their graduates’ lifetime earnings. The gain is reckoned at 2-4% for every 100-poinnt increase in a school’s average SAT scores. But even this advantage is probably a statistical fluke(偶然). A well-known study examined students who got into highly selective schools and then went elsewhere. They earned just as much as graduates from higher-status schools. Kids count more than their colleges. Getting into Yale may signify intelligence, talent and ambition. But it’s not the only indicator and, paradoxically, its significance is declining. The reason: so many similar people go elsewhere. Getting into college is not life’s only competition. In the next competition—the job market and graduate school—the results may change. Old-boy networks are breaking down. princeton economist Alan Krueger studied admissions to one top Ph.D. program. High scores on the GRE helped explain who got in; degrees of prestigious universities didn’t. So, parents, lighten up. The stakes have been vastly exaggerated. Up to a point, we can rationalize our pushiness. America is a competitive society; our kids need to adjust to that. But too much pushiness can be destructive. The very ambition we impose on our children may get some into Harvard but may also set them up for disappointment. One study found that, other things being equal, graduates of highly selective schools experienced more job dissatisfaction. They may have been so conditioned to being on top that anything less disappoints. 57.Why dose the author say that parents are the true fighters in the college-admissions wars? A) They have the final say in which university their children are to attend. B) They know best which universities are most suitable for their children. C) They have to carry out intensive surveys of colleges before children make an application. D) They care more about which college their children go to than the children themselves. 58.Why do parents urge their children to apply to more schools than ever? A) They want to increase their children’s chances of entering a prestigious college. B)They hope their children can enter a university that offers attractive scholarships. C) Their children will have a wider choice of which college to go to. D) Elite universities now enroll fewer student than they used to. 59.What does the author mean by “kids count more than their colleges”Line1, para.4? A) Continuing education is more important to a person’s success. B) A person’s happiness should be valued more than their education. C) Kids’ actual abilities are more important than their college background. D) What kids learn at college cannot keep up with job market requirements. 60.What does Krueger’s study tell us? A) Getting into Ph.D. programs may be more competitive than getting into college. B) Degrees of prestigious universities do not guarantee entry to graduate programs. C) Graduates from prestigious universities do not care much about their GRE scores. D) Connections built in prestigious universities may be sustained long after graduation. 61.One possible result of pushing children into elite universities is that______ A) they earn less than their peers from other institutions B) they turn out to be less competitive in the job market C) they experience more job dissatisfaction after graduation D) they overemphasize their qualifications in job application Part V Cloze Seven years ago, when I was visiting Germany, I met with an official who explained to me that the country had a perfect solution to its economic problems. Watching the U.S. economy 62 during the’ 90s, the Germans had decided that they, too, needed to go the high-technology _63_. But how? In the late’ 90s, the answer schemed obvious: Indians. _64_ all, Indian entrepreneurs accounted for one of every three Silicon Valley start-ups. So the German government decided that it would _65_ Indians to Germany just as America does: by _66_ green cards. Officials created something called the German Green Card and _67_ that they would issue 20,000 in the first year. _68_, the Germans expected that tens of thousands more Indians would soon be begging to come, and perhaps the _69_ would have to be increased. But the program was a failure. A year later _70_ half of the 20,000 cards had been issued. After a few extensions, the program was _71_. I told the German official at the time that I was sure the _72_ would fail. It’s not that I had any particular expertise in immigration policy, _73_ I understood something about green cards, because I had one (the American _74_). The German Green Card was misnamed, I argued, _75_ it never, under any circumstances, translated into German citizenship. The U.S. green card, by contrast, is an almost _76_ path to becoming American (after five years and a clean record). The official _77_ my objection, saying that there was no way Germany was going to offer these people citizenship. “We need young tech workers,” he said. “That’s what this program is all _78_.” So Germany was asking bright young _79_ to leave their country, culture and families, move thousands of miles away, learn a new language and work in a strange land—but without any _80_ of ever being part of their new home. Germany was sending a signal, one that was _81_ received in India and other countries, and also by Germany’s own immigrant community. 62. A) soar B) hover C) amplify D) intensify 63. A) circuit B) strategy C) trait D) route 64. A) Of B) After C) In D) At 65. A) import B) kidnap C) convey D) lure 66. A) offering B) installing C) evacuating D) formulating 67. A) conferred B) inferred C) announced D) verified 68. A) Specially B) Naturally C) Particularly D) Consistently 69. A) quotas B) digits C) measures D) scales 70. A) invariably B) literally C) barely D) solely 71. A) repelled B) deleted C) combated D) abolished 72. A) adventure B) response C) initiative D) impulse 73. A) and B) but C) so D) or 74. A) heritage B) revision C) notion D) version 75. A) because B) unless C) if D) while 76. A) aggressive B) automatic C) vulnerable D) voluntary 77. A) overtook B) fascinated C) submitted D) dismissed 78. A) towards B) round C) about D) over 79. A) dwellers B) citizens C) professionals D) amateurs 80. A) prospect B) suspicion C) outcome D) destination 81. A) partially B) clearly C) brightly D) vividly Part VI Translation 82. We can say a lot of things about those ________________(毕生致力于诗歌的人): they are passionate, impulsive, and unique. 83. Mary couldn’t have received my letter, ___________ (否则她上周就该回信了). 84. Nancy is supposed to ____________________ (做完化学实验) at least two weeks ago. 85. Never once ___________________ (老两口互相争吵) since they were married 40 years ago. 86. ________________________ (一个国家未来的繁荣在很大程度上有赖于) the quality of education of its
中文名: 构建自己最出色的WordPress主题 原名: Build Your Own Wicked Wordpress Themes 作者: Alan Cole Raena Jackson Armitage Brandon R. Jones Jeffrey Way 资源格式: PDF 出版社: SitePoint书号: 978-0980455298发行时间: 2010年09月04日 地区: 美国 语言: 英文 简介: 内容介绍: Wicked WordPress Themes is a step-by-step guide to creating beautiful themes for the world's most popular CMS, WordPress. By following the book's advice, readers can produce designs that are aesthetically stunning, consistent, and for-purpose -whether it's for their own use, or to drive a high price on the theme marketplace. All facets of theme design are covered: from design, coding, and deployment, to ensuring readers' designs are ready-to-go as soon as they're installed. Wicked WordPress Themes teaches readers how to leverage theme design frameworks to dramatically shorten development time, enabling them to enter the theme market faster. 作者介绍: Alan Cole Allan Cole is a web designer and developer based in Brooklyn, NY and is widely known as a Thematic framework guru. He specializes in front-end user experience and WordPress customization. Raena Jackson Armitage Raena Jackson Armitage is an Australian web developer with a background in content management and training. A former SitePoint technical editor, you’ll find her speaking at some of the more popular geek conferences. Brandon R. Jones Brandon R. Jones has developed some of the Web's best-selling WordPress themes. He has a strong background in graphic design, digital illustration, and user interface design. Jeffrey Way Jeffrey Way manages CodeCanyon, an online code marketplace, and Nettuts, a popular web development tutorial site. He also ran the biggest online marketplace for buying and selling WordPress themes—Theme Forest—for 2 years. 目录: Preface 1. Introducing WordPress 2. Planning Your Theme 3. Theme Design 101 4. Theme Frameworks 5. Advanced Theme Construction 6. Widgets 7. Theme Options 8. Selling Your Theme Index
工程硕士学位论文 基于Android+HTML5的移动Web项目高效开发探究 研究生姓名: 唐帅 导师姓名: 罗军舟 教授 苏生 教授 申请学位类别 工 程 硕 士 学位授予单位 东 南 大 学 工程领域名称 软 件 工 程 论文答辩日期 研究方向 Android+HTML5 学位授予日期 答辩委员会主席 评阅人 硕士学位论文 基于Android+HTML5的移动Web项目 高效开发探究 专业名称: 软件工程 研究生姓名: 唐帅 导师姓名: 罗军舟 校外导师: 苏生 THE RESEARCH OF EFFICIENT DEVELOPMENT OF MOBILE WEB PROJECTS BASED ON ANDROID AND HTML5 A Thesis Submitted to SoutheastUniversity For the Academic Degree of Master of Engineering BY Tang Shuai Supervised by Luo Junzhou and Su Sheng College of Software Engineering SoutheastUniversity February 2017 东南大学学位论文 独创性声明 本人声明所呈交的学位论文是我个人在导师指导下进行的研究工作及取得的研究成果。尽我所知,除了文中特别加以标注和致谢的地方外,论文中不包含其他人已经发表或撰写过的研究成果,也不包含为获得东南大学或其它教育机构的学位或证书而使用过的材料。与我一同工作的同志对本研究所做的任何贡献均已在论文中作了明确的说明并表示了谢意。 研究生签名: 日期: 东南大学学位论文使用 授权声明 东南大学、中国科学技术信息研究所、国家图书馆有权保留本人所送交学位论文的复印件和电子文档,可以采用影印、缩印或其他复制手段保存论文。本人电子文档的内容和纸质论文的内容相一致。除在保密期内的保密论文和在技术保护期限内的论文外,允许论文被查阅和借阅,可以公布(包括以电子信息形式刊登)论文的全部内容或中、英文摘要等部分内容。论文的公布(包括以电子信息形式刊登)授权东南大学研究生院办理。 研究生签名: 导师签名: 日期: 摘要 目前工业市场上认证检测领域,业务流程陈旧繁琐,用户与检测机构无法便捷有效的沟通。除此之外,用户需要亲临检测机构实地送检,在检测的每一个环节用户也无法有效的进行追踪,这些都制约着认证检测领域的进一步发展。鉴于市场上用户的手机型号、种类、屏幕分辨率等参差不齐,传统方式根据主流系统分别开发相应的系统耗时又耗力,为了高效开发并节约开发项目成本,本文采用Android+HTML5相结合的方式进行移动端Web系统的设计研发工作。 然而,由于HTML5的W3C标准规范还未制定,安卓系统中类浏览器Webview自身存在一些局限性,因此仍存在着诸多问题亟需解决,包括:(1)多窗口类浏览器模式问题。安卓上用于加载的Webview视图窗口只是作为类浏览器而存在,在安卓上更是只能同时运行一个Webview。(2)跨域数据交互问题。不同的Webview之间无法共享数据。(3)页面自适应问题。页面难以兼容适应不同分辨率的设备和浏览器。 本文研究并设计了基于Android+HTML5的在线认证检测系统,主要工作包括以下四个方面: (1)针对多窗口类浏览器模式问题,指出并分析了该问题存在的原因,利用Activity的运行机制,通过Fragment栈对主要模块的Webview进行管理,实现对不同模块之间切换的控制。 (2)针对跨域数据交互问题,指出并分析了跨域缓存交互问题出现的原因,通过在HTML5存储技术的基础上,重写LocalStorage,用移动端本地的Sqlite进行数据维护,实现跨域数据交互。 (3)针对页面自适应问题,本文结合渐进增强以及拥抱流式布局的思想,同时研究利用了移动设备的视口特性,实现跨分辨率、跨设备的页面自适应。 (4)针对系统的功能实现问题,通过结合利用原生态框架与HTML5的跨平台性,实现了“认我测”在线认证检测系统。 综上所述,“认我测”在线认证检测系统,率先填补了认证检测领域移动端的空缺,提供了Web浏览器+移动端的双端访问模式,给用户提供了多种访问途径,真正实现了用户和检测机构的随时随地在线下单检测。 关键词:HTML5,检测与认证,Android,多窗口浏览器模式,跨域处理,页面自适应 Abstract At present business processes are old and explicit in industrial market of certification and detection filed, as well as users can not have effective and convenient communication with detection institutions. Apart from these, customers have to come to detection institutions personally to send samples, and they can not take effective trace of each process during detection. All of these limit the advanced development of certification and detection field. As the versions, types and resolution of users' mobile phones vary in current market, conditional ways depending on systems respectively cost extra time and resources. In order to develop efficiently and save cost of projects, this paper combines android with HTML5 to design and start the development of mobile web system. However, due to standard specification of W3C of HTML5 hasn't been drafted, and browser-alike webview in android has several limits itself, there are still many problems to be solved. Including: (1) Multi-window browser pattern. Webview window in android used to load pages just works like browser, as well as there is only one webview running at the same time. (2)Cross-domain data interaction. Different webviews can not share data. (3)Self-adaption of pages. It is difficult for pages to adapt to devices and browsers of different resolution. This paper researched and designed an online certification and detecting system based on Android and HTML5. Four main parts are included as following: (1) Considering multi-window browser problem, this paper pointed out and analysed reasons of it. The running mechanism of Activity was used cleverly and webiews of main modules were managed through Fragment stacks, in order to control the switch among different modules. (2)Considering cross-domain data interaction problem, reasons of it were pointed out and analysed. LocalStorage was overrided based on HTML5 storage technics, and local sqlite was used to maintain data in order to realize cross-domain data interaction. (3)Considering self-adaption of pages, the system combined the ideas of progressive enhancement and embracing flow layout, aiming at personalitites of mobile facilities viewports, and realized respective solution. (4)Considering the implementation of system functions, the system took the advanteges of native frameworks as well as HTML5 crossing platforms, and developed "Finding Me Detecting" online certification and detecting system. In summary, "Finding Me Detecting" online certification and detecting system filled up blanks of mobile market in certification and detecting field, provoding double side access pattern, that is to say web browser together with mobile side, offering users various ways to access the system, and really realized the goal of whenever and wherever ordering to detect for users and detecting companies. Keywords: HTML5; Quality Authentication; Android; Multi-window browser; Cross-domain data; Page self-adaption 专业名词清单 专业名词 名词解释 HTML5 万维网的核心语言、标准通用标记语言下的一个应用超文本标记语言(HTML)的第五次重大修改 Android 一种基于Linux的自由及开放源代码的操作系统,主要使用于移动设备,如智能手机和平板电脑,由Google公司和开放手机联盟领导开发 IOS 由苹果公司开发的移动操作系统 Webkit 一个开源的浏览器引擎,在手机上的应用十分广泛 Webview WebView(网络视图)能加载显示网页,可以将其视为一个浏览器。它使用了WebKit渲染引擎加载显示网页 Activity Activity是一个应用程序组件,提供一个屏幕,用户可以用来交互为了完成某项任务,是一个负责与用户交互的组件 SSH 为 Struts+Spring+Hibernate的一个集成框架,是目前较流行的一种Web应用程序开源框架。其中使用Struts作为系统的整体基础架构,负责MVC的分离,在Struts框架的模型部分,控制业务跳转,利用Hibernate框架对持久层提供支持,Spring做管理,管理Struts和Hibernate。 WebStorage HTML新增的本地存储解决方案之一 LocalStorage 本地永久性存储数据,除非显式将其删除或清空 SessionStorage 存储的数据只在会话期间有效,关闭浏览器则自动删除 Sqlite 一款轻型的数据库,是遵守ACID的关系型数据库管理系统,它包含在一个相对小的C库中 W3C 万维网联盟,创建于1994年,是Web技术领域最具权威和影响力的国际中立性技术标准机构。主要的工作是发展 Web 规范,这些规范描述了 Web 的通信协议(比如 HTML 和 XHTML)和其他的构建模块。 NativeApp 使用传统原生态Android SDK来实现的应用 WebApp 基于浏览器来实现的一种应用 HybridApp 一种可以下载的Native App,其用户界面的全部或者部分元素在嵌入式浏览器组件(WebView之类的)里面运行 优雅降级 一开始就构建站点的完整功能,然后针对浏览器测试和修复。认为应该针对那些最高级、最完善的浏览器来开发网站。而将那些被认为“过时”或有功能缺失的浏览器下的测试工作安排在开发周期的最后阶段 渐进增强 一开始只构建站点的最少特性,然后不断针对各浏览器追加功能。先让网站能够正常工作于尽可能旧的浏览器上,然后不断为它在新型浏览器上实现更多的增强和改进。 Viewport 移动设备上的Viewport就是设备的屏幕上能用来显示网页的一块区域,即浏览器上用来显示网页的那部分区域。Viewport不局限于浏览器可视区域的大小,可能比浏览器的可视区域要大,也可能比浏览器的可视区域要小。 媒体查询 CSS媒体查询允许开发者基于浏览网站的设备的特性来应用不同的样式申明,最常用的特性是视口宽度。 GCF 谷歌内嵌浏览器框架, 使用此插件,用户可以通过Internet Explorer的用户界面,以Chrome内核的渲染方式浏览网页。Chrome Frame 会把最新版的Chrome Webkit 内核和JavaScript 引擎注入到IE中, IE浏览器将获得Chrome的性能和功能 目录 摘要 I ABSTRACT II 专业名词清单 III 第一章 绪论 1 1.1 研究背景与意义 1 1.2国内外相关研究现状 2 1.2.1 在线认证检测平台开发现状 2 1.2.2 HTML5 3 1.2.3 Android 3 1.2.4 Android移动Web项目开发的三种解决方案:Native, Web和Hybrid优缺陷分析 4 1.2.5国内外应用现状 6 1.2.6 研究现状总结 7 1.3研究目标与内容 7 1.3.1多窗口浏览器模式的实现机制 7 1.3.2跨域交互即缓存处理方法 7 1.3.3页面自适应机制,即设备自适应与浏览器自适应机制 8 1.3.4 “认我测”质检服务平台的设计和实现 8 1.4 本文的结构安排 8 第二章 多窗口类浏览器设计 11 2.1 多窗口类浏览器需求分析 11 2.1.1 Activity简介 11 2.1.2 Fragment简介 11 2.1.3 多窗口类浏览器需求 12 2.2 多窗口浏览器模式的实现机制 12 2.2.1安卓移动端多窗口浏览器框架 12 2.1.2多窗口浏览器模式实现机制 13 2.3 模块实现 13 2.3.1类浏览器模式 13 2.3.2多窗口类浏览器模式 14 2.4 本章小结 15 第三章 跨域交互缓存处理设计 17 3.1 跨域交互缓存处理需求 17 3.1.1 缓存技术WebStorage 17 3.1.2 跨域交互缓存处理需求 17 3.1.3 页面回退管理需求 17 3.2 缓存处理机制 18 3.2.1 跨域缓存处理 18 3.2.2页面回退管理 18 3.3 模块实现 19 3.3.1跨域缓存机制的主要实现 19 3.3.2.页面回退管理的实现 22 3.4本章小结 22 第四章 页面自适应机制设计 23 4.1页面兼容策略 23 4.2 页面自适应策略 24 4.2.1设备自适应 24 4.2.2.浏览器自适应 25 4.3 模块实现 25 4.3.1根据适口属性设计响应式布局: 26 4.3.2同分辨率范围内的流式布局设计 26 4.3.3移动端viewport属性设定 27 4.3.4组件样式的渐进增强设计 27 4.4 本章小结 27 第五章 认我测在线检测服务系统设计 29 5.1认我测在线检测服务系统需求分析 29 5.2 系统时序流程 29 5.3 系统功能模块图 30 5.4 本章小结 32 第六章 认我测在线检测服务系统实现与测试 33 6.1认我测在线检测服务框架设计 33 6.2 系统运行环境搭建及配置 34 6.2.1 AndroidManifest.xml主程序环境配置 34 6.2.2 移动端工程资源布局 35 6.3 认我测在线认证检测系统的主要功能实现 36 6.3.1用户查询 36 6.3.2订单操作 37 6.3.3个人信息维护 37 6.4.系统功能测试 38 6.4.1 首页功能模块 38 6.4.2 订单功能模块 38 6.4.3 个人信息模块 39 6.4.4页面自适应 40 6.5 本章小结 41 第七章 总结与展望 43 7.1 工作总结 43 7.2 研究展望 44 致谢 47 参考文献 49 第一章 绪论 1.1 研究背景与意义 目前市场业务中在产品以及其他项目的认证和检测方面存在诸多不便,用户需要实地考察并频繁与检测单位沟通,填写繁琐的纸质检测报告、当面送递样品,对于检测环节中存在的问题难以及时交互并处理。市场上相应的检测平台诸如检测通、凡特网等皆为pc端检测网站,并且操作繁琐不够人性化,用户在实地使用中存在很多问题。昆山工业技术研究院着眼于为委托用户和质检机构搭建良好的沟通桥梁,免去目前市场业务中企业用户需要实地地并频繁地与检测机构沟通,从而提出自己的委托乃至下委托单、等待检测报告等,设计并研发了市场上首款提供质检服务的移动端app,即“认我测”质检服务平台系统,用户只需在手机上安装轻盈小巧的系统app,即可方便快捷的进行委托服务,质检机构亦可便捷地处理请求订单,双方都可以实时追踪委托订单的状态变化。 考虑到目前市场上用户的手机型号、种类、屏幕分辨率等参差不齐,传统方式根据主流系统(如android、ios)分别开发相应的系统耗时又耗力,为了高效开发并节约开发项目成本、提高项目开发效率,并迎合近年来新兴的HTML5移动页面开发技术,公司采用Android+HTML5相结合的方式进行移动端系统的研发工作。系统的主体一次开发即可在不同设备,包括不同系统、不同型号、不同分辨率设备上运行,免去了大量冗余的开发工作,提高项目的开发效率,降低项目的开发维护成本,为用户提供便捷服务。项目的封装框架只需根据系统的不同稍微改动定制即可,传统的多套系统项目现在只需一次开发,即可适应于不同机型。此外系统还可以通过微信公众号推广链接进行访问,大大的增强了系统的可扩展性和用户操作的便捷性。 然而,由于HTML5的W3C标准规范还未制定,安卓系统中类浏览器Webview自身存在一些局限性,使得结合安卓与HTML5开发移动web项目仍处在探索研发阶段,还不够成熟和完善,相应的技术支持也比较有限,因此仍存在着诸多问题亟需解决,包括: (1)多窗口浏览器模式问题。安卓用于加载的Webview视图窗口只是作为类浏览器而存在,并不等同于pc浏览器,在安卓上更是只能同时运行一个Webview,每次加载新的页面都只能覆盖掉原先的页面,无法达到网页浏览器的多窗口模式。通过常规的pc浏览器窗口的相应open、close进行新增窗口、关闭窗口等操作,在Webview类浏览器窗口中都无法正常运作,甚至会导致Webview失去响应。为此,需要研究相应的解决方案,用于模拟用户适应的网页多窗口浏览器模式。(2)跨域交互问题,即缓存机制与浏览记录管理问题。不同于网页浏览器,用户的数据可以在不同的窗口之间共享,Webview由于其模块之间无法共享数据的机制为保存用户信息以及共享其他程序数据带来了巨大难题。为此需要区分数据是同模块内部共享还是跨域共享访问,并提供相应的解决方案。Webview通过模拟多窗口浏览器模式运作后,在不断的新开页面以及不同模块之间互相切换,会导致页面回退时历史浏览地址发生覆盖,使得不同模块无法回到相应的上级页面,为此需要有效的对页面的浏览历史进行管理,并提供切实可行的方案。(3)页面自适应问题,即设备自适应与浏览器自适应问题。针对移动设备繁杂的屏幕分辨率,如何让页面进行分辨率自适应,从而发挥相对于原生态安卓开发的优势,是一个需要探索和解决的问题。考虑到高效开发设计以及便于推广应用,HTML5的界面不仅仅需要适应基于Webkit内核的Webview,还要能够方便的应用于PC端的网页,如何让HTML5的网页能够适用不同的浏览器内核,也是一个亟待解决的问题。 为此,如何使得“认我测”质检服务平台中安卓与HTML5的结合开发满足多浏览器模式,并解决跨域之间的数据交互问题,同时提高页面的设备自适应和浏览器自适应能力,成为跨平台移动web项目高效开发所亟待解决的问题。 1.2国内外相关研究现状 1.2.1 在线认证检测平台开发现状 互联网界目前在检测领域存在部分在线检测认证的平台,诸如华强认证、检测通等,可以为用户提供一些简单的检测申请,以及为检测机构提供平台发布相关信息。 图1.1 华强认证检测平台首页 如上图所示,在华强认证平台上用户可以选择认证或者检测服务,针对相应类型进行筛选。根据待检测的种类不同,选择相应的检测机构资质、证书、检测周期等查询结果,根据查询结果选择检测机构进行检测委托。检测机构与平台合作,提供负责的检测服务项目、价格等信息,在平台上开设个人站点,提供数据给平台,用于用户检索。 与时下常见的电商网站类似,此类检测平台都提供检测方设计自己的网站主页以出售检测服务,同时为用户提供检索结果、显示可购买的检测服务,用户可以选择质检服务并加入购物车、下单、查看检测方详情、与卖家(检测方)沟通检测细节等操作,但是这些平台都存在着共同的问题——流程不够清晰明了、检测服务不够个性化、用户操作繁琐等,这些问题给用户和检测机构的使用以及交流带来了很多不便。平台提供的检测项目有限,很多时候用户无法确定自己需要检测的项目所属,也不能有效地与检测方进行沟通。与此同时,认证检测领域对于移动端的涉及基础为零,目前主流移动端市场没有相应的认证检测服务产品,随着移动产品愈发便捷,在移动端研发设计相应的认证检测产品,使得用户可以随时随地进行下单咨询变得愈发重要。 1.2.2 HTML5 为了方便用户的使用,“认我测”认证检测平台的PC端基于B/S架构,其设计和研发离不开浏览器内核支持,同时移动端的Web开发也同样需要HTML5语言的支持。利用HTML5的崭新特性,能够更好地为用户提供服务。 HTML5是用于取代1999年所制定的HTML4.01和XHTML1.0标准的HTML(标准通用标记语言下的一个应用)标准版本;现在仍处于发展阶段,但大部分浏览器已经支持某些HTML5技术。HTML5有两大特点:首先,强化了Web网页的表现性能。其次,追加了本地数据库等Web应用的功能。 HTML5广义上为包括HTML、CSS和JavaScript在内的一套技术组合。减少浏览器对于需要插件的丰富性网络应用服务,如Adobe Flash、Microsoft Silverlight与Oracle JavaFX的需求,并且提供更多能有效增强网络应用的标准集。目前HTML5已向开发人员提供了很多新的标签,如section,nav,article,header和footer等。这些标签语义化程度高,被广泛使用。 HTML5逐渐为移动Web开发所采纳,主要原因在于其适用移动项目开发的八大特性,即离线缓存、音频视频自由嵌入、地理定位、Canvas绘图、丰富的交互方式、低开发维护成本、CSS支持以及调用手机硬件。其中离线缓存可以看做是加强版的cookie,不受数据大小限制,有更好的弹性以及架构,可以将数据写入到本机的ROM中,还可以在关闭浏览器后再次打开时恢复数据,以减少网络流量。音频视频方面HTML5无需拆分开混排的多媒体内容,可以将文字、图片、音频、视频等放在一起进行处理。HTML5提供地理定位的支持,无需专属导航软件,通过缓存即可加载地图数据,方便灵活。在系统开发和维护方面,打开即可使用最新版本,免去重新下载升级包的麻烦,使用过程中就直接更新了离线缓存。除此之外,HTML5增强了对CSS样式的支持,极大的增强了界面的美化和友好性,提高了用户体验。 1.2.3 Android Android是一种基于Linux的自由及开放源代码的操作系统,主要使用于移动设备,如智能手机和平板电脑,由Google公司和开放手机联盟领导及开发。Android操作系统最初由Andy Rubin开发,主要支持手机。2005年8月由Google收购注资。2007年11月,Google与84家硬件制造商、软件开发商及电信营运商组建开放手机联盟共同研发改良Android系统。随后Google以Apache开源许可证的授权方式,发布了Android的源代码。2011年第一季度,Android在全球的市场份额首次超过塞班系统,跃居全球第一。 2013年的第四季度,Android平台手机的全球市场份额已经达到78.1%。 Android是一个真正意义上的开放性移动设备综合平台。它包括操作系统、用户界面和应用程序-移动电话工作所需的全部软件,而且不存在任何以往阻碍移动产业创新的专有权障碍。通过与运营商、设备制造商、开发商和其他有关各方结成深层次的合作伙伴关系,来建立标准化、开放式的移动电话软件平台,在移动产业内形成一个开放式的生态系统,这样应用之间的通用性和互联性将在最大程度上得到保持。 在开发之初,Android平台就被设计成一个由一系列应用所组成的平台。所有的应用都运行在一个核心的引擎上面,这个核心引擎其实就是一个虚拟机,它提供了一系列用于在应用和硬件资源间进行通讯的API。Android打破了应用之间的界限,开发人员可以把Web上的数据与本地的联系人、日历、位置信息结合起来,为用户创造全新的用户体验。此外应用程序不仅可以通过标准API 访问核心移动设备功能、互联网,应用程序还可以声明它们的功能供其他应用程序使用。 考虑到移动端市场主流操作系统的使用情况、移动领域的发展趋势以及Android操作系统的开源性,系统采用Android操作系统为研究对象,在其基础上进行设计和研发,使得认证检测产品能够为主流用户所使用,为用户带来便捷。 1.2.4 Android移动Web项目开发的三种解决方案:Native, Web和Hybrid优缺陷分析 Native app是用传统原生态Android SDK来实现的应用;Web app是基于浏览器来实现的一种应用。 Hybrid app是一种可以下载的Native App,其用户界面的全部或者部分元素在嵌入式浏览器组件(WebView之类的)里面运行。对用户来说,Hybrid App与Native App很难区别。二者都可以从应用程序商店或市场下载,存放在移动设备上,运行方式完全如同其他任何应用程序。但是对开发者来说,却存在巨大的差异,因为其无需为每一种移动操作系统从头开始重新编写应用程序,而是只要用HTML、CSS和JavaScript编写其中一部分应用程序代码,即可在多个设备上重复使用。 以下是三种技术各自的优缺点。 Native app Web app Hybrid app 系统特性 可以完美发挥系统特性(调用系统服务、内存管理等); 操控设备硬件(如相机、蓝牙、振动器等) 无法充分发挥系统特性(调用系统服务、内存管理等); 无法操控设备硬件(如相机、蓝牙、振动器等) 可以发挥大部分系统特性(调用系统服务、内存管理等); 可以通过JavaScript API操控设备硬件(如相机、蓝牙、振动器等) 用户体验 可提供最佳的用户体验,最优质的用户界面,最华丽的交互; 支持消息推送 用户体验较差; 图片和动画支持性不高; 不支持消息推送 可提供较好的用户体验; 支持消息推送 本地资源 可访问本地资源 不支持访问本地资源 可访问本地资源 应用更新 获得新版本时需重新下载应用更新,不够方便 跨平台开发、用户不需要下载安装App,开发速度快 可以下载新应用更新,也可在线更新 适用场景 适合制作游戏等性能要求比较高的应用 对于对界面的灵活性有较高要求的app 适用于对画面表现特别高以外的主流需求 开发成本 各平台不兼容,多平台的开发、移植比较复杂,开发成本高,开发周期长,开发成本高; 维护多个版本的成本比较高; 针对多种设备(不同分辨率、不同硬件配置等)的调试和适配较麻烦,维护成本高; 纯HTML5快速开发,较低的开发成本; 支持设备广泛,基于浏览器,跨平台性,维护成本低; Native+HTML5 针对不同系统制定系统外壳,页面部分可重用,大大降低开发成本; 可直接在线更新,更新成本低; 跨平台性,无需针对不同平台开发多个版本应用。 网络要求 支持离线使用 非常依赖网络,网络不稳定等其他环境时,用户请求页面的效率大打折扣 大部分功能依赖网络 考虑到系统需要提供较好的用户体验、用户与检测机构能够利用消息推送进行实时沟通、用户的查询和下单操作默认已具备网络环境等因素,因此为了更好地利用移动端本地硬件支持以及实现跨平台、跨设备的开发,系统采取了Hybrid混合开发模式。通过在原生态框架中嵌入Webview类浏览器,主体页面采用HTML5开发,由原生态定制系统框架,这样在更换移动端操作系统时,只需相应更换系统外壳,主体部分可以重复利用,极大地减少了研发成本,提高了系统的可复用性。系统主体部分更新时,无需在应用市场中重新下载,应用HTML5的特性在线更新缓存即可方便地获取最新版本,为用户带来了便捷。 1.2.5国内外应用现状 图1.2 智能手机操作系统分布数据 市场调研公司Kantar Worldpanel ComTech发布的智能手机操作系统数据显示,截至2016年2月末的三个月内,Android中国城市的销售份额从去年同期的73%增至76.4%。而在美国和欧洲五大市场(包括英国、德国、法国、意大利和西班牙),Android的市场占比继续保持增长态势。因此系统选取市场移动端主流操作系统Android作为基础,进行移动端认证检测产品的研发和设计。 随着移动浪潮的兴起,各种APP层出不穷,极速的业务扩展提升了团队对开发效率的要求,这时使用IOS&Andriod开发一个APP的成本相对过高,而HTML5的低成本、高效率、跨平台等特性马上被利用起来形成了一种新的开发模式:HybridAPP。 作为一种混合开发的模式,Hybrid APP底层依赖于Native提供的容器(UIWebview),上层使用Html&Css&JS做业务开发,底层透明化、上层多多样化,这种场景非常有利于前端介入,非常适合业务快速迭代。Hybdrid作为目前主流的移动端开发设计模式,能够极大的利用Native和HTML5的优势,将性能与用户体验相结合,缩短跨系统的产品研发周期,给用户和研发都带来极大的便利。混合型APP软件兼具“原生型APP软件良好用户交互体验的优势”和“网页型APP软件跨平台开发的优势”。市场上一些主流移动应用都是基于混合型APP软件的方式开发,比如工商银行、百度搜索、街旁、东方航空、微信、去哪儿等。 目前已有众多企业采用混合型APP软件技术开发APP应用,一方面是开发简单,另外一方面可以形成一种开发的标准。企业封装大量的原生型的原生插件如支付功能插件供Java调用,并且可以在今后的项目中尽可能的复用,从而大幅降低开发时间和成本。混合型APP软件的标准化给企业移动应用开发、维护、更新都带来了极高的便捷性。 混合型APP软件通常是基于第三方跨平台移动应用引擎框架进行开发,在国内开发者中比较知名的有PhoneGap、Titanium和AppCan。这些引擎框架一般使用HTML5和Java作为编程语言,调用引擎封装的底层功能如照相机、传感器、通讯录、二维码等。HTML5和Java只是作为一种解析语言,真正调用的都是原生型APP软件一样封装的底层功能,这是和网页型APP软件的最大区别和不同。因为使用了浏览器技术,所以混合型APP软件通常具有跨平台的特性,并且开发成本和网页型APP软件接近,开发效率也远高于原生型APP软件。根据国际科技媒体ReadWriteWeb 2015数据统计显示,截至2015,有80%的App全部或部分基于HTML5研发。大部分的App内容以网页的形式呈现,包括微信、Facebook、Twitter等。为此,Hybrid混合模式成为“认我测”在线检测服务平台移动端框架的开发和设计依赖。 尽管微信通过公众号的形式,使得Android+HTML5模式得以应用并推广,这项技术目前仍不够完善,利用web实现移动app存在一些瓶颈。(1)根据百度移动互联网发展趋势报告,iPhone下载一个1.407k的网页,建立连接耗时1.35s左右,传输耗时0.15s左右。这样,导致app在建立连接的时候,屏幕处于白屏状态。app在一秒多的时间内,完全处于白屏状态,加上3G、GPRS网络的不稳定,有时候等待app响应需要几秒甚至1几秒的时间,对于mobie app来说,这是个致命的缺陷。(2)难以实现本地存储。基于Android存在多版本系统,Android低版本中的Webkit对HTML5和CSS3不能够很好地支持。常用的HTML5向后兼容方案是通过Javascript+CSS+Html来模拟HTML5的一些特性,但过多的js存在于移动app中会得不偿失。 Android+HTML5的混合开发模式对于移动端Web项目开发已经成为市场的主流和趋势,与此同时这项技术还存在着一些问题,需要不断的进行改进和完善。 1.2.6 研究现状总结 总而言之,Android操作系统在移动市场仍居主流,HTML5也为用户带来崭新的特性,Hybrid混合开发模式也逐渐成为移动Web开发的主流设计模式,大量的市场应用都成功的应用和推广了Android+HTML5。正是在这种背景下,“认我测”在线认证检测系统率先填补了移动端认证检测领域的产品空缺,采取了Hybrid混合开发模式。同时,利用Android+HTML5相结合开发移动端Web项目尚处于应用阶段,仍然存在很多问题,还不够成熟和完善。如何将这二者更有效的结合使用,并解决过程中存在的问题,提高项目开发的效率以及节约开发成本,是一个需要研究探索的问题,这也是本课题的意旨。 1.3研究目标与内容 1.3.1多窗口浏览器模式的实现机制 深入挖掘Webview作为类浏览器视图窗口与传统PC端浏览器的区别,针对安卓端同一视图区域单一运行Webview的特性,通过在原生态安卓中启用Fragment视图加载不同视图页面,在外部Activity中对Fragment进行管理控制。同时调整窗口加载及操作模式,适应移动端相关操作从而实现程序中加载多个Webview视图窗口并可以随意切换,实现类浏览器多窗口加载资源并交互的模式。 1.3.2跨域交互即缓存处理方法 针对Webview不支持多窗口间跨域访问的问题,重写缓存处理方式以替代网页端会话级缓存机制,模拟web端本地存储localStorage对本地缓存的处理方法,诸如setItem()、getItem()、removeItem()以及clear(),通过将持久化数据存储在移动端本地数据库来模拟网页端数据持久化存储,实现多Webview间跨域交互访问以及缓存数据保存和处理。 通过维护Webview的历史栈,根据需求进行过滤跳转或者重新加载页面。若当前为重定向后的链接,那么回退的时候就需要忽略上一级的链接,不使用Webview自带的回退方法goBack(),相对地移除重定向和重定向后的url,获取到初始页面链接后自行进行loadUrl()操作. 1.3.3页面自适应机制,即设备自适应与浏览器自适应机制 利用Viewport来控制页面的缩放比例、页面的初始大小,针对不同分辨率的移动设备实现网页页面自适应。通过渐进增强以及优雅降级机制来控制不同版本、不同浏览器之间的兼容问题,以及利用JavaScript库辅助修正相应的样式问题,从而实现浏览器适配的机制。 1.3.4 “认我测”质检服务平台的设计和实现 移动客户端通过安卓与HTML5结合开发设计委托方和质检方app,通过原生态安卓框架外壳嵌入Webview渲染加载页面,添加Java接口与消息会话模块,通过移动端Sqlite操作数据重写localStorage来实现缓存机制,利用Fragment视图层控制Webview的切换与运行来展现主要的功能模块—委托方App:首页模块、订单模块、消息模块和个人模块;质检方App—订单模块、消息模块和个人模块。 服务器端采用J2EE的SSH框架搭建项目,通过微信公共账号链接Html页面,为用户提供多种系统访问途径,增强了系统的可扩展性,为用户带来便利。 1.4 本文的结构安排 本文共分为七个章节。 第一章是绪论部分,介绍课题的研究背景,指出课题的研究意义。然后通过对HTML5研究、Android移动Web开发技术研究以及Hybrid开发问题研究来介绍该课题在国内外的研究现状。最后说明本文的研究目标与内容,以及论文的结构安排。 第二章介绍多窗口类浏览器模式策略的设计与实现。针对现有移动端单一窗口存在的不足,提出类浏览器多窗口解决方案,并对多窗口浏览器模式进行设计 第三章其次分析Webview的跨域数据交互问题,针对移动端类浏览器内核不支持跨域数据访问的不足,提出本地持久性存储替代web端缓存的解决方案,并对跨域访问模式进行设计。同时分析了页面重定向导致的页面无法正常访问问题,提出采用页面浏览历史栈的管理方案,针对回退时目标页面解析进行相应操作。 第四章是多分辨率多设备页面自适应策略设计。首先分析现有Web页面在移动端不同分辨率和设备显示存在的问题,针对页面难以在不同设备上保持兼容适应的不足,提出页面自适应解决方案,并通过渐进增强以及媒体查询等方式进行设计。 第五章是认我测系统的设计,包括系统的功能需求分析、业务流程展示以及功能模块设计。 第六章是系统的功能测试,介绍了相关的实现环境与工具,并对系统的主要功能模块以及主要解决方案进行了功能验证测试。 第七章是总结展望部分,总结本文的主要工作内容与创新点,并对本文写作与实验过程中的不足及后续研究进行展望。 第二章 多窗口类浏览器设计 2.1 多窗口类浏览器需求分析 2.1.1 Activity简介 在Android中一个Activity是一个应用程序组件,它提供一个屏幕,用户可以为了完成某项任务用来交互,例如拍照、拨号、看地图、发送邮件等。每一个Activity被系统给予一个窗口,在该窗口上面可以绘制用户接口。一个应用程序通常由多个Activities组成,他们通常是松耦合关系。通常首次启动应用程序的时候呈现给用户的Activity被指定为"Main Activity”。为了完成不同的动作,每一个Activity可以启动另一个其他的Activity。一个新的Activity启动,前一个Activity就被终止了,但是系统将Activity保存在一个栈上。当一个新Activity启动,它被推送到栈顶,取得用户焦点。栈的管理符合“后进先出”原则,所以,当用户完成当前Activity然后点击back按钮,它被弹出栈并且被摧毁,然后恢复之前的Activity。 若一个Activity因新的Activity启动而停止,系统通过Activity的生命周期回调函数,通知其这种状态转变。一个Activity根据它自己的状态变化可能会收到许多回调函数的通知信息,诸如系统创建、停止、恢复或者摧毁Activity,每个回调都使得开发者得以完成相应状态的指定工作。例如,当停止Activity的时候,应该释放所有大的对象,如网络数据库连接。当Activity恢复时,开发人员可以重新获得必要的资源和恢复被中断的动作。这些状态转换都是Activity的生命周期的组成部分。 2.1.2 Fragment简介 Android 3.0中开始引入Fragments 的概念,可以称为:碎片、片段。其目的是为了解决不同屏幕分辨率下动态和灵活的UI设计,大屏幕如平板、小屏幕如手机。平板电脑的设计使得其有更多的空间来摆放更多的UI组件,而多出来的空间存放UI使得这些组件会产生更多的交互,从而诞生了Fragments。 Fragments 的设计不需要开发者来亲自管理视图层的复杂变化,通过将Activity 的布局分散到Fragment 中,可以在运行时修改Activity 的外观,并且由Activity 管理保存其变化。当一个片段指定了自身的布局时,它能和其他片段配置成不同的组合,在活动中为不同的屏幕尺寸修改布局配置。小屏幕可能每次显示一个片段,而大屏幕则可以显示两个或更多。Fragment是Activity的界面中的一部分或一种行为。可以把多个Fragments组合到一个Activity中来创建一个多面界面并且可以在多个Activity中重用一个Fragment。除此之外,可以把Fragment认为是模块化的一段Activity,它具有自己的生命周期,接收它自己的事件,并可以在Activity运行时被添加或删除。 Fragment不能独立存在,它必须被嵌入到Activity中,而且Fragment的生命周期受到所在的Activity的影响。当Activity暂停时,它拥有的所有的Fragments都被暂停;当Activity销毁时,它拥有的所有Fragments都被销毁。然而,当activity运行时(在onResume()之后,onPause()之前),可以单独地操作每个Fragment,比如添加或删除它们。在执行上述针对Fragment的事务时,可以将事务添加到一个栈中,这个栈被Activity管理,栈中的每一条都是一个Fragment的一次事务。有了这个栈,就可以反向执行Fragment的事务,这样就可以在Fragment级支持“返回”键(向后导航)。 2.1.3 多窗口类浏览器需求 在Android中展现在用户面前的Activity同时只能存在一个,而由于类浏览器内核Webkit的特性,一个Activity中同时只能加载一个Webview用以渲染网页,如果用户想模仿Web浏览器新增一个浏览器标签窗口打开新页面,只能将原来的网页覆盖掉,无法在窗口间来回切换,用户也无法保持原有的浏览器使用习惯。为此,需要利用Activity栈的切换特点,将系统的主要模块分别设计在不同的Fragment上,通过各自的Webview进行加载渲染,在用户需要切换窗口时,通过管理切换Fragment达到目的的实现。 2.2 多窗口浏览器模式的实现机制 2.2.1安卓移动端多窗口浏览器框架 图2.1 多窗口浏览器模式系统框架图 如图4所示,系统安卓移动端由首页、订单、消息以及个人信息四个模块构成,每个模块对应一个视图层Fragment,在安卓Activity运行时一次加载一个视图Fragment,通过底部的原生态菜单栏BottomBar进行视图之间的切换。每个视图Fragment对应同一个位置的Webview类浏览器窗口,通过Webview加载所需要的页面,通过外部的Fragment对Webview的加载以及切换进行控制,从而实现类浏览器多窗口模式。 2.1.2多窗口浏览器模式实现机制 多窗口浏览器模式的实现原理为:安卓外部Activity控制视图层Fragment的加载和切换,Fragment内部加载和控制Webview对页面的渲染,同时调整Web端页面的窗口打开和关闭模式,通过页面重定向进行打开和关闭返回。 多窗口浏览器模式解决两个问题,一是安卓中的类浏览器窗口模式,二是浏览器多标签模式。在移动端的页面加载过程中,类浏览器内核Webview的运行机制为覆盖加载页面,一次运行期间只同时存在一个Webview,与PC端浏览器的运行模式不同,无法通过open打开一个新的浏览器标签页,也无法通过close关闭单个的标签页。为此需要通过loadUrl进行页面重定向,在关闭页面时通过loadUrl反重定向或者通过Webview本身的goBack方法进行回退。移动端的Webview在全局意义上等价于PC端的浏览器,但是通过close关闭的不是一个窗口,而是关闭了整个浏览器。安卓中Activity运行时只能加载一个Webview,因此无法同时展现不同的页面,为此需要通过外部对Webview序列的控制,模拟多窗口显示页面的模式。 在安卓Activity的视图View初始化过程中,实例化需要首次显示的视图层fragment (如首页),将其放入实例化的视图层管理容器HashMap,并通过changeFragmentFrom Menu方法控制用户对视图层Fragment的切换,将原有的视图层置为等待恢复状态,并激活新的视图层用以在Activity中展现,通过changeFragmentBack控制用户通过回退操作唤醒的首页视图层,以此来控制不同视图层,即类浏览器窗口之间的切换。在相应的Fragment视图层中,初始化视图InitView时渲染加载Webview,同时控制底部的菜单栏,通过Webview加载相应的本地网页或服务器端网页,设置Webview相应的属性进而控制页面由Webview加载,而非默认的系统浏览器加载。为Webview绑定页面与原生态安卓相交互的接口,从而可以在加载的页面内调用安卓的原生态功能。 2.3 模块实现 2.3.1类浏览器模式 该部分主要为安卓中通过Webview渲染加载网页的过程。主要包含以下过程: Fragment布局文件中声明控件Webview,绑定其资源ID,为Webview设置宽度和高度。 (1)在Fragment视图初始化initView部分,利用findViewById()通过资源ID获取到Webview控件,对其进行初始化,同时设置相关的webSettings属性,让Webview可以运行JavaScript脚本以及能与本机数据库进行交互。 (2)重写WebViewClient的shouldOverrideUrlLoading()函数,让应用程序的Webview直接加载网页内容,而不调用外部的浏览器。 (3)重写Webview网页对话框,构建一个Builder用以显示网页中的对话框,在点击确定按钮之后,继续执行网页中的操作,同时关闭Builder对话框。 (4)为JavaScript创建安卓接口。通过addJavaScriptInterface为Webview绑定底层Java接口,同时提供相应的接口方法名以及在页面中可以调用的句柄名称,通过该句柄和方法名,即可在Html5页面的JavaScript中访问该底层的Java方法,实现对页面上部和底部的系统外壳的展示管理。 (5)通过loadUrl进行对目标页面的渲染加载,可以加载访问服务器端的页面,也可访问放置在项目内部的页面文件,该模式需要将相应页面放置于系统的assets目录下。相对而言服务器端页面更加常用,也便于维护。 2.3.2多窗口类浏览器模式 图2.2 多窗口类浏览器模式原理图 (1)创建各个主功能模块的视图类Fragment,分别为主界面模块HomeFragment、订单模块OrderFragment、聊天咨询模块MessageFragment以及个人中心模块PersonalFragment,继承自基类BaseFragment。 (2)每个Fragment视图类中声明并初始化相应的Webview组件,对其进行属性设置,为其绑定JavaScript接口并覆盖渲染加载页面的方法,绑定相应的需要在页面调用的底层Java方法接口。重写默认的页面回退响应事件,对页面访问历史以及目标访问页面进行过滤判断,执行相应的处理方法。 (3)在MainActivity的初始化initView中声明并初始化Fragment管理容器HashMap,初始化主页视图HomeFragment并将其加入容器,设置其为默认加载视图。获取FragmentManager用以维护管理Fragment队列,调用beginTransaction方法开启事务。 (4)重写回退按钮响应事件。当页面回到各自模块的初始页面然后按下回退键时,判断当前模块所在的Fragment,由主页模块后退时,执行确认退出系统操作,若从其他模块进行后退,则回到主页模块。通过底部菜单栏setRadioChecked方法设定当前模块的选中标识。 (5)重写模块间切换的方法changeFragmentFromMenu,开启事务,对模块标识ftag进行判断操作,根据用户点击的模块图表将相应的模块视图Fragment通过onResume()进行恢复,同时通过show()将该模块进行展示,从Fragment管理容器中将主页模块以外的Fragment移除。将带有oflag暂停标识的Fragment视图进行暂停处理,通过hide隐藏取消该视图的展示。 (6)在各自的Fragment模块视图类中重写onResume方法,用以在模块恢复时进行用户是否登录判断。对Webview渲染加载的页面进行分析,判断是否包含index初始页面标识。根据flag标识进行是否需要登录操作,flag为1表示从其他Fragment跳转到该模块的Fragment视图并需要用户登录。 以上就是多窗口类浏览器模式的实现主要环节,通过Webview加载渲染服务器资源页面,控制碎片视图Fragment展现各自模块的Webview,在MainActivity对碎片容器以及碎片视图之间的切换进行管理控制,从而完成多窗口类浏览器模式的实现。 2.4 本章小结 本章分析并介绍了安卓中Activity的基本性质,对碎片视图Fragment进行了相关阐述和引出,综合分析了多窗口类浏览器模式的设计需求。随后对多窗口类浏览器模式的框架进行了设计,通过Activity运行管理Fragment的加载和切换,各个模块的Fragment视图独自加载运行相应的Webview,补充和完善不同模块之间切换和回退的业务逻辑。在模块实现部分详细描述了两个关键部分的实现环节,即类浏览器模式和多窗口类浏览器模式,介绍了过程中主要用到的方法以及实现思想。 第三章 跨域交互缓存处理设计 3.1 跨域交互缓存处理需求 3.1.1 缓存技术WebStorage 图3.1 WebStorage示意图 WebStorage 使得网站能够把信息存储到本地的计算机上,并在以后需要的时候进行获取。WebStorage和Cookie类似,区别在于WebStorage是为了更大容量存储而进行设计。Cookie的大小是受限的,并且每次当请求一个新的页面的时候,Cookie都会被发送过去。而WebStorage则存储在计算机上,网站在页面加载完毕后可以通过Javascript来获取这些数据。 WebStorage提供两种类型的API:localStorage和sessionStorage,区别在于localStorage是本地永久性存储的数据,除非显式将其删除或清空,否则将一直保存在本地。sessionStorage存储的数据只在会话期间有效,关闭浏览器则自动删除。两个对象都有共同的操作API。 3.1.2 跨域交互缓存处理需求 WebStorage存储技术针对的是同一个类浏览器Webview,系统在各模块之间由不同的Webview加载渲染,通过不同的Fragment进行管理,因此模块之间无法共享数据。然而通过多窗口浏览器模式构建的系统模块之间经常需要进行数据交互,如用户登录信息以及产品相关信息,Webview由于其特性仅支持自身内部的缓存数据交互。同Webview内不断的覆盖加载新页面以及发生页面回退时可以对缓存数据提供便捷高效的数据保存,使得在页面加载的过程中可以便利的处理需要交互的数据;相对的不同的Webview之间无法共享数据,无论是会话级缓存还是持久化缓存。为此需要重写web端的持久化存储localStorage,将交互的数据保存到移动设备本地数据库。 3.1.3 页面回退管理需求 对于初始页面为A,点击某个链接跳转到B(http://xxx.com.cn/),B页面重定向到C页面(http://xxx.com.cn/website/index.Html),当调用webview.goBack()时,页面回退到B,然后接着会重定向回C页面。这样会导致两个问题:无法回退到Webview的初始页面A以及无法正常退出Activity或者Fragment(只有还未加载完C时进行回退才能退出页面)。为此需要引入历史记录栈,对页面访问历史进行管理,在回退事件中判断该加载页面是否需要重定向并执行相应的操作。 3.2 缓存处理机制 3.2.1 跨域缓存处理 在移动端数据库Sqlite操作类LocalStorage中定义相应的数据库连接属性、创建和更新的操作以及数据库操作单例Instance,在视图访问基类BaseFragment中定义覆盖web端持久化存储localStorage的核心交互类LocalStorageJavascriptInterface。获得数据库操作单例,并覆盖localStorage对缓存的常用处理方法取值getItem(),修改值setItem(),删除值removeItem()以及清空缓存clear()。将页面上获得的数据键值对存入数据库,对其进行更新删除以及返回给页面使用。在Webview初始化时进行页面与后台交互绑定addJavaScriptInterface,并在页面初始化init过程中将页面的默认localStorage操作更换成覆盖重写的方法,即可在页面进行跨域访问时交互相应的数据。 跨域交互的缓存处理机制如图5所示: 图3.2 缓存处理机制原理图 3.2.2页面回退管理 安卓的回退按钮一般用于返回上一级菜单,不过在浏览器页面加载过程中却不能理想地返回上一级页面,默认的回退按钮是针对Activity的回退,对于Webview来说,回退按钮会致使浏览器调用finish()而结束自身的运行,因此需要覆盖Activity的onKeyDown()事件,在方法内部重新对浏览页面进行管理。 在页面的新建关闭以及重定向时,Webview的页面回退goBack()会受到干扰,不能正常回到前一个页面,甚至会发生前后两个页面间来回切换后退的死循环,并影响模块间的后退返回。为此需要对历史访问页面进行管理,采用如下实现方案。 在Fragment视图声明时定义一个用于管理保存历史浏览记录的历史栈ArrayList,将系统初始加载界面加入列表。在此后的页面加载过程中,每次加载页面都将其加入历史栈,在系统回退响应事件中,判断页面是否为重定向页面,如果为重定向页面,则移除历史栈中最后两个链接,加载操作后历史栈的最后一项;否则移除历史栈中最后一项,加载操作后历史栈的最后一项。 页面回退方案的流程图如图3.3所示: 图3.3页面回退管理机制图 3.3 模块实现 3.3.1跨域缓存机制的主要实现 图3.4 重写LocalStorage类示意图 (1)重写LocalStorage类。让LocalStorage继承自SQLiteOpenHelper类,声明LocalStorage对象实例以及其他数据库连接配置信息,如数据表名称、表中存储的数据Id与值Value、数据库名称、创建数据库语句等。通过Singleton单例模式维护LocalStorage实例,重写创建数据库和更新的相关操作。 (2)添加LocalStorage的底层JavaScriptInterface,供服务器资源页面进行访问。通过LocalStorageDBHelper对象获取到单例localStorage,声明上下文对象和SQLiteDatabase对象。重写HTML5存储技术LocalStorage的关键缓存数据操作方法getItem()、setItem()、removeItem()以及clear()。 图3.5 重写WebStorage核心方法示意图 1.重写getItem(),根据传入参数key获取相应的value值 ①判断传入的key是否为空。 ②若key不为空,通过localStorageDBHelper的getReadableDatabase()方法实例化数据库对象database。执行sqlite的数据库查询操作,返回数据库结果操作游标。 ③根据游标的moveToFirst判断查询结果是否为空,返回相应的value结果。关闭数据库连接。 2.重写setItem(),根据传入的参数key和相应值value更新数据库 ①判断传入的key和value是否为空,通过getItem()获取更新前的值。 ②实例化数据库对象database。声明ContentValues对象并将key和value相应赋值。判断更新前和key对应的值是否存在,若存在执行数据库的更新操作;若不存在,执行数据库的插入操作。关闭数据库。 3.重写remove() ①判断传入的key是否为空 ②实例化数据库操作对象,执行相应的数据库删除操作,关闭数据库 4.重写clear() 实例化数据库操作对象,执行数据库删除操作,清空整张数据库表。 在Fragment视图中初始化Webview时,通过addJavaScriptInterface为其绑定重写的底层LocalStorage操作接口,并将操作句柄设置为localStorage。设置webSettings属性,通过setDomStorageEnabled与setDatabaseEnabled启用本地存储功能。 在服务器资源页面JavaScript方法中,尝试用句柄LocalStorage替换window默认的localStorage。若发生异常,说明LocalStorage没有被添加至webview。然后即可像通常HTML5的localStorage对缓存数据进行操作。 3.3.2.页面回退管理的实现 (1)在MainActivity中覆盖模块间的回退响应事件。当模块页面回退至各自的初始页面时,点击回退按钮执行相应的模块切换策略,若该模块为主界面模块,则弹出退出系统确认框供用户选择是否退出;若为其他模块则将菜单栏切换到首页模块。 (2)在各自的Fragment中覆盖模块内部的回退响应事件。在页面初始化时定义并维护一个存放历史访问页面的历史栈loadHistoryUrls (ArrayList),把初始页面url加入到历史栈中,在覆盖加载方法shouldOverrideUrlLoading中将待渲染加载的页面加入到历史栈中。 (3)在Fragment内部的回退事件处理方法中,判断是否可以执行返回操作。然后判断历史栈存存放页面的前一页是否包含初始重定向页面,若包含该页面则移除加载栈中的最后两个链接,否则移除加载栈中的最后一个链接。最后加载重定向之前的页面。 3.4本章小结 本章首先分析了HTML5标准下缓存处理策略WebStorage,其包含本地存储LocalStorage与会话存储SessionStorage,并提供了相应的介绍和说明。然后分析了跨域数据交互问题问题存在的原因以及页面回退管理存在的问题。由于Webview的数据封闭性,不同的模块Webview之间无法共享访问数据,使得不同的模块无法正常交互,为此采用重写LocalStorage的方式,通过本地Sqlite数据库操作模拟HTML5中缓存的操作,重写LocalStorage关键的操作方法setItem()、getItem()、removeItem()以及clear(),并为Webview绑定相应的底层Java方法接口,在服务器页面资源中用重写的LocalStorage替换默认的localStorage,从而完成跨域数据的调用访问操作。由于页面的重定向作用,页面回退时会反复加载到重定向后的页面,导致页面无法正常回退,因此通过维护历史栈的方式,在页面回退时对回退目标页面进行分析判断,并执行相应的回退管理方法,从而使得模块内部的页面以及模块之间可以正常地进行返回操作。 第四章 页面自适应机制设计 针对移动设备分辨率和屏幕大小、设备型号迥异的现状,本章将在分析现有页面跨浏览器兼容方案的基础上,同时结合移动端对不同分辨率设备的支持特性,分析与设计跨机型、跨分辨率、跨浏览器的页面自适应机制。 4.1页面兼容策略 为了使页面能够适应不同版本的浏览器内核,诸如IE、Chorme、Firefox等,CSS3引入了两种常用的设计策略,即优雅降级和渐进增强。 优雅降级指的是在页面设计开始即构建页面的完整功能,然后针对不同的浏览器进行测试和修复。该观点认为应该针对那些最高级、最完善的浏览器来开发网站,同时把那些被认为过时或有功能缺失的浏览器下的测试工作安排在开发周期的最后阶段。在这种设计思想下,旧版的浏览器通常被认为仅能提供简单却功能没有大碍的页面浏览体验。虽然可以做一些小的调整来适应某个特定的浏览器,但由于这些调整并非开发过程中关注的焦点,因此浏览器间呈现的差异通常将被直接忽略。 渐进增强指的是在页面设计开始只构建页面的最少特性功能,然后不断针对各高级浏览器追加额外功能。渐进增强思想认为应该先让网站能够正常工作于尽可能旧的浏览器上,然后不断为它在新型浏览器上实现更多的增强和改进。随着时间的推移,当更多的用户逐渐开始升级浏览器,同时浏览器本身的支持度也不断提升时,就会有越来越多的用户体验到这些增强和改进,无需为了一个已经成型的网站在旧式浏览器下正常工作而做逆向开发。渐进增强观点认为网页的开发应关注于内容本身。这使得渐进增强成为目前一种更为合理的设计范例。 图4.1 优雅降级和渐进增强图例 对于优雅降级,功能衰减的设计从复杂的功能现状开始,不断减少用户体验的供给;而渐进增强则的设计是从一个非常基础的,能够发挥作用的版本开始,并不断地进行扩充,以适应未来环境的需要。功能衰减意味着往回看;而渐进增强则意味着朝前看,同时保证其根基安全牢固。 为了能够给用户提供更好的界面交互体验,同时适应不同版本的浏览器内核,系统采用了部分渐进增强的思想,利用媒体查询为不同的浏览器版本和内核提供相应的展现效果,同时保证基本的页面展现功能。 4.2 页面自适应策略 系统采用部分渐进增强的页面适配思想,以及拥抱流式布局策略,通过视口元素的媒体查询来控制不同分辨率阈值下页面的布局规划,调整页面元素的布局为百分比方式,包括组件宽度、字体以及高度、图片的动态大小来控制相同分辨率阈值范围下不同视口中组件的平滑缩放。同时对HTML5页面的移动端适配属性进行设置控制,针对需要达到的效果设置其Viewport的属性,包括宽和高、页面最初大小、初始缩放比例、屏幕像素密度等。使得系统在Web浏览器端以及移动端都有良好的展示效果。 4.2.1设备自适应 Viewport是指用以展现手机页面的区域。尽管Viewport的可见区域和屏幕大小是匹配的,但是它有着自己的尺寸(dimensions),这一尺寸决定了页面上可见的像素点。一个web页面在扩张到整个屏幕之前占用的像素数据是由Viewport的尺寸来定义的,而不是设备屏幕的尺寸。如一个设备的屏幕宽480像素,但是Viewport宽800像素,那么这个web页面需要在800像素宽的屏幕上才能完全展现。 在HTML5中可以使用 <meta> 标签来为页面定义Viewport 的属性。可以在 <meta> 标签的content 属性中,定义多个Viewport属性。例如,Viewport的高和宽,页面的最初大小,以及目标屏幕分辨率。Content 属性中的每个Viewport性质必须以逗号相隔。通过初始缩放initial-scale和用户调整缩放来控制页面的伸张以适当地填充移动端设备的显示区域。通过target density定义屏幕像素密度来控制安卓浏览器和Webview根据不同屏幕的像素密度对页面进行的缩放。 图4.2 视口属性设置示意图 4.2.2.浏览器自适应 通过拥抱流式布局的来使得页面在不同尺寸屏幕上良好的运行。从手机到电脑,设备的屏幕尺寸层出不穷,很难用传统意义上的统一布局来适应这些变动。拥抱流式布局倡导响应式界面设计,通过媒体查询(@media screen and...)来获得设备特性信息,从而灵活的控制不同尺寸屏幕的浏览器动态的调整页面元素的布局,以适应视口特性的变化。 同时根据“目标元素宽度/上下文元素宽度=百分比宽度”的模式将传统的固定像素式布局改为百分比布局,元素的固定像素宽度转换成百分比宽度。假定整个页面布局的宽度是960px,按照1024px屏幕分辨率做参照,百分比应是960/1024 = 93.75%。其他的组件宽度也可以按照960px为参照计算。若除下来的结果是很长的小数,如340/960 = 0.3541666666666667 ,无须对结果进行四舍五入,这样可以保持最高的精确度,这些小数应尽可能完整保留。 根据“目标元素尺寸/上下文元素尺寸=百分比尺寸”将文字的固定像素大小转换为等量的相对尺寸,现代浏览器默认的字体大小是16px,字体的相对大小用em为单位来表示。若某个div的字体大小为48px,则转化后为48/16=3em。结果为小数时的处理方式同上。 给图片设置阈值以使图片随着视口平滑缩放,为不同屏幕尺寸提供不同的图片,然后针对不同视口宽度修正设计,保证在响应式设计中内容始终优先。图片不是布局元素,它里面不包含子元素。另外,图片还有失真的问题,缩放不当都会造成失真。为此,需要给图片添加样式max-width:100% 以实现弹性图片,因为图片所处的容器可以自动缩放,只需让图片限制在父级的宽度之内,就可以随父级一起缩放。弹性图片仅用max-width无法实现,除此之外还需使用百分比宽度。处理方式同计算布局元素的宽度。在此过程中需要注意图片的失真问题,当用户使用的一个超宽屏幕时,图片被放大到原大小的两倍甚至更多,图片的质量会大幅下降。所以还需为图片设置绝对阈值,即宽度上限,因此一个弹性图片的样式组合应该为:width:30%; max-width:400px。 对于一个使用超宽屏幕的用户,按照正常的页面设计比例,这张图片被放大到了500px,但是现在只能显示最大宽度400px,依然是个问题。为此可以采用另一个组合,把max-width加到图片的父级元素上,从源头上就限制放大的最大值,这样图片与它的相邻元素的比例就不会失调了。这样的设计也是个权衡的结果,因为页面结构千变万化,具体的解决办法,还得分析具体页面。 为了防止放大的过宽,可以通过媒体查询来设置不同分辨率下的阈值。在处理各种浏览器兼容问题时,可以借助Modernizr,一个用于检测浏览器功能的开源JavaScript库,通过Modernizr追加的额外类名来辅助修正样式问题,以及通过检测浏览器是否支持媒体查询来按需加载资源,让老版本IE支持HTML5等。 4.3 模块实现 页面自适应主要的实现方式包含: 4.3.1根据适口属性设计响应式布局: ①加入兼容配置代码 <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">,通过chrome插件GCF(谷歌内嵌浏览器框架)控制IE以Webkit引擎及V8引擎进行样式排版,若用户未安装该插件则以IE最高文档模式进行展
android好书系列,我目前找了两本,先贡献给大家。以后如果有好的资源,再上传和大家分享。 本资源是第一本。 这是一本学习android的好书,我浏览了,是老外著的,高清晰的pdf。为了方便大家学习android,我将本书所附的源码一块打包了。方便了不少,如果觉得好就顶一下吧,大家共同进步。 另外一本pro android 的下载地址: http://download.csdn.net/source/3139707 本书的目录结构如下: Chapter 1: The Big Picture Challenges of Smartphone Programming What Androids Are Made Of Stuff at Your Disposal ■Chapter 2: Projects and Targets Pieces and Parts Creating a Project Project Structure Root Contents The Sweat Off Your Brow And Now, the Rest of the Story What You Get Out of It Inside the Manifest In the Beginning, There Was the Root, And It Was Good Permissions, Instrumentations, and Applications (Oh My!) Your Application Does Something, Right? Achieving the Minimum Version=Control Emulators and Targets Virtually There Aiming at a Target ■Chapter 3: Creating a Skeleton Application Begin at the Beginning Dissecting the Activity Building and Running the Activity ■Chapter 4: Using XML-Based Layouts What Is an XML-Based Layout? Why Use XML-Based Layouts? OK, So What Does It Look Like? What’s with the @ Signs? And How Do We Attach These to the Java? The Rest of the Story ■Chapter 5: Employing Basic Widgets Assigning Labels Button, Button, Who’s Got the Button? Fleeting Images Fields of Green Or Other Colors Just Another Box to Check Turn the Radio Up It’s Quite a View Useful Properties Useful Methods Colors ■Chapter 6: Working with Containers Thinking Linearly LinearLayout Concepts and Properties LinearLayout Example All Things Are Relative RelativeLayout Concepts and Properties RelativeLayout Example Tabula Rasa TableLayout Concepts and Properties TableLayout Example Scrollwork ■Chapter 7: Using Selection Widgets Adapting to the Circumstances Lists of Naughty and Nice Spin Control Grid Your Lions (or Something Like That) Fields: Now with 35% Less Typing! Galleries, Give or Take the Art ■Chapter 8: Getting Fancy with Lists Getting to First Base A Dynamic Presentation Better Stronger Faster Using

200

社区成员

发帖
与我相关
我的任务
社区描述
讨论 Informatica 数据隐私保护相关技术
数据分析数据挖掘 技术论坛(原bbs)
社区管理员
  • 数据隐私保护社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧