官方社群在线客服官方频道防骗查询货币工具

聊天机器人和对话式人工智能的区别

2024-03-15 03:47:00
news.like.tgnews.like.tgnews.like.tgnews.like.tg

LIKE.TG 成立于2020年,总部位于马来西亚,是首家汇集全球互联网产品,提供一站式软件产品解决方案的综合性品牌。唯一官方网站:www.like.tg

尽管有时人们会将聊天机器人和对话式人工智能混用,但它们并不是同一回事。今天我们将回顾两者之间的区别,以及哪种选择对您的业务更好。

聊天机器人是什么?

聊天机器人是一种通过语音或文本进行对话并自动化的软件。聊天机器人是虚拟助手,可以快速回应客户查询,并使用预定义的规则或人工智能简化您的客户服务工作流程。

聊天机器人分为两个主要类别:基于规则的聊天机器人和AI聊天机器人。让我们在下面进一步探讨!

基于规则的聊天机器人

有时被称为基于菜单或基础的聊天机器人,基于规则的聊天机器人通常是人们在谈论聊天机器人时所指的。它们根据来自客户的关键字和其他语言识别符号的一组预定义响应进行通信。在某些情况下,基于规则的聊天机器人会显示决策树,使用户可以根据自己的情况选择答案。

因为这些聊天机器人围绕预先选定的问题和回答进行设计,所以它们对于客户支持来说相对容易实施。尽管基于规则的聊天机器人似乎相当简单,但它们是回答常见问题和解决基本客户问题的良好工具。然而,它们无法与人类进行真正的对话。

AI聊天机器人

AI聊天机器人利用机器学习、自然语言处理(NLP)和自然语言理解(NLU)等先进技术来理解用户请求的上下文。通过利用AI技术分析客户对话中的成千上万个上下文数据点,AI聊天机器人提供了更好的理解和决策能力。

与预设规则不同,AI聊天机器人不断从与客户的每次对话中学习。AI聊天机器人进行的交流越多,随着时间的推移,它的响应将越来越有帮助。AI聊天机器人的一个重要组成部分是它理解自然人类语言的能力,这使它能够在预定义的问题和回答之外进行沟通。

对话式人工智能是什么?

对话式人工智能是一种将人工智能与机器学习、自然语言处理、流程工作流和语音识别等新兴技术相结合的聊天机器人类型,提供个性化的客户服务体验。由于其灵活性和成本效益,零售商在像对话式人工智能这样的AI服务上的全球支出将在2023年达到120亿美元。

对话式人工智能超越了基本聊天机器人的能力,为客户体验树立了新的标准。通过使用深度学习技术,对话式人工智能工具可以不断学习和改进,使其更适应任何不断发展的业务的独特需求。

对话式人工智能通常使用一组工具,包括:

- 自动语音识别器(ASR)
- 自然语言理解模块(SLU)
- 对话管理器(DM)
- 自然语言生成器(NLG)
- 文字转语音合成器(TTS)

这些工具共同使用来自集中式数据库的信息,其中包含对话式人工智能在每次客户交互中获得的所有知识。因此,对话式人工智能可以通过不断增加其知识库和语言理解能力,提供基于动态上下文的个性化体验。

聊天机器人与对话式人工智能的比较

聊天机器人:
- 24/7可用性
- 文本命令、输入和输出
- 关键词重点
- 快速部署

对话式人工智能:
- 24/7可用性
- 文本命令、输入和输出
- 机器学习
- 自然语言处理
- 算法训练
- 易于扩展

聊天机器人还是对话式人工智能:哪个更适合您的业务?

最近的研究显示,东南亚地区37%的公司在未来五年加速了其人工智能采用计划。尽管自动化消息技术可以极大提升您的企业客户服务,但聊天机器人和对话式人工智能之间的区别可能会影响您的决策。

由于聊天机器人只需要一组预定义的查询和回复,因此它们可以快速设置和部署。因此,基本聊天机器人通常非常适合中小型企业,因为它们不需要处理大量数据或对复杂的客户查询做出回应。

通过LIKE.TG的对话式人工智能,超越聊天机器人

聊天机器人只是技术在客户服务中所能实现的开始。由于人工智能的最新进展,对话式人工智能已经证明是与客户沟通的强大工具。如果您想了解对话式人工智能如何与您的业务合作,请联系LIKE.TG。

我们的对话式人工智能云可以帮助您在我们用户友好的界面中创建您的交流。此外,我们的平台支持持续学习和改进,以实现不断改善的客户体验,从易于构建的对话式机器人到基于AI的分析。

立即联系我们的专家,了解如何通过对话式人工智能云改进您的客户服务。

LIKE.TG 专注全球社交流量推广,致力于为全球出海企业提供有关的私域营销获客、国际电商、全球客服、金融支持等最新资讯和实用工具。免费领取【WhatsApp、LINE、Telegram、Twitter、ZALO】等云控系统试用;点击【联系客服】 ,或关注【LIKE.TG出海指南频道】【LIKE.TG生态链-全球资源互联社区】了解更多最新资讯

本文由LIKE.TG编辑部转载自互联网并编辑,如有侵权影响,请联系官方客服,将为您妥善处理。

This article is republished from public internet and edited by the LIKE.TG editorial department. If there is any infringement, please contact our official customer service for proper handling.


人工智能论坛AI对话
加入like.tg生态圈,即可获利、结识全球供应商、拥抱全球软件生态圈加入like.tg生态圈,即可获利、结识全球供应商、拥抱全球软件生态圈加入like.tg生态圈,即可获利、结识全球供应商、拥抱全球软件生态圈
营销拓客

					10 Benefits That Explain the Importance of CRM in Banking
10 Benefits That Explain the Importance of CRM in Banking
The banking industry is undergoing a digital transformation, and customer relationship management (CRM) systems are at the forefront of this change. By providing a centralised platform for customer data, interactions, and analytics, CRMs empower banks to deliver personalised and efficient services, fostering customer loyalty and driving business growth. We’ll look closer at the significance of CRM in banking, exploring its numerous benefits, addressing challenges in adoption, and highlighting future trends and innovations. Additionally, we present a compelling case study showcasing a successful CRM implementation in the banking sector. 10 Questions to Ask When Choosing a CRM in Banking When selecting a top CRM platform for your banking institution, it is necessary to carefully evaluate potential solutions to ensure they align with your specific requirements and objectives. Here are 10 key questions to ask during the selection process: 1. Does the CRM integrate with your existing, financial and banking organisation and systems? A seamless integration between your CRM and existing banking systems is essential to avoid data silos and ensure a holistic view of customer interactions. Look for a CRM that can easily integrate with your core banking system, payment platforms, and other relevant applications. 2. Can the CRM provide a 360-degree view of your customers? A CRM should offer a unified platform that consolidates customer data from various touchpoints, including online banking, mobile banking, branches, and contact centres. This enables bank representatives to access a complete customer profile, including account information, transaction history, and past interactions, resulting in more personalised and efficient customer service. 3. Does the CRM offer robust reporting and analytics capabilities? Leverage the power of data by selecting a CRM that provides robust reporting and analytics capabilities. This will allow you to analyse customer behaviour, identify trends, and gain actionable insights into customer needs and preferences. Look for a CRM that offers customisable reports, dashboards, and data visualisation tools to empower your bank with data-driven decision-making. 4. Is the CRM user-friendly and easy to implement? A user-friendly interface is essential for ensuring that your bank’s employees can effectively utilise the CRM. Consider the technical expertise of your team and opt for a CRM with an intuitive design, clear navigation, and minimal training requirements. Additionally, evaluate the implementation process to ensure it can be completed within your desired timeframe and budget. What is a CRM in the Banking Industry? Customer relationship management (CRM) is a crucial technology for banks to optimise customer service, improve operational efficiency, and drive business growth. A CRM system acts as a centralised platform that empowers banks to manage customer interactions, track customer information, and analyse customer data. By leveraging CRM capabilities, banks can also gain deeper insights and a larger understanding of their customers’ needs, preferences, and behaviours, enabling them to deliver personalised and exceptional banking experiences. CRM in banking fosters stronger customer relationships by facilitating personalised interactions. With a CRM system, banks can capture and store customer data, including personal information, transaction history, and communication preferences. This data enables bank representatives to have informed conversations with customers, addressing their specific needs and providing tailored financial solutions. Personalised interactions enhance customer satisfaction, loyalty, and overall banking experience. CRM enhances operational efficiency and productivity within banks. By automating routine tasks such as data entry, customer service ticketing, and report generation, banking CRM software streamlines workflows and reduces manual labour. This automation allows bank employees to focus on higher-value activities, such as customer engagement and financial advisory services. Furthermore, CRM provides real-time access to customer information, enabling employees to quickly retrieve and update customer data, thereby enhancing operational efficiency. Additionally, CRM empowers banks to analyse customer data and derive valuable insights. With robust reporting and analytics capabilities, banks can identify customer segments, analyse customer behaviour, and measure campaign effectiveness. This data-driven approach enables banks to make informed decisions, optimise marketing strategies, and develop targeted products and services that cater to specific customer needs. CRM also plays a vital role in risk management and compliance within the banking industry. By integrating customer data with regulatory requirements, banks can effectively monitor transactions, detect suspicious activities, and mitigate fraud risks. This ensures compliance with industry regulations and safeguards customer information. In summary, CRM is a transformative technology that revolutionises banking operations. By fostering personalised customer experiences and interactions, enhancing operational efficiency, enabling data-driven decision-making, and ensuring risk management, CRM empowers banks to deliver superior customer service, drive business growth, and maintain a competitive edge. The 10 Business Benefits of Using a Banking CRM 1. Streamlined Customer Interactions: CRMs enable banks to centralise customer data, providing a holistic view of each customer’s interactions with the bank. This allows for streamlined and personalised customer service, improving customer satisfaction and reducing the time and effort required to resolve customer queries. 2. Enhanced Data Management and Analytics: CRMs provide powerful data management capabilities, enabling banks to collect, store, and analyse customer data from various sources. This data can be leveraged to gain valuable insights into customer behaviour, preferences, and buying patterns. Banks can then use these insights to optimise their products, services, and marketing strategies. 3. Increased Sales and Cross-Selling Opportunities: CRMs help banks identify cross-selling and upselling opportunities by analysing customer data and identifying customer needs and preferences. By leveraging this information, banks can proactively recommend relevant products and services, increasing sales and revenue. 4. Improved Customer Retention and Loyalty: CRMs help banks build stronger customer relationships by enabling personalised interactions and providing excellent customer service. By understanding customer needs and preferences, banks can proactively address issues and provide tailored solutions, fostering customer loyalty and reducing churn. 5. Enhanced Regulatory Compliance and Risk Management: CRMs assist banks in complying with industry regulations and managing risks effectively. By centralising customer data and tracking customer interactions, banks can easily generate reports and demonstrate compliance with regulatory requirements. CRMs and other banking software programs also help in identifying and managing potential risks associated with customer transactions. 6. Improved Operational Efficiency: CRMs streamline various banking processes, including customer onboarding, loan processing, and account management. By automating repetitive tasks and providing real-time access to customer information, CRMs help banks improve operational efficiency and reduce costs. 7. Increased Employee Productivity: CRMs provide banking employees with easy access to customer data and real-time updates, enabling them to handle customer inquiries more efficiently. This reduces the time spent on administrative tasks and allows employees to focus on providing exceptional customer service. 8. Improved Decision-Making: CRMs provide banks with data-driven insights into customer behaviour and market trends. This information supports informed decision-making, enabling banks to develop and implement effective strategies for customer acquisition, retention, and growth. 9. Enhanced Customer Experience: CRMs help banks deliver a superior customer experience by providing personalised interactions, proactive problem resolution, and quick response to customer inquiries. This results in increased customer satisfaction and positive brand perception.10. Increased Profitability: By leveraging the benefits of CRM systems, banks can optimise their operations, increase sales, and reduce costs, ultimately leading to increased profitability and long-term success for financial service customers. Case studies highlighting successful CRM implementations in banking Several financial institutions have successfully implemented CRM systems to enhance their operations and customer service. Here are a few notable case studies: DBS Bank: DBS Bank, a leading financial institution in Southeast Asia, implemented a CRM system to improve customer service and cross-selling opportunities. The system provided a 360-degree view of customers, enabling the bank to tailor products and services to individual needs. As a result, DBS Bank increased customer retention by 15% and cross-selling opportunities by 20%. HDFC Bank: India’s largest private sector bank, HDFC Bank, implemented a CRM system to improve customer service and operational efficiency. The system integrated various customer touch points, such as branches, ATMs, and online banking, providing a seamless experience for customers. HDFC Bank achieved a 20% reduction in operating costs and a 15% increase in customer satisfaction. JPMorgan Chase: JPMorgan Chase, one of the largest banks in the United States, implemented a CRM system to improve customer interactions and data management. The system provided a centralised platform to track customer interactions and data, allowing the bank to gain insights into customer behaviour and preferences. As a result, JPMorgan Chase increased customer interactions by 15% and improved data accuracy by 20%. Bank of America: Bank of America, the second-largest bank in the United States, implemented a CRM system to improve sales and cross-selling opportunities. The system provided sales teams with real-time customer data, across sales and marketing efforts enabling them to tailor their pitches and identify potential cross-selling opportunities. Bank of America achieved a 10% increase in sales and a 15% increase in cross-selling opportunities.These case studies demonstrate the tangible benefits of CRM in the banking industry. By implementing CRM systems, banks can improve customer retention, customer service, cross-selling opportunities, operating costs, and marketing campaigns. Overcoming challenges to CRM adoption in banking While CRM systems offer numerous benefits to banks, their adoption can be hindered by certain challenges. One of the primary obstacles is resistance from employees who may be reluctant to embrace new technology or fear job displacement. Overcoming this resistance requires effective change management strategies, such as involving employees in the selection and implementation process, providing all-encompassing training, and addressing their concerns. Another challenge is the lack of proper training and support for employees using the CRM system. Insufficient training can lead to low user adoption and suboptimal utilisation of the system’s features. To address this, banks should invest in robust training programs that equip employees with the knowledge and skills necessary to effectively use the CRM system. Training should cover not only the technical aspects of the system but also its benefits and how it aligns with the bank’s overall goals. Integration challenges can also hinder the successful adoption of CRM software in banking. Banks often have complex IT systems and integrating a new CRM system can be a complex and time-consuming process. To overcome these challenges, banks should carefully plan the integration process, ensuring compatibility between the CRM system and existing systems. This may involve working with the CRM vendor to ensure a smooth integration process and providing adequate technical support to address any issues that arise. Data security is a critical concern for banks, and the adoption of a CRM system must address potential security risks. Banks must ensure that the CRM system meets industry standards and regulations for data protection. This includes implementing robust security measures, such as encryption, access controls, and regular security audits, to safeguard sensitive customer information. Finally, the cost of implementing and maintaining a CRM system can be a challenge for banks. CRM systems require significant upfront investment in software, hardware, and training. Banks should carefully evaluate the costs and benefits of CRM adoption, ensuring that the potential returns justify the investment. Additionally, banks should consider the ongoing costs associated with maintaining and updating the CRM system, as well as the cost of providing ongoing training and support to users. Future trends and innovations in banking CRM Navigating Evolving Banking Trends and Innovations in CRM The banking industry stands at the precipice of transformative changes, driven by a surge of innovative technologies and evolving customer expectations. Open banking, artificial intelligence (AI), blockchain technology, the Internet of Things (IoT), and voice-activated interfaces are shaping the future of banking CRM. Open banking is revolutionising the financial sphere by enabling banks to securely share customer data with third-party providers, with the customer’s explicit consent. This fosters a broader financial ecosystem, offering customers access to a varied range of products and services, while fostering healthy competition and innovation within the banking sector. AI has become an indispensable tool for banking institutions, empowering them to deliver exceptional customer experiences. AI-driven chatbots and virtual assistants provide round-the-clock support, assisting customers with queries, processing transactions, and ensuring swift problem resolution. Additionally, AI plays a pivotal role in fraud detection and risk management, safeguarding customers’ financial well-being. Blockchain technology, with its decentralised and immutable nature, offers a secure platform for financial transactions. By maintaining an incorruptible ledger of records, blockchain ensures the integrity and transparency of financial data, building trust among customers and enhancing the overall banking experience. The Internet of Things (IoT) is transforming banking by connecting physical devices to the internet, enabling real-time data collection and exchange. IoT devices monitor customer behaviour, track equipment status, and manage inventory, empowering banks to optimise operations, reduce costs, and deliver personalised services. Voice-activated interfaces and chatbots are revolutionising customer interactions, providing convenient and intuitive access to banking services. Customers can utilise voice commands or text-based chat to manage accounts, make payments, and seek assistance, enhancing their overall banking experience. These transformative trends necessitate banks’ ability to adapt and innovate continuously. By embracing these technologies and aligning them with customer needs, banks can unlock new opportunities for growth, strengthen customer relationships, and remain at the forefront of the industry. How LIKE.TG Can Help LIKE.TG is a leading provider of CRM solutions that can help banks achieve the benefits of CRM. With LIKE.TG, banks can gain a complete view of their customers, track interactions, deliver personalised experiences, and more. LIKE.TG offers a comprehensive suite of CRM tools that can be customised to meet the specific needs of banks. These tools include customer relationship management (CRM), sales and marketing automation, customer service, and analytics. By leveraging LIKE.TG, banks can improve customer satisfaction, increase revenue, and reduce costs. For example, one bank that implemented LIKE.TG saw a 20% increase in customer satisfaction, a 15% increase in revenue, and a 10% decrease in costs. Here are some specific examples of how LIKE.TG can help banks: Gain a complete view of customers: LIKE.TG provides a single, unified platform that allows banks to track all customer interactions, from initial contact to ongoing support. This information can be used to create a complete picture of each customer, which can help banks deliver more personalised and relevant experiences. Track interactions: LIKE.TG allows banks to track all interactions with customers, including phone calls, emails, chat conversations, and social media posts. This information can be used to identify trends and patterns, which can help banks improve their customer service and sales efforts. Deliver personalised experiences: LIKE.TG allows banks to create personalised experiences for each customer. This can be done by using customer data to tailor marketing campaigns, product recommendations, and customer service interactions. Increase revenue: LIKE.TG can help banks increase revenue by providing tools to track sales opportunities, manage leads, and forecast revenue. This information can be used to make informed decisions about which products and services to offer, and how to best target customers. Reduce costs: LIKE.TG can help banks reduce costs by automating tasks, streamlining processes, and improving efficiency. This can free up resources that can be used to focus on other areas of the business. Overall, LIKE.TG is a powerful CRM solution that can help banks improve customer satisfaction, increase revenue, and reduce costs. By leveraging LIKE.TG, banks can gain a competitive advantage in the rapidly changing financial services industry.

					10 Ecommerce Trends That Will Influence Online Shopping in 2024
10 Ecommerce Trends That Will Influence Online Shopping in 2024
Some ecommerce trends and technologies pass in hype cycles, but others are so powerful they change the entire course of the market. After all the innovations and emerging technologies that cropped up in 2023, business leaders are assessing how to move forward and which new trends to implement.Here are some of the biggest trends that will affect your business over the coming year. What you’ll learn: Artificial intelligence is boosting efficiency Businesses are prioritising data management and harmonisation Conversational commerce is getting more human Headless commerce is helping businesses keep up Brands are going big with resale Social commerce is evolving Vibrant video content is boosting sales Loyalty programs are getting more personalised User-generated content is influencing ecommerce sales Subscriptions are adding value across a range of industries Ecommerce trends FAQ 1. Artificial intelligence is boosting efficiency There’s no doubt about it: Artificial intelligence (AI) is changing the ecommerce game. Commerce teams have been using the technology for years to automate and personalise product recommendations, chatbot activity, and more. But now, generative and predictive AI trained on large language models (LLM) offer even more opportunities to increase efficiency and scale personalisation. AI is more than an ecommerce trend — it can make your teams more productive and your customers more satisfied. Do you have a large product catalog that needs to be updated frequently? AI can write and categorise individual descriptions, cutting down hours of work to mere minutes. Do you need to optimise product detail pages? AI can help with SEO by automatically generating meta titles and meta descriptions for every product. Need to build a landing page for a new promotion? Generative page designers let users of all skill levels create and design web pages in seconds with simple, conversational building tools. All this innovation will make it easier to keep up with other trends, meet customers’ high expectations, and stay flexible — no matter what comes next. 2. Businesses are prioritising data management and harmonisation Data is your most valuable business asset. It’s how you understand your customers, make informed decisions, and gauge success. So it’s critical to make sure your data is in order. The challenge? Businesses collect a lot of it, but they don’t always know how to manage it. That’s where data management and harmonisation come in. They bring together data from multiple sources — think your customer relationship management (CRM) and order management systems — to provide a holistic view of all your business activities. With harmonised data, you can uncover insights and act on them much faster to increase customer satisfaction and revenue. Harmonised data also makes it possible to implement AI (including generative AI), automation, and machine learning to help you market, serve, and sell more efficiently. That’s why data management and harmonisation are top priorities among business leaders: 68% predict an increase in data management investments. 32% say a lack of a complete view and understanding of their data is a hurdle. 45% plan to prioritise gaining a more holistic view of their customers. For businesses looking to take advantage of all the new AI capabilities in ecommerce, data management should be priority number one. 3. Conversational commerce is getting more human Remember when chatbot experiences felt robotic and awkward? Those days are over. Thanks to generative AI and LLMs, conversational commerce is getting a glow-up. Interacting with chatbots for service inquiries, product questions, and more via messaging apps and websites feels much more human and personalised. Chatbots can now elevate online shopping with conversational AI and first-party data, mirroring the best in-store interactions across all digital channels. Natural language, image-based, and data-driven interactions can simplify product searches, provide personalised responses, and streamline purchases for a smooth experience across all your digital channels. As technology advances, this trend will gain more traction. Intelligent AI chatbots offer customers better self-service experiences and make shopping more enjoyable. This is critical since 68% of customers say they wouldn’t use a company’s chatbot again if they had a bad experience. 4. Headless commerce is helping businesses keep up Headless commerce continues to gain steam. With this modular architecture, ecommerce teams can deliver new experiences faster because they don’t have to wait in the developer queue to change back-end systems. Instead, employees can update online interfaces using APIs, experience managers, and user-friendly tools. According to business leaders and commerce teams already using headless: 76% say it offers more flexibility and customisation. 72% say it increases agility and lets teams make storefront changes faster. 66% say it improves integration between systems. Customers reap the benefits of headless commerce, too. Shoppers get fresh experiences more frequently across all devices and touchpoints. Even better? Headless results in richer personalisation, better omni-channel experiences, and peak performance for ecommerce websites. 5. Brands are going big with resale Over the past few years, consumers have shifted their mindset about resale items. Secondhand purchases that were once viewed as stigma are now seen as status. In fact, more than half of consumers (52%) have purchased an item secondhand in the last year, and the resale market is expected to reach $70 billion by 2027. Simply put: Resale presents a huge opportunity for your business. As the circular economy grows in popularity, brands everywhere are opening their own resale stores and encouraging consumers to turn in used items, from old jeans to designer handbags to kitchen appliances. To claim your piece of the pie, be strategic as you enter the market. This means implementing robust inventory and order management systems with real-time visibility and reverse logistics capabilities. 6. Social commerce is evolving There are almost 5 billion monthly active users on platforms like Instagram, Facebook, Snapchat, and TikTok. More than two-thirds (67%) of global shoppers have made a purchase through social media this year. Social commerce instantly connects you with a vast global audience and opens up new opportunities to boost product discovery, reach new markets, and build meaningful connections with your customers. But it’s not enough to just be present on social channels. You need to be an active participant and create engaging, authentic experiences for shoppers. Thanks to new social commerce tools — like generative AI for content creation and integrations with social platforms — the shopping experience is getting better, faster, and more engaging. This trend is blurring the lines between shopping and entertainment, and customer expectations are rising as a result. 7. Vibrant video content is boosting sales Now that shoppers have become accustomed to the vibrant, attention-grabbing video content on social platforms, they expect the same from your brand’s ecommerce site. Video can offer customers a deeper understanding of your products, such as how they’re used, and what they look like from different angles. And video content isn’t just useful for ads or for increasing product discovery. Brands are having major success using video at every stage of the customer journey: in pre-purchase consultations, on product detail pages, and in post-purchase emails. A large majority (89%) of consumers say watching a video has convinced them to buy a product or service. 8. Loyalty programs are getting more personalised It’s important to attract new customers, but it’s also critical to retain your existing ones. That means you need to find ways to increase loyalty and build brand love. More and more, customers are seeking out brand loyalty programs — but they want meaningful rewards and experiences. So, what’s the key to a successful loyalty program? In a word: personalisation. Customers don’t want to exchange their data for a clunky, impersonal experience where they have to jump through hoops to redeem points. They want straightforward, exclusive offers. Curated experiences. Relevant rewards. Six out of 10 consumers want discounts in return for joining a loyalty program, and about one-third of consumers say they find exclusive or early access to products valuable. The brands that win customer loyalty will be those that use data-driven insights to create a program that keeps customers continually engaged and satisfied. 9. User-generated content is influencing ecommerce sales User-generated content (UGC) adds credibility, authenticity‌, and social proof to a brand’s marketing efforts — and can significantly boost sales and brand loyalty. In fact, one study found that shoppers who interact with UGC experience a 102.4% increase in conversions. Most shoppers expect to see feedback and reviews before making a purchase, and UGC provides value by showcasing the experiences and opinions of real customers. UGC also breaks away from generic item descriptions and professional product photography. It can show how to style a piece of clothing, for example, or how an item will fit across a range of body types. User-generated videos go a step further, highlighting the functions and features of more complex products, like consumer electronics or even automobiles. UGC is also a cost-effective way to generate content for social commerce without relying on agencies or large teams. By sourcing posts from hashtags, tagging, or concentrated campaigns, brands can share real-time, authentic, and organic social posts to a wider audience. UGC can be used on product pages and in ads, as well. And you can incorporate it into product development processes to gather valuable input from customers at scale. 10. Subscriptions are adding value across a range of industries From streaming platforms to food, clothing, and pet supplies, subscriptions have become a popular business model across industries. In 2023, subscriptions generated over $38 billion in revenue, doubling over the past four years. That’s because subscriptions are a win-win for shoppers and businesses: They offer freedom of choice for customers while creating a continuous revenue stream for sellers. Consider consumer goods brand KIND Snacks. KIND implemented a subscription service to supplement its B2B sales, giving customers a direct line to exclusive offers and flavours. This created a consistent revenue stream for KIND and helped it build a new level of brand loyalty with its customers. The subscription also lets KIND collect first-party data, so it can test new products and spot new trends. Ecommerce trends FAQ How do I know if an ecommerce trend is right for my business? If you’re trying to decide whether to adopt a new trend, the first step is to conduct a cost/benefit analysis. As you do, remember to prioritise customer experience and satisfaction. Look at customer data to evaluate the potential impact of the trend on your business. How costly will it be to implement the trend, and what will the payoff be one, two, and five years into the future? Analyse the numbers to assess whether the trend aligns with your customers’ preferences and behaviours. You can also take a cue from your competitors and their adoption of specific trends. While you shouldn’t mimic everything they do, being aware of their experiences can provide valuable insights and help gauge the viability of a trend for your business. Ultimately, customer-centric decision-making should guide your evaluation. Is ecommerce still on the rise? In a word: yes. In fact, ecommerce is a top priority for businesses across industries, from healthcare to manufacturing. Customers expect increasingly sophisticated digital shopping experiences, and digital channels continue to be a preferred purchasing method. Ecommerce sales are expected to reach $8.1 trillion by 2026. As digital channels and new technologies evolve, so will customer behaviours and expectations. Where should I start if I want to implement AI? Generative AI is revolutionising ecommerce by enhancing customer experiences and increasing productivity, conversions, and customer loyalty. But to reap the benefits, it’s critical to keep a few things in mind. First is customer trust. A majority of customers (68%) say advances in AI make it more important for companies to be trustworthy. This means businesses implementing AI should focus on transparency. Tell customers how you will use their data to improve shopping experiences. Develop ethical standards around your use of AI, and discuss them openly. You’ll need to answer tough questions like: How do you ensure sensitive data is anonymised? How will you monitor accuracy and audit for bias, toxicity, or hallucinations? These should all be considerations as you choose AI partners and develop your code of conduct and governance principles. At a time when only 13% of customers fully trust companies to use AI ethically, this should be top of mind for businesses delving into the fast-evolving technology. How can commerce teams measure success after adopting a new trend? Before implementing a new experience or ecommerce trend, set key performance indicators (KPIs) and decide how you’ll track relevant ecommerce metrics. This helps you make informed decisions and monitor the various moving parts of your business. From understanding inventory needs to gaining insights into customer behaviour to increasing loyalty, you’ll be in a better position to plan for future growth. The choice of metrics will depend on the needs of your business, but it’s crucial to establish a strategy that outlines metrics, sets KPIs, and measures them regularly. Your business will be more agile and better able to adapt to new ecommerce trends and understand customer buying patterns. Ecommerce metrics and KPIs are valuable tools for building a successful future and will set the tone for future ecommerce growth.

					10 Effective Sales Coaching Tips That Work
10 Effective Sales Coaching Tips That Work
A good sales coach unlocks serious revenue potential. Effective coaching can increase sales performance by 8%, according to a study by research firm Gartner.Many sales managers find coaching difficult to master, however — especially in environments where reps are remote and managers are asked to do more with less time and fewer resources.Understanding the sales coaching process is crucial in maximising sales rep performance, empowering reps, and positively impacting the sales organisation through structured, data-driven strategies.If you’re not getting the support you need to effectively coach your sales team, don’t despair. These 10 sales coaching tips are easy to implement with many of the tools already at your disposal, and are effective for both in-person and remote teams.1. Focus on rep wellbeingOne in three salespeople say mental health in sales has declined over the last two years, according to a recent LIKE.TG survey. One of the biggest reasons is the shift to remote work environments, which pushed sales reps to change routines while still hitting quotas. Add in the isolation inherent in virtual selling and you have a formula for serious mental and emotional strain.You can alleviate this in a couple of ways. First, create boundaries for your team. Set clear work hours and urge reps not to schedule sales or internal calls outside of these hours. Also, be clear about when reps should be checking internal messages and when they can sign off.Lori Richardson, founder of sales training company Score More Sales, advises managers to address this head-on by asking reps about their wellbeing during weekly one-on-ones. “I like to ask open-ended questions about the past week,” she said. “Questions like, ‘How did it go?’ and ‘What was it like?’ are good first steps. Then, you need to listen.”When the rep is done sharing their reflection, Richardson suggests restating the main points to ensure you’re on the same page. If necessary, ask for clarity so you fully understand what’s affecting their state of mind. Also, she urges: Don’t judge. The level of comfort required for sharing in these scenarios can only exist if you don’t jump to judgement.2. Build trust with authentic storiesFor sales coaching to work, sales managers must earn reps’ trust. This allows the individual to be open about performance challenges. The best way to start is by sharing personal and professional stories.These anecdotes should be authentic, revealing fault and weakness as much as success. There are two goals here: support reps with relatable stories so they know they’re not struggling alone, and let them know there are ways to address and overcome challenges.For example, a seasoned manager might share details about their first failed sales call as a cautionary tale – highlighting poor preparation, aggressive posturing, and lack of empathy during the conversation. This would be followed by steps the manager took to fix these mistakes, like call rehearsing and early-stage research into the prospect’s background, business, position, and pain points.3. Record and review sales callsSales coaching sessions, where recording and reviewing sales calls are key components aimed at improving sales call techniques, have become essential in today’s sales environment. Once upon a time, sales reps learned by shadowing tenured salespeople. While this is still done, it’s inefficient – and often untenable for virtual sales teams.To give sales reps the guidance and coaching they need to improve sales calls, deploy an intuitive conversation recording and analysis tool like Einstein Conversation Insights (ECI). You can analyse sales call conversations, track keywords to identify market trends, and share successful calls to help coach existing reps and accelerate onboarding for new reps. Curate both “best of” and “what not to do” examples so reps have a sense of where the guide rails are.4. Encourage self-evaluationWhen doing post-call debriefs or skill assessments – or just coaching during one-on-ones – it’s critical to have the salesperson self-evaluate. As a sales manager, you may only be with the rep one or two days a month. Given this disconnect, the goal is to encourage the sales rep to evaluate their own performance and build self-improvement goals around these observations.There are two important components to this. First, avoid jumping directly into feedback during your interactions. Relax and take a step back; let the sales rep self-evaluate.Second, be ready to prompt your reps with open-ended questions to help guide their self-evaluation. Consider questions like:What were your big wins over the last week/quarter?What were your biggest challenges and where did they come from?How did you address obstacles to sales closings?What have you learned about both your wins and losses?What happened during recent calls that didn’t go as well as you’d like? What would you do differently next time?Reps who can assess what they do well and where they can improve ultimately become more self-aware. Self-awareness is the gateway to self-confidence, which can help lead to more consistent sales.5. Let your reps set their own goalsThis falls in line with self-evaluation. Effective sales coaches don’t set focus areas for their salespeople; they let reps set this for themselves. During your one-on-ones, see if there’s an important area each rep wants to focus on and go with their suggestion (recommending adjustments as needed to ensure their goals align with those of the company). This creates a stronger desire to improve as it’s the rep who is making the commitment. Less effective managers will pick improvement goals for their reps, then wonder why they don’t get buy-in.For instance, a rep who identifies a tendency to be overly chatty in sales calls might set a goal to listen more. (Nine out of 10 salespeople say listening is more important than talking in sales today, according to a recent LIKE.TG survey.) To help, they could record their calls and review the listen-to-talk ratio. Based on industry benchmarks, they could set a clear goal metric and timeline – a 60/40 listen-to-talk ratio in four weeks, for example.Richardson does have one note of caution, however. “Reps don’t have all the answers. Each seller has strengths and gaps,” she said. “A strong manager can identify those strengths and gaps, and help reps fill in the missing pieces.”6. Focus on one improvement at a timeFor sales coaching to be effective, work with the rep to improve one area at a time instead of multiple areas simultaneously. With the former, you see acute focus and measurable progress. With the latter, you end up with frustrated, stalled-out reps pulled in too many directions.Here’s an example: Let’s say your rep is struggling with sales call openings. They let their nerves get the best of them and fumble through rehearsed intros. Over the course of a year, encourage them to practice different kinds of openings with other reps. Review their calls and offer insight. Ask them to regularly assess their comfort level with call openings during one-on-ones. Over time, you will see their focus pay off.7. Ask each rep to create an action planOpen questioning during one-on-ones creates an environment where a sales rep can surface methods to achieve their goals. To make this concrete, have the sales rep write out a plan of action that incorporates these methods. This plan should outline achievable steps to a desired goal with a clearly defined timeline. Be sure you upload it to your CRM as an attachment or use a tool like Quip to create a collaborative document editable by both the manager and the rep. Have reps create the plan after early-quarter one-on-ones and check in monthly to gauge progress (more on that in the next step).Here’s what a basic action plan might look like:Main goal: Complete 10 sales calls during the last week of the quarterSteps:Week 1: Identify 20-25 prospectsWeek 2: Make qualifying callsWeek 3: Conduct needs analysis (discovery) calls, prune list, and schedule sales calls with top prospectsWeek 4: Lead sales calls and close dealsThe power of putting pen to paper here is twofold. First, it forces the sales rep to think through their plan of action. Second, it crystallises their thinking and cements their commitment to action.8. Hold your rep accountableAs businessman Louis Gerstner, Jr. wrote in “Who Says Elephants Can’t Dance?”, “people respect what you inspect.” The effective manager understands that once the plan of action is in place, their role as coach is to hold the sales rep accountable for following through on their commitments. To support them, a manager should ask questions during one-on-ones such as:What measurable progress have you made this week/quarter?What challenges are you facing?How do you plan to overcome these challenges?You can also review rep activity in your CRM. This is especially easy if you have a platform that combines automatic activity logging, easy pipeline inspection, and task lists with reminders. If you need to follow up, don’t schedule another meeting. Instead, send your rep a quick note via email or a messaging tool like Slack to level-set.9. Offer professional development opportunitiesAccording to a study by LinkedIn, 94% of employees would stay at a company longer if it invested in their career. When companies make an effort to feed their employees’ growth, it’s a win-win. Productivity increases and employees are engaged in their work.Book clubs, seminars, internal training sessions, and courses are all great development opportunities. If tuition reimbursement or sponsorship is possible, articulate this up front so reps know about all available options.Richardson adds podcasts to the list. “Get all of your salespeople together to talk about a podcast episode that ties into sales,” she said. “Take notes, pull key takeaways and action items, and share a meeting summary the next day with the group. I love that kind of peer engagement. It’s so much better than watching a dull training video.”10. Set up time to share failures — and celebrationsAs Forbes Council member and sales vet Adam Mendler wrote of sales teams, successful reps and executives prize learning from failure. But as Richardson points out, a lot of coaches rescue their reps before they can learn from mistakes: “Instead of letting them fail, they try to save an opportunity,” she said. “But that’s not scalable and doesn’t build confidence in the rep.”Instead, give your reps the freedom to make mistakes and offer them guidance to grow through their failures. Set up a safe space where reps can share their mistakes and learnings with the larger team — then encourage each rep to toss those mistakes on a metaphorical bonfire so they can move on.By embracing failure as a learning opportunity, you also minimise the likelihood of repeating the same mistakes. Encourage your reps to document the circumstances that led to a missed opportunity or lost deal. Review calls to pinpoint where conversations go awry. Study failure, and you might be surprised by the insights that emerge.Also — and equally as important — make space for celebrating big wins. This cements best practices and offers positive reinforcement, which motivates reps to work harder to hit (or exceed) quota.Next steps for your sales coaching programA successful sales coach plays a pivotal role in enhancing sales rep performance and elevating the entire sales organisation. Successful sales coaching requires daily interaction with your team, ongoing training, and regular feedback, which optimises sales processes to improve overall sales performance. As Lindsey Boggs, global director of sales development at Quantum Metric, noted, it also requires intentional focus and a strategic approach to empower the sales team, significantly impacting the sales organisation.“Remove noise from your calendar so you can focus your day on what’s going to move the needle the most — coaching,” she said. Once that’s prioritised, follow the best practices above to help improve your sales reps’ performance, focusing on individual rep development as a key aspect of sales coaching. Remember: coaching is the key to driving sales performance.Steven Rosen, founder of sales management training company STAR Results, contributed to this article.
人工智能论坛
公司(视频 社交)项目分享
公司(视频 社交)项目分享
http://blog.csdn.net/u011733020/article/details/46786471 最近公司工作比较轻松,就把以前的项目 拿来整理下。以前公司做视频社交这一块,类似于YY直播。 展示 先来个动态图 再简单看一下主要界面 首页第一个界面,这里可以看美女,看直播 这是任务列界面,可以领取每日任务,任务分成长 和推荐 好友列表 用户的个人中心页 直播间 用户的个人中心页 充值方式页 银联支付页 项目组成 这个项目主要的重点就两个地方,看视频,和 与主播互动。 整个视频流是用RTMP协议的,文字聊天走的是openfire+asmack . PS:整个项目,我们产品设计的很不错的,只是我水平有限,有些功能 实现不了! 再介绍下,整个项目都用到了什么? 程序框架:SlidingMenu+Viewpager+fragment 请求服务器: asynchttpclient 解析数据:Gson 消息推送: Jpush 页面数据分析: Umeng 充值方式: alipay +银联+yeepay+短信充值 图片缓存: afinal 自定义view: Pulltoresfresh+拼音排序联系人+horizontallistview+verticalviewpager… 另,我把公司的项目写出来,是因为公司的服务器停掉了,所以,一些数据,是我自己抓出其他应用里面的(抓取数据的方法,在上面一篇文章里)…. 首先就是整个项目最下面是mainactivity,这个大家是都有共识的,在mainactivity 上面 我们就要 引入slidingmenu, 关于slidingmenu的下载,就不介绍了,这里直接拿来用 包结构比较清晰 , 整个项目首先,由splashactivity 欢迎界面 ,进行检查,然后跳转到mainactivity,mainactivity 中包含slidingmenu,slidingmenu的中间界面 添加了viewpager,viewpager 里面添加了四个fragment。 由于默认v4包里的viewpager 会默认混存数据,即使你设置了setOffscreenPageLimit(0),所以这里替换掉原生的v4包,并且通过fragment 的 setuservisibilityhint 方法来,控制 fragment 界面的动态刷新。 主界面的第一个fragment ,也就是约美女的界面,通过fragmenttabhost,来实现约美女,和看直播的切换。 在约美女中,就是一个简单地pulltorefreshlistview,适配了一个item.点击item 进入用户的个人中心, 个人中心 顶部 是个人的宣传适配,下面,是用户自己上传的 公开专辑,或者私密专辑。可以点赞,关注他。 做任务界面是有两种任务,一种是 每日任务,就是 登陆,签到,另一种是下载app 得积分任务。 下载app 可以控制 下载 暂停。 在我的关注界面。是你关注的好友,这个跟微信的联系人控件是一样的。首字母排序,用到了比较器。 首先 把汉字,对应首字母提取出来,然后与A-Z 排序。以及特殊字符~。 基本代码 整个项目 基本框架 简单描述下 在MainActiviy中初始化 slidingmenu。MainActivity 布局文件 <?xml version="1.0" encoding="utf-8"?> <com.os.slidingmenu.SlidingMenu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sliding="http://schemas.android.com/apk/res-auto" android:id="@+id/slidingmenu" android:layout_width="fill_parent" android:layout_height="fill_parent" sliding:behindOffset="60dp" sliding:fadeEnabled="true" sliding:mode="left" sliding:secondaryShadowDrawable="@drawable/sliding_shadow_right" sliding:shadowDrawable="@drawable/sliding_shadow_left" sliding:shadowWidth="10dp" sliding:touchModeAbove="fullscreen" sliding:touchModeBehind="margin" /> MainActivity这个类进行初始化。代码语言:javascript复制<code class="hljs java has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">package</span> com.os.activity; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> java.lang.ref.WeakReference; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.activity.base.BaseFragmentActivity; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.activity.base.BaseSlidingFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.activity.sliding.LeftFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.activity.sliding.RightFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.slidingmenu.R; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.slidingmenu.SlidingMenu; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.ui.MainHallFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.os.Bundle; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.os.Handler; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.os.Message; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.support.v4.app.Fragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.support.v4.app.FragmentManager; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.support.v4.app.FragmentTransaction; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(102, 0, 102);">MainActivity</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">extends</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(102, 0, 102);">BaseFragmentActivity</span> {</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> Fragment mCurFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">static</span> SlidingMenu mSlidingMenu; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> Handler handler = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> MyHandler(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">this</span>); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">static</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(102, 0, 102);">MyHandler</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">extends</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(102, 0, 102);">Handler</span> {</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">final</span> WeakReference<MainActivity> mActivity; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-title" style="box-sizing: border-box;">MyHandler</span>(MainActivity activity) { mActivity = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> WeakReference<MainActivity>(activity); } <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">handleMessage</span>(Message msg) { MainActivity activity = mActivity.get(); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (activity == <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">return</span>; } activity.handleMsg(msg); } } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">handleMsg</span>(Message msg) { } <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">protected</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">onCreate</span>(Bundle savedInstanceState) { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">super</span>.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initViews(); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (savedInstanceState != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { mCurFragment = getSupportFragmentManager().getFragment(savedInstanceState, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"mCurContent"</span>); } } <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">protected</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">onSaveInstanceState</span>(Bundle outState) { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">super</span>.onSaveInstanceState(outState); getSupportFragmentManager().putFragment(outState, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"mCurContent"</span>, mCurFragment); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">initViews</span>() {<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// 通过id 找到slidingmenu </span> mSlidingMenu = (SlidingMenu) findViewById(R.id.slidingmenu); mSlidingMenu.setMenu(R.layout.sliding_left_frame);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//给slidingmenu 添加左边的布局</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (getFragmentByTag(LeftFragment.class) == <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) {<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//添加左边fragment</span> getSupportFragmentManager().beginTransaction().add(R.id.left_frame, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> LeftFragment(), LeftFragment.class.getName()).commit(); } mSlidingMenu.setContent(R.layout.sliding_center_frame);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//添加一个空布局,后面承载 中间的fragment</span> mSlidingMenu.setSecondaryMenu(R.layout.sliding_right_frame);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//添加右面的布局,添加右边的fragment</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (getFragmentByTag(RightFragment.class) == <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { getSupportFragmentManager().beginTransaction().add(R.id.right_frame, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> RightFragment(), RightFragment.class.getName()).commit(); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (mCurFragment != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { postSwitchFragment(); } mSlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置滑动模式,边缘 还是整个界面</span> } <span class="hljs-javadoc" style="color: rgb(136, 0, 0); box-sizing: border-box;">/** * slidingMenu中的内容Fragment切换(左侧菜单触发) * *<span class="hljs-javadoctag" style="color: rgb(102, 0, 102); box-sizing: border-box;"> @param</span> clazz */</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">switchCenterFragment</span>(Class<? extends Fragment> clazz) { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">try</span> { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (mSlidingMenu == <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { removeAllFragments(); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">return</span>; } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">boolean</span> isInit = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">false</span>; FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); Fragment userFragment = fm.findFragmentByTag(clazz.getName()); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (userFragment == <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { isInit = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">true</span>; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">try</span> { userFragment = clazz.newInstance(); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (InstantiationException e) { e.printStackTrace(); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (IllegalAccessException e) { e.printStackTrace(); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (Exception e) { e.printStackTrace(); } } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (mCurFragment != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span> mCurFragment != userFragment) { ft.hide(mCurFragment); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (!userFragment.isAdded() isInit) { ft.add(R.id.center_frame, userFragment, clazz.getName()); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">else</span> { ft.show(userFragment); } ft.commitAllowingStateLoss(); mCurFragment = userFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (MainHallFragment.class.getName().equals(clazz.getName())) { mSlidingMenu.setMode(SlidingMenu.LEFT_RIGHT); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (!isInit) { ((MainHallFragment) userFragment).postScrollTop(); } } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">else</span> { mSlidingMenu.setMode(SlidingMenu.LEFT_RIGHT); } postShowContent(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">200</span>); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (Exception e) { e.printStackTrace(); } } <span class="hljs-javadoc" style="color: rgb(136, 0, 0); box-sizing: border-box;">/** * lidingMenu中的内容Fragment内容过滤(右侧菜单触发) * *<span class="hljs-javadoctag" style="color: rgb(102, 0, 102); box-sizing: border-box;"> @param</span> clazz *<span class="hljs-javadoctag" style="color: rgb(102, 0, 102); box-sizing: border-box;"> @param</span> type */</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">filterCenterFragment</span>(Class<? extends BaseSlidingFragment> clazz, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> type) { BaseSlidingFragment userFragment = (BaseSlidingFragment) getFragmentByTag(clazz); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (userFragment != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { userFragment.filter(type); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (mSlidingMenu != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) mSlidingMenu.showContent(); } <span class="hljs-javadoc" style="color: rgb(136, 0, 0); box-sizing: border-box;">/** * 延迟切换Fragment */</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">postSwitchFragment</span>() { handler.postDelayed(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Runnable() { <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">run</span>() { switchCenterFragment(mCurFragment.getClass()); } }, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">50</span>); } <span class="hljs-javadoc" style="color: rgb(136, 0, 0); box-sizing: border-box;">/** * 清除FragmentManager中所有Fragment */</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">removeAllFragments</span>() { FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> i = <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>; i < LeftFragment.FRAGMENTS_CLASSES.length; i++) { Fragment fragment = getFragmentByTag(LeftFragment.FRAGMENTS_CLASSES[i].getName()); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (fragment != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { ft.remove(fragment); } } ft.commitAllowingStateLoss(); } <span class="hljs-javadoc" style="color: rgb(136, 0, 0); box-sizing: border-box;">/** * 延时mSlidingMenu.showContent() * *<span class="hljs-javadoctag" style="color: rgb(102, 0, 102); box-sizing: border-box;"> @param</span> delayMillis 延时时间 单位毫秒 */</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">postShowContent</span>(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">long</span> delayMillis) { handler.postDelayed(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Runnable() { <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">run</span>() { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (mSlidingMenu!=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span> !MainActivity.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">this</span>.isFinishing()) { mSlidingMenu.showContent(); } } }, delayMillis); } } /* * 提示:该行代码过长,系统自动注释不进行高亮。一键复制会移除系统注释 * </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li><li style="box-sizing: border-box; padding: 0px 5px;">20</li><li style="box-sizing: border-box; padding: 0px 5px;">21</li><li style="box-sizing: border-box; padding: 0px 5px;">22</li><li style="box-sizing: border-box; padding: 0px 5px;">23</li><li style="box-sizing: border-box; padding: 0px 5px;">24</li><li style="box-sizing: border-box; padding: 0px 5px;">25</li><li style="box-sizing: border-box; padding: 0px 5px;">26</li><li style="box-sizing: border-box; padding: 0px 5px;">27</li><li style="box-sizing: border-box; padding: 0px 5px;">28</li><li style="box-sizing: border-box; padding: 0px 5px;">29</li><li style="box-sizing: border-box; padding: 0px 5px;">30</li><li style="box-sizing: border-box; padding: 0px 5px;">31</li><li style="box-sizing: border-box; padding: 0px 5px;">32</li><li style="box-sizing: border-box; padding: 0px 5px;">33</li><li style="box-sizing: border-box; padding: 0px 5px;">34</li><li style="box-sizing: border-box; padding: 0px 5px;">35</li><li style="box-sizing: border-box; padding: 0px 5px;">36</li><li style="box-sizing: border-box; padding: 0px 5px;">37</li><li style="box-sizing: border-box; padding: 0px 5px;">38</li><li style="box-sizing: border-box; padding: 0px 5px;">39</li><li style="box-sizing: border-box; padding: 0px 5px;">40</li><li style="box-sizing: border-box; padding: 0px 5px;">41</li><li style="box-sizing: border-box; padding: 0px 5px;">42</li><li style="box-sizing: border-box; padding: 0px 5px;">43</li><li style="box-sizing: border-box; padding: 0px 5px;">44</li><li style="box-sizing: border-box; padding: 0px 5px;">45</li><li style="box-sizing: border-box; padding: 0px 5px;">46</li><li style="box-sizing: border-box; padding: 0px 5px;">47</li><li style="box-sizing: border-box; padding: 0px 5px;">48</li><li style="box-sizing: border-box; padding: 0px 5px;">49</li><li style="box-sizing: border-box; padding: 0px 5px;">50</li><li style="box-sizing: border-box; padding: 0px 5px;">51</li><li style="box-sizing: border-box; padding: 0px 5px;">52</li><li style="box-sizing: border-box; padding: 0px 5px;">53</li><li style="box-sizing: border-box; padding: 0px 5px;">54</li><li style="box-sizing: border-box; padding: 0px 5px;">55</li><li style="box-sizing: border-box; padding: 0px 5px;">56</li><li style="box-sizing: border-box; padding: 0px 5px;">57</li><li style="box-sizing: border-box; padding: 0px 5px;">58</li><li style="box-sizing: border-box; padding: 0px 5px;">59</li><li style="box-sizing: border-box; padding: 0px 5px;">60</li><li style="box-sizing: border-box; padding: 0px 5px;">61</li><li style="box-sizing: border-box; padding: 0px 5px;">62</li><li style="box-sizing: border-box; padding: 0px 5px;">63</li><li style="box-sizing: border-box; padding: 0px 5px;">64</li><li style="box-sizing: border-box; padding: 0px 5px;">65</li><li style="box-sizing: border-box; padding: 0px 5px;">66</li><li style="box-sizing: border-box; padding: 0px 5px;">67</li><li style="box-sizing: border-box; padding: 0px 5px;">68</li><li style="box-sizing: border-box; padding: 0px 5px;">69</li><li style="box-sizing: border-box; padding: 0px 5px;">70</li><li style="box-sizing: border-box; padding: 0px 5px;">71</li><li style="box-sizing: border-box; padding: 0px 5px;">72</li><li style="box-sizing: border-box; padding: 0px 5px;">73</li><li style="box-sizing: border-box; padding: 0px 5px;">74</li><li style="box-sizing: border-box; padding: 0px 5px;">75</li><li style="box-sizing: border-box; padding: 0px 5px;">76</li><li style="box-sizing: border-box; padding: 0px 5px;">77</li><li style="box-sizing: border-box; padding: 0px 5px;">78</li><li style="box-sizing: border-box; padding: 0px 5px;">79</li><li style="box-sizing: border-box; padding: 0px 5px;">80</li><li style="box-sizing: border-box; padding: 0px 5px;">81</li><li style="box-sizing: border-box; padding: 0px 5px;">82</li><li style="box-sizing: border-box; padding: 0px 5px;">83</li><li style="box-sizing: border-box; padding: 0px 5px;">84</li><li style="box-sizing: border-box; padding: 0px 5px;">85</li><li style="box-sizing: border-box; padding: 0px 5px;">86</li><li style="box-sizing: border-box; padding: 0px 5px;">87</li><li style="box-sizing: border-box; padding: 0px 5px;">88</li><li style="box-sizing: border-box; padding: 0px 5px;">89</li><li style="box-sizing: border-box; padding: 0px 5px;">90</li><li style="box-sizing: border-box; padding: 0px 5px;">91</li><li style="box-sizing: border-box; padding: 0px 5px;">92</li><li style="box-sizing: border-box; padding: 0px 5px;">93</li><li style="box-sizing: border-box; padding: 0px 5px;">94</li><li style="box-sizing: border-box; padding: 0px 5px;">95</li><li style="box-sizing: border-box; padding: 0px 5px;">96</li><li style="box-sizing: border-box; padding: 0px 5px;">97</li><li style="box-sizing: border-box; padding: 0px 5px;">98</li><li style="box-sizing: border-box; padding: 0px 5px;">99</li><li style="box-sizing: border-box; padding: 0px 5px;">100</li><li style="box-sizing: border-box; padding: 0px 5px;">101</li><li style="box-sizing: border-box; padding: 0px 5px;">102</li><li style="box-sizing: border-box; padding: 0px 5px;">103</li><li style="box-sizing: border-box; padding: 0px 5px;">104</li><li style="box-sizing: border-box; padding: 0px 5px;">105</li><li style="box-sizing: border-box; padding: 0px 5px;">106</li><li style="box-sizing: border-box; padding: 0px 5px;">107</li><li style="box-sizing: border-box; padding: 0px 5px;">108</li><li style="box-sizing: border-box; padding: 0px 5px;">109</li><li style="box-sizing: border-box; padding: 0px 5px;">110</li><li style="box-sizing: border-box; padding: 0px 5px;">111</li><li style="box-sizing: border-box; padding: 0px 5px;">112</li><li style="box-sizing: border-box; padding: 0px 5px;">113</li><li style="box-sizing: border-box; padding: 0px 5px;">114</li><li style="box-sizing: border-box; padding: 0px 5px;">115</li><li style="box-sizing: border-box; padding: 0px 5px;">116</li><li style="box-sizing: border-box; padding: 0px 5px;">117</li><li style="box-sizing: border-box; padding: 0px 5px;">118</li><li style="box-sizing: border-box; padding: 0px 5px;">119</li><li style="box-sizing: border-box; padding: 0px 5px;">120</li><li style="box-sizing: border-box; padding: 0px 5px;">121</li><li style="box-sizing: border-box; padding: 0px 5px;">122</li><li style="box-sizing: border-box; padding: 0px 5px;">123</li><li style="box-sizing: border-box; padding: 0px 5px;">124</li><li style="box-sizing: border-box; padding: 0px 5px;">125</li><li style="box-sizing: border-box; padding: 0px 5px;">126</li><li style="box-sizing: border-box; padding: 0px 5px;">127</li><li style="box-sizing: border-box; padding: 0px 5px;">128</li><li style="box-sizing: border-box; padding: 0px 5px;">129</li><li style="box-sizing: border-box; padding: 0px 5px;">130</li><li style="box-sizing: border-box; padding: 0px 5px;">131</li><li style="box-sizing: border-box; padding: 0px 5px;">132</li><li style="box-sizing: border-box; padding: 0px 5px;">133</li><li style="box-sizing: border-box; padding: 0px 5px;">134</li><li style="box-sizing: border-box; padding: 0px 5px;">135</li><li style="box-sizing: border-box; padding: 0px 5px;">136</li><li style="box-sizing: border-box; padding: 0px 5px;">137</li><li style="box-sizing: border-box; padding: 0px 5px;">138</li><li style="box-sizing: border-box; padding: 0px 5px;">139</li><li style="box-sizing: border-box; padding: 0px 5px;">140</li><li style="box-sizing: border-box; padding: 0px 5px;">141</li><li style="box-sizing: border-box; padding: 0px 5px;">142</li><li style="box-sizing: border-box; padding: 0px 5px;">143</li><li style="box-sizing: border-box; padding: 0px 5px;">144</li><li style="box-sizing: border-box; padding: 0px 5px;">145</li><li style="box-sizing: border-box; padding: 0px 5px;">146</li><li style="box-sizing: border-box; padding: 0px 5px;">147</li><li style="box-sizing: border-box; padding: 0px 5px;">148</li><li style="box-sizing: border-box; padding: 0px 5px;">149</li><li style="box-sizing: border-box; padding: 0px 5px;">150</li><li style="box-sizing: border-box; padding: 0px 5px;">151</li><li style="box-sizing: border-box; padding: 0px 5px;">152</li><li style="box-sizing: border-box; padding: 0px 5px;">153</li><li style="box-sizing: border-box; padding: 0px 5px;">154</li><li style="box-sizing: border-box; padding: 0px 5px;">155</li><li style="box-sizing: border-box; padding: 0px 5px;">156</li><li style="box-sizing: border-box; padding: 0px 5px;">157</li><li style="box-sizing: border-box; padding: 0px 5px;">158</li><li style="box-sizing: border-box; padding: 0px 5px;">159</li><li style="box-sizing: border-box; padding: 0px 5px;">160</li><li style="box-sizing: border-box; padding: 0px 5px;">161</li><li style="box-sizing: border-box; padding: 0px 5px;">162</li><li style="box-sizing: border-box; padding: 0px 5px;">163</li><li style="box-sizing: border-box; padding: 0px 5px;">164</li><li style="box-sizing: border-box; padding: 0px 5px;">165</li><li style="box-sizing: border-box; padding: 0px 5px;">166</li><li style="box-sizing: border-box; padding: 0px 5px;">167</li><li style="box-sizing: border-box; padding: 0px 5px;">168</li><li style="box-sizing: border-box; padding: 0px 5px;">169</li><li style="box-sizing: border-box; padding: 0px 5px;">170</li><li style="box-sizing: border-box; padding: 0px 5px;">171</li><li style="box-sizing: border-box; padding: 0px 5px;">172</li><li style="box-sizing: border-box; padding: 0px 5px;">173</li><li style="box-sizing: border-box; padding: 0px 5px;">174</li><li style="box-sizing: border-box; padding: 0px 5px;">175</li><li style="box-sizing: border-box; padding: 0px 5px;">176</li><li style="box-sizing: border-box; padding: 0px 5px;">177</li><li style="box-sizing: border-box; padding: 0px 5px;">178</li><li style="box-sizing: border-box; padding: 0px 5px;">179</li><li style="box-sizing: border-box; padding: 0px 5px;">180</li><li style="box-sizing: border-box; padding: 0px 5px;">181</li><li style="box-sizing: border-box; padding: 0px 5px;">182</li><li style="box-sizing: border-box; padding: 0px 5px;">183</li><li style="box-sizing: border-box; padding: 0px 5px;">184</li><li style="box-sizing: border-box; padding: 0px 5px;">185</li><li style="box-sizing: border-box; padding: 0px 5px;">186</li><li style="box-sizing: border-box; padding: 0px 5px;">187</li><li style="box-sizing: border-box; padding: 0px 5px;">188</li><li style="box-sizing: border-box; padding: 0px 5px;">189</li><li style="box-sizing: border-box; padding: 0px 5px;">190</li><li style="box-sizing: border-box; padding: 0px 5px;">191</li><li style="box-sizing: border-box; padding: 0px 5px;">192</li><li style="box-sizing: border-box; padding: 0px 5px;">193</li><li style="box-sizing: border-box; padding: 0px 5px;">194</li><li style="box-sizing: border-box; padding: 0px 5px;">195</li><li style="box-sizing: border-box; padding: 0px 5px;">196</li><li style="box-sizing: border-box; padding: 0px 5px;">197</li><li style="box-sizing: border-box; padding: 0px 5px;">198</li><li style="box-sizing: border-box; padding: 0px 5px;">199</li><li style="box-sizing: border-box; padding: 0px 5px;">200</li><li style="box-sizing: border-box; padding: 0px 5px;">201</li></ul> */ 左边的fragment代码语言:javascript复制<code class="hljs java has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">package</span> com.os.activity.sliding; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> java.util.Arrays; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.activity.MainActivity; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.activity.base.BaseSlidingFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.slidingmenu.R; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.ui.FollowFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.ui.MainHallFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> com.os.ui.RankFragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.app.ProgressDialog; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.graphics.Bitmap; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.graphics.BitmapFactory; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.graphics.Color; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.os.Bundle; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.support.v4.app.Fragment; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.text.Spannable; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.text.SpannableStringBuilder; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.text.style.ForegroundColorSpan; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.view.Gravity; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.view.View; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.view.View.OnClickListener; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.view.ViewGroup.LayoutParams; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.widget.Button; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.widget.ImageView; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.widget.LinearLayout; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.widget.PopupWindow; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.widget.TextView; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> android.widget.Toast; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(102, 0, 102);">LeftFragment</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">extends</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(102, 0, 102);">BaseSlidingFragment</span> {</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">final</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">static</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> MENU_NORMAL_ICONS[] = { R.drawable.sliding_livehall_icon_normal, R.drawable.sliding_follow_icon_normal, R.drawable.sliding_rank_icon_normal}; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">final</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">static</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> MENU_CHECKED_ICONS[] = { R.drawable.sliding_livehall_icon_checked, R.drawable.sliding_follow_icon_checked, R.drawable.sliding_rank_icon_checked }; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">final</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">static</span> Class[] FRAGMENTS_CLASSES = { MainHallFragment.class, FollowFragment.class, RankFragment.class};<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//左侧切换显示中间的三个界面</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> View[] mMenuLayouts; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> ImageView[] mMenuIcons; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> TextView[] mMenuTexts; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> Bitmap mLoadingBitmap; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> mCurrentIndex = -<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>; <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">onCreate</span>(Bundle savedInstanceState) { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">super</span>.onCreate(savedInstanceState); setContentView(R.layout.sliding_left); setData(); changeMenuByClass(MainHallFragment.class);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//默认中间的界面显示的是这个MainHallFragment</span> } <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">initViews</span>() { mMenuLayouts = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> View[] { findViewById(R.id.menu_livehall_layout), findViewById(R.id.menu_follow_layout), findViewById(R.id.menu_rank_layout) }; mMenuIcons = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> ImageView[] { (ImageView) findViewById(R.id.menu_livehall_icon), (ImageView) findViewById(R.id.menu_follow_icon), (ImageView) findViewById(R.id.menu_rank_icon) }; mMenuTexts = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> TextView[] { (TextView) findViewById(R.id.menu_livehall_text), (TextView) findViewById(R.id.menu_follow_text), (TextView) findViewById(R.id.menu_rank_text),}; } <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">addListener</span>() { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> i = <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>; i < mMenuLayouts.length; i++) { mMenuLayouts[i].setTag(i); mMenuLayouts[i].setOnClickListener(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> OnClickListener() { <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">onClick</span>(View v) { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> index = (Integer) v.getTag(); changeMenuByIndex(index); } }); } } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">setData</span>() { } <span class="hljs-javadoc" style="color: rgb(136, 0, 0); box-sizing: border-box;">/** * 通过索引改变Menu * *<span class="hljs-javadoctag" style="color: rgb(102, 0, 102); box-sizing: border-box;"> @param</span> index */</span> <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@SuppressWarnings</span>(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"unchecked"</span>) <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">changeMenuByIndex</span>(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> index) { Class<? extends Fragment> clazz = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (mCurrentIndex != index) { clearMenu(); setMenuChecked(index); } clazz = FRAGMENTS_CLASSES[index]; getFragmentActivity(MainActivity.class).switchCenterFragment(clazz); mCurrentIndex = index; } <span class="hljs-javadoc" style="color: rgb(136, 0, 0); box-sizing: border-box;">/** * 通过Fragment类改变menu * *<span class="hljs-javadoctag" style="color: rgb(102, 0, 102); box-sizing: border-box;"> @param</span> clazz */</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">changeMenuByClass</span>(Class<? extends Fragment> clazz) { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> index = Arrays.asList(FRAGMENTS_CLASSES).indexOf(clazz); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (index != -<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>) { changeMenuByIndex(index); } } <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@SuppressWarnings</span>(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"deprecation"</span>) <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">clearMenu</span>() { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> i = <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>; i <= mMenuLayouts.length; i++) { mMenuLayouts[i-<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>].setBackgroundDrawable(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>); mMenuIcons[i - <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>].setImageResource(MENU_NORMAL_ICONS[i - <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>]); mMenuTexts[i - <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>].setTextColor(getResources().getColor(R.color.gray7)); } } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">setMenuChecked</span>(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> index) { <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// if (index == 0) {</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// return;</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// }</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (index != <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> index != <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span>) { mMenuLayouts[index].setBackgroundResource(R.drawable.sliding_menu_checked_bg); } mMenuIcons[index ].setImageResource(MENU_CHECKED_ICONS[index ]); mMenuTexts[index ].setTextColor(getResources().getColor(R.color.white)); } <span class="hljs-annotation" style="color: rgb(155, 133, 157); box-sizing: border-box;">@Override</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">onDestroy</span>() { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (mLoadingBitmap != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span> !mLoadingBitmap.isRecycled()) { mLoadingBitmap.recycle(); mLoadingBitmap = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>; } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">super</span>.onDestroy(); } } /* * 提示:该行代码过长,系统自动注释不进行高亮。一键复制会移除系统注释 * </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li><li style="box-sizing: border-box; padding: 0px 5px;">20</li><li style="box-sizing: border-box; padding: 0px 5px;">21</li><li style="box-sizing: border-box; padding: 0px 5px;">22</li><li style="box-sizing: border-box; padding: 0px 5px;">23</li><li style="box-sizing: border-box; padding: 0px 5px;">24</li><li style="box-sizing: border-box; padding: 0px 5px;">25</li><li style="box-sizing: border-box; padding: 0px 5px;">26</li><li style="box-sizing: border-box; padding: 0px 5px;">27</li><li style="box-sizing: border-box; padding: 0px 5px;">28</li><li style="box-sizing: border-box; padding: 0px 5px;">29</li><li style="box-sizing: border-box; padding: 0px 5px;">30</li><li style="box-sizing: border-box; padding: 0px 5px;">31</li><li style="box-sizing: border-box; padding: 0px 5px;">32</li><li style="box-sizing: border-box; padding: 0px 5px;">33</li><li style="box-sizing: border-box; padding: 0px 5px;">34</li><li style="box-sizing: border-box; padding: 0px 5px;">35</li><li style="box-sizing: border-box; padding: 0px 5px;">36</li><li style="box-sizing: border-box; padding: 0px 5px;">37</li><li style="box-sizing: border-box; padding: 0px 5px;">38</li><li style="box-sizing: border-box; padding: 0px 5px;">39</li><li style="box-sizing: border-box; padding: 0px 5px;">40</li><li style="box-sizing: border-box; padding: 0px 5px;">41</li><li style="box-sizing: border-box; padding: 0px 5px;">42</li><li style="box-sizing: border-box; padding: 0px 5px;">43</li><li style="box-sizing: border-box; padding: 0px 5px;">44</li><li style="box-sizing: border-box; padding: 0px 5px;">45</li><li style="box-sizing: border-box; padding: 0px 5px;">46</li><li style="box-sizing: border-box; padding: 0px 5px;">47</li><li style="box-sizing: border-box; padding: 0px 5px;">48</li><li style="box-sizing: border-box; padding: 0px 5px;">49</li><li style="box-sizing: border-box; padding: 0px 5px;">50</li><li style="box-sizing: border-box; padding: 0px 5px;">51</li><li style="box-sizing: border-box; padding: 0px 5px;">52</li><li style="box-sizing: border-box; padding: 0px 5px;">53</li><li style="box-sizing: border-box; padding: 0px 5px;">54</li><li style="box-sizing: border-box; padding: 0px 5px;">55</li><li style="box-sizing: border-box; padding: 0px 5px;">56</li><li style="box-sizing: border-box; padding: 0px 5px;">57</li><li style="box-sizing: border-box; padding: 0px 5px;">58</li><li style="box-sizing: border-box; padding: 0px 5px;">59</li><li style="box-sizing: border-box; padding: 0px 5px;">60</li><li style="box-sizing: border-box; padding: 0px 5px;">61</li><li style="box-sizing: border-box; padding: 0px 5px;">62</li><li style="box-sizing: border-box; padding: 0px 5px;">63</li><li style="box-sizing: border-box; padding: 0px 5px;">64</li><li style="box-sizing: border-box; padding: 0px 5px;">65</li><li style="box-sizing: border-box; padding: 0px 5px;">66</li><li style="box-sizing: border-box; padding: 0px 5px;">67</li><li style="box-sizing: border-box; padding: 0px 5px;">68</li><li style="box-sizing: border-box; padding: 0px 5px;">69</li><li style="box-sizing: border-box; padding: 0px 5px;">70</li><li style="box-sizing: border-box; padding: 0px 5px;">71</li><li style="box-sizing: border-box; padding: 0px 5px;">72</li><li style="box-sizing: border-box; padding: 0px 5px;">73</li><li style="box-sizing: border-box; padding: 0px 5px;">74</li><li style="box-sizing: border-box; padding: 0px 5px;">75</li><li style="box-sizing: border-box; padding: 0px 5px;">76</li><li style="box-sizing: border-box; padding: 0px 5px;">77</li><li style="box-sizing: border-box; padding: 0px 5px;">78</li><li style="box-sizing: border-box; padding: 0px 5px;">79</li><li style="box-sizing: border-box; padding: 0px 5px;">80</li><li style="box-sizing: border-box; padding: 0px 5px;">81</li><li style="box-sizing: border-box; padding: 0px 5px;">82</li><li style="box-sizing: border-box; padding: 0px 5px;">83</li><li style="box-sizing: border-box; padding: 0px 5px;">84</li><li style="box-sizing: border-box; padding: 0px 5px;">85</li><li style="box-sizing: border-box; padding: 0px 5px;">86</li><li style="box-sizing: border-box; padding: 0px 5px;">87</li><li style="box-sizing: border-box; padding: 0px 5px;">88</li><li style="box-sizing: border-box; padding: 0px 5px;">89</li><li style="box-sizing: border-box; padding: 0px 5px;">90</li><li style="box-sizing: border-box; padding: 0px 5px;">91</li><li style="box-sizing: border-box; padding: 0px 5px;">92</li><li style="box-sizing: border-box; padding: 0px 5px;">93</li><li style="box-sizing: border-box; padding: 0px 5px;">94</li><li style="box-sizing: border-box; padding: 0px 5px;">95</li><li style="box-sizing: border-box; padding: 0px 5px;">96</li><li style="box-sizing: border-box; padding: 0px 5px;">97</li><li style="box-sizing: border-box; padding: 0px 5px;">98</li><li style="box-sizing: border-box; padding: 0px 5px;">99</li><li style="box-sizing: border-box; padding: 0px 5px;">100</li><li style="box-sizing: border-box; padding: 0px 5px;">101</li><li style="box-sizing: border-box; padding: 0px 5px;">102</li><li style="box-sizing: border-box; padding: 0px 5px;">103</li><li style="box-sizing: border-box; padding: 0px 5px;">104</li><li style="box-sizing: border-box; padding: 0px 5px;">105</li><li style="box-sizing: border-box; padding: 0px 5px;">106</li><li style="box-sizing: border-box; padding: 0px 5px;">107</li><li style="box-sizing: border-box; padding: 0px 5px;">108</li><li style="box-sizing: border-box; padding: 0px 5px;">109</li><li style="box-sizing: border-box; padding: 0px 5px;">110</li><li style="box-sizing: border-box; padding: 0px 5px;">111</li><li style="box-sizing: border-box; padding: 0px 5px;">112</li><li style="box-sizing: border-box; padding: 0px 5px;">113</li><li style="box-sizing: border-box; padding: 0px 5px;">114</li><li style="box-sizing: border-box; padding: 0px 5px;">115</li><li style="box-sizing: border-box; padding: 0px 5px;">116</li><li style="box-sizing: border-box; padding: 0px 5px;">117</li><li style="box-sizing: border-box; padding: 0px 5px;">118</li><li style="box-sizing: border-box; padding: 0px 5px;">119</li><li style="box-sizing: border-box; padding: 0px 5px;">120</li><li style="box-sizing: border-box; padding: 0px 5px;">121</li><li style="box-sizing: border-box; padding: 0px 5px;">122</li><li style="box-sizing: border-box; padding: 0px 5px;">123</li><li style="box-sizing: border-box; padding: 0px 5px;">124</li><li style="box-sizing: border-box; padding: 0px 5px;">125</li><li style="box-sizing: border-box; padding: 0px 5px;">126</li><li style="box-sizing: border-box; padding: 0px 5px;">127</li><li style="box-sizing: border-box; padding: 0px 5px;">128</li><li style="box-sizing: border-box; padding: 0px 5px;">129</li><li style="box-sizing: border-box; padding: 0px 5px;">130</li><li style="box-sizing: border-box; padding: 0px 5px;">131</li><li style="box-sizing: border-box; padding: 0px 5px;">132</li><li style="box-sizing: border-box; padding: 0px 5px;">133</li><li style="box-sizing: border-box; padding: 0px 5px;">134</li><li style="box-sizing: border-box; padding: 0px 5px;">135</li><li style="box-sizing: border-box; padding: 0px 5px;">136</li><li style="box-sizing: border-box; padding: 0px 5px;">137</li><li style="box-sizing: border-box; padding: 0px 5px;">138</li><li style="box-sizing: border-box; padding: 0px 5px;">139</li><li style="box-sizing: border-box; padding: 0px 5px;">140</li><li style="box-sizing: border-box; padding: 0px 5px;">141</li><li style="box-sizing: border-box; padding: 0px 5px;">142</li><li style="box-sizing: border-box; padding: 0px 5px;">143</li><li style="box-sizing: border-box; padding: 0px 5px;">144</li><li style="box-sizing: border-box; padding: 0px 5px;">145</li><li style="box-sizing: border-box; padding: 0px 5px;">146</li><li style="box-sizing: border-box; padding: 0px 5px;">147</li><li style="box-sizing: border-box; padding: 0px 5px;">148</li><li style="box-sizing: border-box; padding: 0px 5px;">149</li><li style="box-sizing: border-box; padding: 0px 5px;">150</li><li style="box-sizing: border-box; padding: 0px 5px;">151</li><li style="box-sizing: border-box; padding: 0px 5px;">152</li><li style="box-sizing: border-box; padding: 0px 5px;">153</li><li style="box-sizing: border-box; padding: 0px 5px;">154</li><li style="box-sizing: border-box; padding: 0px 5px;">155</li><li style="box-sizing: border-box; padding: 0px 5px;">156</li><li style="box-sizing: border-box; padding: 0px 5px;">157</li><li style="box-sizing: border-box; padding: 0px 5px;">158</li><li style="box-sizing: border-box; padding: 0px 5px;">159</li><li style="box-sizing: border-box; padding: 0px 5px;">160</li><li style="box-sizing: border-box; padding: 0px 5px;">161</li><li style="box-sizing: border-box; padding: 0px 5px;">162</li><li style="box-sizing: border-box; padding: 0px 5px;">163</li><li style="box-sizing: border-box; padding: 0px 5px;">164</li><li style="box-sizing: border-box; padding: 0px 5px;">165</li><li style="box-sizing: border-box; padding: 0px 5px;">166</li><li style="box-sizing: border-box; padding: 0px 5px;">167</li><li style="box-sizing: border-box; padding: 0px 5px;">168</li><li style="box-sizing: border-box; padding: 0px 5px;">169</li><li style="box-sizing: border-box; padding: 0px 5px;">170</li><li style="box-sizing: border-box; padding: 0px 5px;">171</li><li style="box-sizing: border-box; padding: 0px 5px;">172</li></ul> */ 主要就是 oncreate 中 初始化 刚启动应用后中间显示的fragment 是 MainHallFragment. 视频时RTMP 协议,解码用的ffmpeg. 代码就不贴了,在工程的jni 目录下,都有注释。 聊天的代码 聊天室界面是 ChatroomActivity. 这是 一初始化MultiUserChat 聊天室对象的代码,具体代码 ,在这个类里面。代码语言:javascript复制<code class="hljs axapta has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Thread() { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> run() { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">try</span> { Thread.sleep(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span> * <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1000</span>); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (InterruptedException e) { e.printStackTrace(); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">count</span> = <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">boolean</span> isRandom = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">false</span>; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">while</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">count</span> <= <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">10</span> !create_flag) { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">count</span>++; <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">try</span> { <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (mHostInfo != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { mUserNickName = getNickName(isRandom); muc = ConnectionUtils.getMultiUserChat(mHostInfo.room_id, mHostInfo.room_service, mUserNickName, mPassword, ChatroomActivity.<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">this</span>); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (muc != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) { create_flag = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">true</span>; <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// 创建聊天室成功,监听聊天室返回的消息</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// 监听消息</span> muc.addMessageListener(packetListener); <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// muc.addParticipantListener(participantListener);</span> muc.addParticipantStatusListener(statusListener); muc.addUserStatusListener(userStatusListener); mHandler.sendEmptyMessageDelayed(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">500</span>); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">else</span> { create_flag = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">false</span>; } } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">else</span> { create_flag = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">false</span>; } <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// } else {</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//</span> <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// }</span> } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (NotFoundException e) { e.printStackTrace(); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (SameException e) {<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// 昵称重复</span> isRandom = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">true</span>; } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (BannedException e) {<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">// 禁止加入房间</span> sendBandHandle(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">15</span>); <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">return</span>; } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (XMPPException e) { e.printStackTrace(); } <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span> (Exception e) { e.printStackTrace(); } }</code>
Flarum搭建论坛详细教程
Flarum搭建论坛详细教程
1、关于Flarum程序完美支持军哥lnmp环境/宝塔等,下载程序上传到网站根目录并需要伪静态+fileinfo扩展。程序本地下载:FlarumChina-beta7.zipGithub下载地址:https://github.com/skywalker512/FlarumChinafileinfo拓展 需要支持php扩展fileinfo。 1、对于lnmp1.3默认没有支持。修改include/upgrade_php.sh这个文件,把其中的:--disable-fileinfo,全部替换:--enable-fileinfo,再执行./upgrade.sh升级php就行了。 2、对于宝塔,安装后,找到你的PHP程序,里面有扩展可以选择安装。2、centos安装LNMP支持flarun2 | 1 数据库安装代码语言:javascript复制sudo wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm yum -y install mysql57-community-release-el7-10.noarch.rpm yum -y install mysql-community-server systemctl start mysqld.service2 | 2 mysql5.7获取密码的方式代码语言:javascript复制sudo grep 'temporary password' /var/log/mysqld.log代码语言:javascript复制vi /etc/my.cnf代码语言:javascript复制#添加validate_password_policy配置 validate_password_policy=0 #关闭密码策略 validate_password = off修改root密码代码语言:javascript复制mysql -uroot -p密码代码语言:javascript复制set global validate_password_policy=0; set global validate_password_length=1; ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!'; grant all privileges on *.* to root@"%" identified by "new password"; flush privileges;代码语言:javascript复制systemctl restart mysql2 | 3 安装php7.2代码语言:javascript复制sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum install php72w-fpm php72w-cli php72w-curl php72w-dom php72w-gd php72w-json php72w-mbstring php72w-openssl php72w-pdo_mysql php72w-tokenizer php72w-zip -y代码语言:javascript复制vim /etc/php-fpm.d/www.conf代码语言:javascript复制#找到以下两处共四行代码并修改如下: user = nginx group = nginx listen.owner = nginx listen.group = nginx3、安装Flarum方法一:下载=即使用整合包https://github.com/skywalker512/FlarumChina/releases/tag/v0.1.0-beta.12方法二:composer拉取 (比较建议后面装插件都是用的composer)3 | 1 安装composer下载composer.phar, 如果是网络原因失败,多试几次代码语言:javascript复制curl -sS https://getcomposer.org/installer | php把composer.phar移动到环境下让其变成可执行:代码语言:javascript复制mv composer.phar /usr/local/bin/composer测试代码语言:javascript复制composer -v修改镜像地址代码语言:javascript复制composer config repo.packagist composer https://mirrors.aliyun.com/composer/3 | 2 安装ningx代码语言:javascript复制yum -y install nginx unzip进入wwwroot目录中使用composer命令来安装flarum:代码语言:javascript复制mkdir /var/www/flarum/ cd /var/www/flarum/代码语言:javascript复制composer create-project flarum/flarum . --stability=beta #不用使用管理员权限命令sudo。完毕后修改nginx中的默认配置文件:代码语言:javascript复制sudo vim /etc/nginx/nginx.conf代码语言:javascript复制#将server代码段下的所有代码都用#注释掉 #server { # listen 80 default_server; # listen [::]:80 default_server; # server_name _; # root /usr/share/nginx/html; # # Load configuration files for the default server block. # include /etc/nginx/default.d/*.conf; # location / { # } # error_page 404 /404.html; # location = /40x.html { # } # error_page 500 502 503 504 /50x.html; # location = /50x.html { # } #} #然后修改 server { listen 80; server_name your.website.url; root /var/www/flarum/public; index index.php index.html; #include /home/flarum/wwwroot/.nginx.conf; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location / { try_files $uri $uri/ /index.php?$query_string; } # The following directives are based on best practices from H5BP Nginx Server Configs # https://github.com/h5bp/server-configs-nginx # Expire rules for static content location ~* \.(?:manifest|appcache|html?|xml|json)$ { add_header Cache-Control "max-age=0"; } location ~* \.(?:rss|atom)$ { add_header Cache-Control "max-age=3600"; } location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ { add_header Cache-Control "max-age=2592000"; access_log off; } location ~* \.(?:css|js)$ { add_header Cache-Control "max-age=31536000"; access_log off; } location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { add_header Cache-Control "max-age=2592000"; access_log off; } # Gzip compression gzip on; gzip_comp_level 5; gzip_min_length 256; gzip_proxied any; gzip_vary on; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; }注意:因为Flarum遵守了最新的安全规范,其程序的运行目录其实是在public文件夹内。4、插件安装https://bbs.csur.fun/d/84-flarum5、虚拟机搭建买个虚拟机做网页,诸多限制,虚拟机服务商的提供的服务确实就两字“操蛋”。 为什么没有买云服务器?就两字 “没钱”!哈哈。 虚拟机的购买途径自寻,但是很多服务商真的很坑爹。 虚拟机要求php支持7.2以上mysql支持5.7以上能够支持更改网站跟目录6、更改网站根目录层级将 public 目录(包括 .htaccess)中的所有文件移动到 Flarum 根目录。然后编辑 .htaccess 取消第 9-14 行的注释,以保护敏感资源。 然后编辑 index.php 文件,更改以下行:代码语言:javascript复制$site = require './site.php';最后,在 site.php 更新路径,以反映新的目录结构:代码语言:javascript复制'base' => __DIR__, 'public' => __DIR__, 'storage' => __DIR__.'/storage',config.php 更新 url 路径代码语言:javascript复制'url' => 'https://xxx.com/community',不更改网站层级目录请根据你的虚拟主机面板的不同,将网站运行目录指向public文件夹。 如果您使用的是虚拟主机无法更改目录,请按照一下的方法进行设置 在根目录下新建一个名为 .htaccess的文件代码语言:javascript复制RewriteEngine on RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(.*)$ /public/$1 [L]7、其他底部加统计代码语言:javascript复制vendor/flarum/core/views/app.blade.php去掉网络字体代码语言:javascript复制vendor/flarum/core/src/Http/WebApp/WebAppView.php伪静态设置Nginx的话在站点配置文件处添加下面一段话。代码语言:javascript复制location / { try_files $uri $uri/ /index.php?$query_string; } location /api { try_files $uri $uri/ /api.php?$query_string; } location /admin { try_files $uri $uri/ /admin.php?$query_string; } location /flarum { deny all; return 404; } location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; }
一些关于网站推广问题合集。
一些关于网站推广问题合集。
网站怎么快速上权重?要让一个网站快速提高权重,需要实施以下一些有效的策略:提供高质量的内容:提供高质量、原创、有用的内容是最重要的。这可以吸引更多的用户访问,并增加用户留存时间,提高用户体验。同时,高质量的内容也会被其他网站引用和分享,这将有助于增加外部链接,提高网站的权重。内部链接优化:内部链接是指在网站内部不同页面之间的链接。通过优化内部链接结构,可以增加搜索引擎对网站的理解,提高网站权重。在内部链接时,要使用相关的关键字作为链接文本,而不是使用"点击这里"这样无意义的链接文本。外部链接建设:获取来自其他网站的高质量链接对于提高网站权重非常重要。可以通过主动进行友情链接、媒体报道、论坛发帖等方式增加外部链接。但是请注意,建立外部链接是需要花费时间和精力的,必须确保链接是高质量的、自然的,否则可能会适得其反。社交媒体推广:在社交媒体平台上建立专业的社交媒体账号,提供网站相关的信息、文章、图像、视频等,让更多的用户了解网站,增加网站的曝光度,进而增加网站权重。网站结构优化:优化网站结构可以帮助搜索引擎更好地抓取和理解网站内容,提高网站权重。可以通过优化网站的HTML代码结构、网站的目录结构、网站的图片和视频的优化等方式实现。需要注意的是,这些策略需要长期坚持和不断完善,才能够取得长期、稳定的效果。怎么养站?要养好一个网站,需要考虑以下几个方面:网站内容:一个网站需要有高质量、有价值的内容来吸引用户。内容可以是文字、图片、视频等形式,需要有足够的量和质量,同时需要及时更新。网站设计:网站的设计需要符合用户的视觉需求,界面简洁、易于操作、美观大方,同时需要考虑不同设备(如手机、平板、电脑)的适配。网站优化:通过搜索引擎优化(SEO)、网站性能优化(如减少页面加载时间)、提高用户体验(如减少广告干扰),来提高网站的流量和用户满意度。社交媒体:通过社交媒体来吸引用户,增加网站的曝光率和影响力,比如可以在微信公众号、微博、知乎等平台上发布内容,吸引用户关注。安全保护:确保网站的安全性,包括用户信息保护、反垃圾邮件、反病毒等安全措施。数据分析:通过数据分析工具,了解用户访问情况,优化网站的运营,提高用户满意度和转化率。综合考虑上述因素,不断更新和改进,就可以养好一个网站。网站怎么发外链有用?要使外链对你的网站有用,你需要遵循以下几个步骤:确定目标受众和内容:确定你要向哪些人推广内容,以及他们可能对哪些内容感兴趣。通过创建高质量的内容,吸引用户来阅读你的文章并点击你的链接。找到相关的网站:寻找与你的内容相关的网站,并联系网站所有者以获得一个外链。你可以通过搜索引擎、社交媒体、行业博客等方式来找到这些网站。站长百科网创建有价值的内容:创建有价值的内容可以吸引其他网站链接到你的网站。确保你的内容是高质量的,包含有用的信息,且易于阅读和分享。联系其他网站:直接联系其他网站的所有者,请求他们在他们的网站上添加你的链接。你可以通过电子邮件、社交媒体或其他渠道来联系他们。使用社交媒体:在社交媒体上分享你的内容,并鼓励其他用户分享你的文章。这样可以提高你的内容的曝光率,并吸引更多的用户来访问你的网站。需要注意的是,对于外链的数量和质量,搜索引擎有一定的要求,如果采用不当的方式获取外链,可能会对你的网站产生负面影响。因此,你需要遵守搜索引擎的规则,采用合法的方式获取外链,从而为你的网站带来更多的流量和排名提升。2023年建什么类型的网站有前景?2023年,移动端和云端应用程序将继续受到极大的关注,尤其是基于AI的应用程序。有预测认为,2023年将会出现大量的智能家居、自动驾驶、语音助手等应用,这些网站将具有更大的前景。收藏 | 0点赞 | 0打赏
AI对话
AI-based translation tools: Analysis and comparison of the best ones
AI-based translation tools
Analysis and comparison of the best ones
As globalization increases, companies and individuals are finding it necessary to communicate more frequently with people who speak different languages.As a result, the need for translation tools has become more pressing.The good news is that there are now AI-based translation tools that make the process of translating text and speech faster and more accurate than ever before.In this article, I will analyze and compare the best AI-based translation tools available, discussing their advantages, features and drawbacks.Introduction to AI-based translation toolsAI-based translation tools use artificial intelligence to translate text and speech from one language to another. These tools have become increasingly popular in recent years thanks to advances in machine learning and natural language processing. Such tools are faster, more accurate and can handle a higher volume of work.Benefits of using AI-based translation toolsOne of the main advantages of using AI-based translation tools is speed. These tools can translate large volumes of text in a matter of seconds, whereas it would take a human translator much longer to do the same job.They are less likely to make mistakes and can also be used to translate speeches in real time, which makes them very useful for international conferences or business meetings.Popular AI-based translation tools and their featuresThere are many AI-based translation tools, each with its own unique features. Here are some of the most popular ones and what they offer:1. Google TranslateGoogle Translate is one of the most well-known AI-based translation tools. It offers translations in over 100 languages and can be used to translate text, speech, and even images. Google Translate also offers a feature called “Conversation Mode,” which allows two people to have a conversation in different languages using the same device.2. Microsoft TranslatorMicrosoft Translator is another popular AI-based translation tool. It offers translations in over 60 languages and can be used to translate text, speech, and images. Microsoft Translator also offers a feature called “Live Feature,” which allows two people to have a conversation in different languages using their own devices.3. DeepLDeepL is a newer AI-based translation tool, but it has quickly gained popularity thanks to its high-quality translations. It offers translations in nine languages and can be used to translate text. DeepL uses deep learning algorithms to produce translations that are more accurate and natural-sounding than those produced by other translation tools.4. LIKE.TG TranslateLIKE.TG Translate is a relatively new AI-based translation tool that has gained popularity in recent years. It is available in over 125 languages and can translate text, voice and images. One of the unique features of LIKE.TG Translate is its ability to translate text within other apps.The best feature of these apps is that not only do they base their translation using AI but they have a team of native translators behind them constantly improving their applications to make them even better.Factors to consider when choosing an AI-based translation toolWhen choosing an AI-based translation tool, there are several factors to consider. The first is the languages you need to translate. Make sure the tool you choose supports the languages you need. The second factor is the type of translations you need. Do you need to translate text, speech, or images? Do you need real-time translation for conversations? The third factor is the accuracy of the translations. Consider the quality of the translations produced by each tool. Lastly, consider the cost of the tool. Some AI-based translation tools are free, while others require a subscription or payment per use.Pros and cons of using AI-based translation toolsLike any tool, AI-based translation tools have pros and cons. Here are some of the main advantages and drawbacks of using these tools:After a thorough analysis, I can faithfully describe to you some of the most characteristic pros and cons of these tools:PROSAccuracy: These tools are able to better understand the context and syntax of the language, which translates into greater translation accuracy.Speed: Translating large amounts of text can take a long time if done manually, whereas AI-based translation tools are able to process large amounts of text in a matter of seconds.Cost savings: AI-based translation tools are often less expensive than human translation services, especially for large projects.Integrations: Many of these tools integrate with other platforms and productivity tools, making them easy to use in different contexts.CONSLack of context: These tools often lack context, which can result in inaccurate or inconsistent translations. For example, a literal translation of a sentence in one language into another may not take into account cultural connotations or social context and result in a translation that makes no sense.Lack of accuracy: Although AI-based translation tools have improved significantly in recent years, they are still not as accurate as humans. Translations can be inaccurate or have grammatical and spelling errors, especially in more complex or technical languages.They cannot capture nuances or tones: Such translation tools cannot capture nuances or tones that are often important in human communication. For example, they may miss the sarcastic or ironic tone of a sentence and translate it literally.Language dependency: language dependent, meaning that they work best for translating between widely spoken and documented languages but do not represent less common languages or regional dialects well. .Cost: While there are some available for free, many of the high-quality tools are quite expensive.Lack of customization: AI-based translation tools cannot be customized to meet the specific needs of an individual or company. This can limit their usefulness especially when highly specialized or technical translation is required.Privacy and security: Some tools collect and store sensitive data, which can raise serious concerns about data privacy and security.In conclusion, AI-based translation tools offer a number of advantages in terms of speed, accuracy and cost, but it is important to be aware of their limitations and challenges when selecting a tool.How AI-based translation tools are changing the translation industryAI-based translation tools are changing the translation industry in several ways. The first is that the translation process is faster and more efficient. This allows translators to handle larger volumes of work and deliver projects faster. The second way in which they are changing the industry is that specialized translators are becoming more in demand, as human quality is irreplaceable and although they can do basic translations, they have problems with technical or specialized language.This means that specialized translators in certain areas are more in demand than ever.The future of AI-based translation toolsThe future of AI-based translation tools is bright. As technology continues to advance, these tools will become even more sophisticated and accurate. We may eventually see a tool capable of handling all forms of language, including slang and regional dialects. It is also possible that they will become more integrated into our daily lives, allowing us to communicate with people who speak different languages more easily than ever before, yet experts continue to warn that humans cannot be replaced.Conclusion and recommendations for the best AI-based translation toolsIn conclusion, AI-based translation tools offer many advantages over traditional methods. They are faster, more accurate and can handle a higher volume of work. However, it is important to consider the languages you need to translate, the type of translations you need, the accuracy of the translations and the cost of the tool when choosing an AI-based translation tool, because at the end of the day no AI can replace a human being, nor can it emulate the human quality that a human being can bring to us.Based on our analysis and comparison, we recommend Google Translate for its versatility and variety of features. However, if you need high quality translations, LIKE.TG Translate may be the best choice.REMEMBER !!!You can downloadour available appsfor translating and learning languages correctly available for free on googleplay and applestores.Do not hesitate to visit ourLIKE.TG websiteand contact us with any questions or problems you may have, and of course, take a look at any ofour blog articles.
Artificial intelligence in translation
Artificial intelligence in translation
Artificial intelligence is revolutionising every area it touches, and translation is no exception. Over time, automatic translators have become more sophisticated and have reached a level of accuracy that was unthinkable years ago.Now, with artificial intelligence, everything suggests that we will once again experience a revolution in translation that will change the way we communicate, improving its efficiency and almost completely eliminating language barriers. Let’s take a look at the advantages this will bring to our day-to-day lives.Advantages of AI in translationTranslation of large amounts of dataOne of the advantages of artificial intelligence in translation is its ability to process large amounts of text in multiple languages in a very short time with significantly better results than traditional machine translation, allowing for faster and more agile translation of documents and texts.More accurate translationArtificial intelligence offers suggestions and recommendations based on the specific context and domain of the text you are translating. This helps to improve coherence and consistency in translated texts.Real-time translationIn addition to translating large amounts of data and more accurate translation, artificial intelligence significantly improves real-time translation and improves fluency in multilingual situations.Imagine a work meeting with people from different parts of the world, each one of them speaking a different language. Thanks to advances in artificial intelligence and translation, every member of the group could listen to the meeting in their mother tongue and communicate with the rest of the people, reducing costs and time.As in the previous case, we could extrapolate this to a live broadcast on Twitch or via YouTube channels.Audio and video transcriptionTraditional transcription techniques are often laborious and slow. The implementation of artificial intelligence makes possible to transcribe audio and video content with incredible accuracy and speed.This has opened up new opportunities for content creators, media professionals and businesses looking to harness the power of audio and video content.The future of artificial intelligence and translationAt LIKE.TG we have been working closely with artificial intelligence for months in order to bring new and better translation experiences to our users. The potential offered by this technology is incredible and we are very excited about the new possibilities it presents us with.As a technologist, I see how AI and the fourth industrial revolution will affect all aspects of people’s lives. Fei-Fei Li, professor of computer science at Stanford UniversityThanks to artificial intelligence we have been able to improve, for example, voice translation, achieving much more accurate detection than with traditional methods. We have integrated translation and augmented reality (AR) to offer a new experience where you can translate conversations in real time or any object around you.Artificial intelligence will not replace human translationAlthough we see that advances in artificial intelligence are promising, human translation will continue to be necessary. AI is a great help and complements the work of human translators, but it cannot completely replace their expertise and cultural knowledge.We should not rely entirely on the results of artificial intelligence, especially in cases where understanding is crucial and misunderstanding can cause irreparable damage.Translation is a complex process involving contextual understanding, wordplay and cultural adaptation, where humans remain indispensable.
加入like.tg生态圈,即可获利、结识全球供应商、拥抱全球软件生态圈加入like.tg生态圈,即可获利、结识全球供应商、拥抱全球软件生态圈加入like.tg生态圈,即可获利、结识全球供应商、拥抱全球软件生态圈