CN103942039A - Method for switching games/having access to platform in task window of mobile phone - Google Patents

Method for switching games/having access to platform in task window of mobile phone Download PDF

Info

Publication number
CN103942039A
CN103942039A CN201310027519.4A CN201310027519A CN103942039A CN 103942039 A CN103942039 A CN 103942039A CN 201310027519 A CN201310027519 A CN 201310027519A CN 103942039 A CN103942039 A CN 103942039A
Authority
CN
China
Prior art keywords
window
view
platform
layout
windowmanager
Prior art date
Application number
CN201310027519.4A
Other languages
Chinese (zh)
Inventor
张鹏程
苏正湘
Original Assignee
深圳市微讯移通信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市微讯移通信息技术有限公司 filed Critical 深圳市微讯移通信息技术有限公司
Priority to CN201310027519.4A priority Critical patent/CN103942039A/en
Publication of CN103942039A publication Critical patent/CN103942039A/en

Links

Abstract

The invention provides a method for switching games/having access to a platform in a task window of a mobile phone. An API of an android operation system is utilized, the method is achieved based on three technologies of the application program component Activity, the android Window Manager and the Frame Layout of the android operation system, according to the technical scheme, the method is designed for the perfect linkage of the mobile phone from the games to the platform access, the game suspension window is embedded into a game interface, a game player can have access to the platform at any time without quitting and breaking the games in the game process based on the view technology of the suspension window, and platform information is acquired in real time. Less internal memory is occupied, the view can be dragged and contracted, and no operation of a user in the games is influenced.

Description

在手机的一个任务窗口内切换游戏/访问平台的方法 Method of switching games / access platform in a phone task window

【技术领域】 TECHNICAL FIELD

[0001] 本发明涉及移动终端,安卓操作系统操作平台技术领域,尤其涉及在移动终端内对网络软件的应用和扩展。 [0001] The present invention relates to a mobile terminal, the Android operating system platform technology, and particularly relates to software applications and extensions to the network in the mobile terminal.

【背景技术】 【Background technique】

[0002] 随着智能终端和3G网络的普及进一步深化,以手机为应用载体的手机游戏迎来爆发式增长。 [0002] With the popularity of smart terminals and 3G networks to further deepen, mobile phone carrier for the application of mobile games usher in the explosive growth. 目前国内手游用户增长速度远超PC客户端游戏用户和网页游戏用户,手游的爆发式增长也随之带来手游平台种类繁多,参差不齐;大平台广流量多用户,小平台垂直性专业化。 At present, mobile game user growth rate far exceeds the client PC game users and user web games, hand tour of the explosive growth of mobile games also will bring a wide range of platforms, uneven; large platform wide flow multi-user, small platform verticality specialization.

[0003] 对传统手机游戏而言,一般采用平台到游戏的访问模式,如果用户想从游戏中访问平台的相关信息则需先切换当前游戏屏幕至后台,再打开平台访问相关信息,这样在平台和游戏的切换过程中有个“黑屏”现象,如果平台的启动时间过长,“黑屏”现象更严重;无法在游戏界面中直接登录到平台,获取平台信息,同时保持游戏界面活动、登录状态。 [0003] in terms of the traditional mobile phone games, the general platform access mode to the game, if the user wants to access the platform from the game-related information you need to first switch the current game screen to the background, and then open the platform to access the relevant information so that the platform and the process of switching the game to have a "black" phenomenon, if the platform start-up time is too long, "black" phenomenon is more serious; can not log in game interface directly to the platform, get information platform, while keeping the game interface events logged . 在现有手游应用中,平台和游戏本身处于分裂而独立的两个过程,一旦需要从游戏到平台,过程耗时长而且需要中断游戏进度、有时甚至会出现游戏自动断开连接、脱离登录状态等问题,给使用者带来不便和困扰。 In the existing mobile games applications, platforms, and the game itself is split in two and independent process that once required time-consuming from the game to the platform, and the need to interrupt the process of progress of the game, and sometimes the game is automatically disconnected from the login status will appear and other issues, to the user inconvenience and distress. 【发明内容】 [SUMMARY]

[0004] 本发明针对以上情况提出了一种能在游戏过程中,在游戏界面内迅速切换到平台相关页面的平台切换访问方法,随时获取平台页面信息、用户无需中断游戏、避免重新连接、重新登录的麻烦和困扰。 [0004] The present invention is directed to the above proposed energy during the game, the game interface to switch quickly to the relevant page of the switching platform platform access methods, at any time to obtain information platform page, the user without interrupting the game, avoid reconnect, re trouble and distress login.

[0005] 本发明使用安卓操作系统本身的应用程序编程接口API,利用安卓的应用程序组件Activity、安卓窗口管理器WindowManager、框架布局FrameLayout三种技术实现,其实现过程包括以下步骤: [0005] The present invention uses Android operating system itself, the API Application Programming Interface, using Android application components Activity, Andrews The WindowManager window manager, three kinds of frame layout FrameLayout technology, which implements the process comprising the steps of:

[0006] 一、创建一个继承自FrameLayout的布局界面,添加在线客服:创建一继承自线性布局LinearLayout的布局界面,添加在线客服的图片视图1mageView与文字视图TextView ;通过设置Intent处理机制中的触发动作Intent.setAction()、触发组件Intent.setComponent O和触发数据Intent.putExtra O为启动平台的动作、组件和数据; [0006] First, create a class that inherits from FrameLayout layout interface, add online customer service: Create a inherited from the linear layout LinearLayout layout interface, add online customer service picture view 1mageView and text view TextView; by setting the Intent processing mechanism triggers actions Intent.setAction (), and the trigger assembly triggers Intent.setComponent O operation to start data Intent.putExtra O platform components and data;

[0007] 二、通过Context.getSystemServise 获取到窗口管理器WindowManager 类型实例; [0007] Second, the window manager to acquire the type WindowManager instance by Context.getSystemServise;

[0008] 三、调用窗口管理器WindowManager,并设置窗口管理器WindowManager、框架布局FrameLayout的属性,X、Y坐标数据、宽度width、高度height、类型type、标记flags、版式format ; [0008] Third, call manager The WindowManager window, and set the properties window manager The WindowManager, the frame layout FrameLayout, X, Y coordinate data, the width of the width, height height, type type, the flags marking, the format layout;

[0009] 四、调用WindowManager的窗口管理方法addView,所谓窗口管理方法addView包含视图View、顶级视图ViewGroup、布局参数LayoutParams和参数params ,利用窗口管理方法addView将步骤一中生成的布局界面添加到窗口中;[0010] 五、通过步骤一中重写的方法改变WindowMananager.LayoutParams中x和y的值实现自由移动悬浮窗口。 [0009] Fourth, the call WindowManager window management addView, a so-called window management addView comprising View View, top view of the ViewGroup, layout parameters LayoutParams and parameter params, using a window management method addView the step of adding a generated layout interface to the window ; [0010] V. method of rewriting a step change in the value of x and y WindowMananager.LayoutParams to achieve free movement of the floating window.

[0011] 本发明实现了一种为手机设计在从游戏到平台访问完美衔接的技术方案,将游戏悬浮窗口嵌入到游戏界面中,通过该悬浮窗口视图技术让游戏者在游戏过程中,不退出不中断游戏的前提下随时访问平台,实时获取平台信息;占用内存少、视图可拖动、可收缩并且不影响用户游戏中的任何操作。 [0011] The present invention implements a visit designed for mobile phones in the perfect convergence of technical solutions from the game to the platform, the game will be suspended window embedded in the game interface, through the window view suspension technology allows the player during the game, do not quit without interrupting the game at any time access to the platform, real-time access platform information; small footprint, the view can drag, collapsible and does not affect any action the user in the game.

【具体实施方式】 【Detailed ways】

[0012] 下面将结合本发明附图和具体实施方式对本发明进行进一步的详细说明。 [0012] The present invention in conjunction with the accompanying drawings and specific embodiments of the present invention will be described in further detail.

[0013] 本发明使用安卓操作系统本身的应用程序编程接口API,利用安卓的应用程序组件Activity、安卓窗口管理器WindowManager、框架布局FrameLayout三种技术实现,其实现过程包括以下步骤: [0013] The present invention uses Android operating system itself, the API Application Programming Interface, using Android application components Activity, Andrews The WindowManager window manager, three kinds of frame layout FrameLayout technology, which implements the process comprising the steps of:

[0014] 一、创建一个继承自FrameLayout的布局界面,添加在线客服:创建一继承自线性布局LinearLayout的布局界面,添加在线客服的图片视图1mageView与文字视图TextView ;通过设置Intent处理机制中的触发动作Intent.setAction()、触发组件Intent.setComponent O和触发数据Intent.putExtra O为启动平台的动作、组件和数据; [0014] First, create a class that inherits from FrameLayout layout interface, add online customer service: Create a inherited from the linear layout LinearLayout layout interface, add online customer service picture view 1mageView and text view TextView; by setting the Intent processing mechanism triggers actions Intent.setAction (), and the trigger assembly triggers Intent.setComponent O operation to start data Intent.putExtra O platform components and data;

[0015] 通过设置Intent ,安卓系统中提供了Intent机制来协助应用间的交互与通讯,Intent负责对应用中一次操作的动作、动作涉及数据、附加数据进行描述,Android则根据此Intent的描述,负责找到对应的组件,将Intent传递给调用的组件,并完成组件的调用。 [0015] By setting Intent, Android provides Intent mechanism to assist in the interaction and communication between applications, Intent responsible for the operation of the application in one operation, action involving data, additional data are described, Android is the description of this Intent, the responsible for finding corresponding components, the assembly passed Intent to call and complete the call to the component. Intent不仅可用于应用程序之间,也可用于应用程序内部的Activity/Service之间的交互。 Intent can be used not only between applications, can also be used for interaction between internal applications Activity / Service. 因此,Intent在这里起着一个媒体中介的作用,专门提供组件互相调用的相关信息,实现调用者与被调用者之间的解耦。 Therefore, Intent here plays a role of the media intermediary that specializes in providing information on component called each other to achieve decoupling between the caller and the callee.

[0016] 二、通过Context.getSystemServise 获取到窗口管理器WindowManager 类型实例; [0016] Second, the window manager to acquire the type WindowManager instance by Context.getSystemServise;

[0017] 三、调用窗口管理器WindowManager,并设置窗口管理器WindowManager、框架布局FrameLayout的属性,X、Y坐标数据、宽度width、高度height、类型type、标记flags、版式format ; [0017] Third, call manager The WindowManager window, and set the properties window manager The WindowManager, the frame layout FrameLayout, X, Y coordinate data, the width of the width, height height, type type, the flags marking, the format layout;

[0018] 四、调用WindowManager的窗口管理方法addView,所谓窗口管理方法addView包含视图View、顶级视图ViewGroup、布局参数LayoutParams和参数params,利用窗口管理方法addView将步骤一中生成的布局界面添加到窗口中; [0018] Fourth, the call WindowManager window management addView, a so-called window management addView comprising View View, top view of the ViewGroup, layout parameters LayoutParams and parameter params, using a window management method addView the step of adding a generated layout interface to the window ;

[0019] 五、通过步骤一中重写的方法改变WindowMananager.LayoutParams中x和y的值实现自由移动悬浮窗口。 [0019] V. Method of rewriting a step change in the value of x and y WindowMananager.LayoutParams to achieve free movement of the floating window.

[0020] 利用窗口管理器WindowManager来管理窗口的View、事件、消息收集处理;通过活动Activity来处理逻辑比如生命周期的管理、建立窗口等;通过FrameLayout来存放View并控制它们的位置排列。 [0020] using a window manager to manage WindowManager View window, event, message collector process; Activity treated by activities such as lifecycle management logic, windowing and the like; and to store View FrameLayout by controlling their positions in the array.

[0021] 在Android中真正展不给用户的是Window和View, Activity在Android中所其的作用主要是处理一些逻辑问题,比如生命周期的管理、建立窗口等。 [0021] In Android does not really show to the user and is Window View, the role of Activity in Android as its main logic is to deal with some issues, such as life cycle management, the establishment of windows. 在Android中,窗口的管理还是比较重要的一块,因为他直接负责把内容展示给用户,并和用户进行交互。 In Android, window management is more important piece, because he is directly responsible to show content to users and to interact with the user. 响应用户的输入等。 In response to input of the user and the like. [0022] Window是Android中的窗口,表示顶级窗口的意思,也就是主窗口,它有两个实现类,Phoneffindow 和MidWindow,我们一般的activity 对应的主要是PhoneWindow,在activity中经常使用的SetContentView等方法也是在这个里面实现的。 [0022] Window Android is a window, the window showing the top-level meaning, i.e. the main window, it has two implementation classes, Phoneffindow and MidWindow, we generally corresponds to the activity mainly PhoneWindow, SetContentView the like are often used in activity the method is implemented in the inside.

[0023] 每个主窗口中都有一个View,称之为视图修饰DecorView,是主窗口中的顶级View(实际上就是ViewGroup),在View中有两个成员变量叫做mParent、mChildren,它是用来管理View的上下级关系的。 [0023] Each main window has a View, called the view decorator DecorView, is the main window of the top View (actually ViewGroup), you have two members variable called mParent, mChildren in View, it is to superior-subordinate relationship management View of. 而ViewGroup是对一组View的管理。 The ViewGroup is the management of a group of View. 因此,在ViewGroup中建立了所有View的关系网。 Therefore, the establishment of a network of relationships in ViewGroup View all in. 而最终ViewGroup附属在主窗口上。 The final ViewGroup subsidiary in the main window. 这样就很容易在窗口中通过findViewByld找到具体的View 了。 So it is easy to find specific View by findViewByld in the window. View中的事件处理也是根据这个路径来处理的。 View the event processing is handled in accordance with this path.

[0024] WindowManager主要用来管理窗口的一些状态、属性、View增加、删除、更新、窗口顺序、消息收集和处理等。 [0024] WindowManager mainly used for state management window number, attribute, View add, delete, update, window sequence, message collection and processing.

[0025]通过 Context.getSystemService (Context.WIND0ff_SERVICE)的方式可以获得WindowManager的实例.WindowManager继承自ViewManager,里面涉及到窗口管理的三个重要方法,分别是:addView O、updateViewLayout O、removeView O。 [0025] can be obtained by WindowManager Context.getSystemService (Context.WIND0ff_SERVICE) manner as in Example .WindowManager ViewManager inherited from, which involves three important method of window management, namely: addView O, updateViewLayout O, removeView O.

[0026] 在WindowManager中还有一个重要的静态类LayoutParams.通过它可以设置和获得当前窗口的一些属性。 [0026] In another important WindowManager the LayoutParams for static class. And get some properties may be provided through which the current window. 在addView O方法中,会利用LayoutParams获得Window的View属性,并为每个Window创建ViewRoot, ViewRoot是View和WindowManager之间的桥梁,真正把View传递给WindowManager的是通过ViewRoot的setViewO方法,ViewRoot实现了View和WindowManager之间的消息传递。 In addView O method, will use LayoutParams get the Window View attribute and make ViewRoot for each Window, ViewRoot a bridge between the View and WindowManager, really pass to WindowManager View is through setViewO method of ViewRoot, realized ViewRoot View and message delivery between WindowManager. 在将主窗口添加到WindowManger时,它首先会建立一个代理对象,并且打开会话(IWindowSession),之后Window将通过该会话与WindowManager 建立联系。 When you add in the main window to WindowManger, it first creates a proxy object, and open the session (IWindowSession), after Window will establish contact with WindowManager through the session.

[0027] 该视图悬浮在移动设备窗口或桌面上,能与用户交互、随时拖动、内存小、效率高。 [0027] The suspension view on the mobile device or desktop window, can interact with the user, at any drag, memory, high efficiency.

[0028] 该方法基于Android平台的移动客户端。 [0028] The method is based on the Android platform mobile client terminal. 采用JAVA技术,使用WindowManager及FrameLayout中相关API,在操作中能够快速响应用户事件,并启动其他APK应用,传递数据信息。 JAVA technology employed, the use of the API associated FrameLayout WindowManager and, in operation, to quickly respond to user events, and launch other applications APK, transmitting data information. 能够根据不同安卓系统版本与屏幕分辨率适配窗口大小,界面与操作不受影响。 It can be affected depending on the operating system version of the Andrew adaptation window size and screen resolution, screen. 在悬浮窗口中传递数据必须为原生数据类型或实现Serializable、Comparable接口。 Data transfer in the suspension window native data types must be implemented or Serializable, Comparable interface.

[0029] 以上所述,仅是本发明较佳实施例而已,并非对本发明作任何形式上的限制,虽然本发明以较佳实施例揭露如上,然而并非用以限定本发明,任何熟悉本专业的技术人员,在不脱离本发明技术方案范围内,当可利用上述揭示的技术内容作出些许变更或修饰为等同变化的等效实施例,但凡是未脱离本发明技术方案内容,依据本发明技术是指对以上实施例所作的任何简单修改、等同变化与修饰,均属于本发明技术方案的范围内。 [0029] The above are only preferred embodiments of the present invention, not limitation of the present invention in any form, although the preferred embodiment disclosed above embodiment of the present invention, but not intended to limit the present invention, any skilled professionals the art, without departing from the scope of the technical solution of the present invention, when a slight change can be made using the techniques disclosed content of modification or equivalent change in equivalent embodiments are not to limit the technical solution of the present invention departing from the contents, according to the present invention art simply refers to any modification made to the above embodiments, modifications and equivalent, are within the scope of the technical solutions of the present invention.

Claims (1)

1.一种在手机的一个任务窗口内切换游戏/访问平台的方法,其特征在于,使用安卓操作系统本身的应用程序编程接口API,利用安卓的应用程序组件Activity、安卓窗口管理器WindowManager、框架布局FrameLayout三种技术实现,其实现过程包括以下步骤: 一、仓Il建一个继承自FrameLayout的布局界面,添加在线客服:创建一继承自线性布局LinearLayout的布局界面,添加在线客服的图片视图1mageView与文字视图TextView ;通过设置Intent处理机制中的触发动作Intent.setAction O、触发组件Intent.setComponent O和触发数据Intent.putExtra O为启动平台的动作、组件和数据; 二、通过 Context.getSystemServise 获取到窗口管理器WindowManager 类型实例; 三、调用窗口管理器WindowManager,并设置窗口管理器WindowManager、框架布局FrameLayout的属性,X、Y坐标数据、宽度width、高度height、类型type、标记flags、版式format ; 1. A method for game / internet access in the phone switching a task window, characterized in that, using the Android operating system itself, the API Application Programming Interface, using Android application components Activity, Andrews The WindowManager window manager, frame layout FrameLayout three technologies to achieve its implementation process includes the following steps: First, build a warehouse Il inherited from FrameLayout interface layout, add online customer Service: Creating a linear layout LinearLayout inherited from the layout of the interface, add pictures online customer service with a view 1mageView text view the TextView; Intent process provided by the operation of the trigger mechanism of Intent.setAction O, trigger and trigger assembly Intent.setComponent O operation to start data Intent.putExtra O platform components and data; II acquired through the window Context.getSystemServise WindowManager type manager instance; three call WindowManager window manager, window manager and set the properties WindowManager, the frame layout FrameLayout, X, Y coordinate data, the width of the width, height height, type type, the flags marking, the format layout; 四、调用 WindowManager 的addView (View view, ViewGroup.LayoutParams params)方法将步骤一中生成的布局界面添加到窗口中; 五、通过步骤一中重写的方法改变WindowMananager.LayoutParams中x和y的值实现自由移动悬浮窗口。 Fourth, the call WindowManager addView (View view, ViewGroup.LayoutParams params) method adds a step to the generated layout window interface; 5, a method of rewriting step change in the value of x and y WindowMananager.LayoutParams achieved free movement of the floating window.
CN201310027519.4A 2013-01-23 2013-01-23 Method for switching games/having access to platform in task window of mobile phone CN103942039A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310027519.4A CN103942039A (en) 2013-01-23 2013-01-23 Method for switching games/having access to platform in task window of mobile phone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310027519.4A CN103942039A (en) 2013-01-23 2013-01-23 Method for switching games/having access to platform in task window of mobile phone

Publications (1)

Publication Number Publication Date
CN103942039A true CN103942039A (en) 2014-07-23

Family

ID=51189718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310027519.4A CN103942039A (en) 2013-01-23 2013-01-23 Method for switching games/having access to platform in task window of mobile phone

Country Status (1)

Country Link
CN (1) CN103942039A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657557A (en) * 2014-11-12 2016-06-08 Tcl集团股份有限公司 Video playing control method and system based on smart television
WO2018068645A1 (en) * 2016-10-13 2018-04-19 阿里巴巴集团控股有限公司 Multi-service integration method and apparatus, intelligent terminal, server and operating system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040212635A1 (en) * 2002-07-05 2004-10-28 Alcatel Process for allowing Applets to be resized independently from the WEB/HTML page they were created
CN102883041A (en) * 2012-08-02 2013-01-16 聚熵信息技术(上海)有限公司 Voice control device and method for mobile terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040212635A1 (en) * 2002-07-05 2004-10-28 Alcatel Process for allowing Applets to be resized independently from the WEB/HTML page they were created
CN102883041A (en) * 2012-08-02 2013-01-16 聚熵信息技术(上海)有限公司 Voice control device and method for mobile terminal

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HUANGXIAOHU_CODER: "Android用Intent启动Activity的方法", 《HTTP://BLOG.CSDN.NET/HUANGXIAOHU_CODER/ARTICLE/DETAILS/7105457》 *
XSMILE: "Android中可自由移动悬浮窗口的实现", 《HTTP://WWW.XSMILE.NET/?P=538》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657557A (en) * 2014-11-12 2016-06-08 Tcl集团股份有限公司 Video playing control method and system based on smart television
WO2018068645A1 (en) * 2016-10-13 2018-04-19 阿里巴巴集团控股有限公司 Multi-service integration method and apparatus, intelligent terminal, server and operating system

Similar Documents

Publication Publication Date Title
CA2632706C (en) High level network layer system and method
CN105224322B (en) A kind of attend to anything else method and the terminal of application program
US8631078B2 (en) Method and system for embedded personalized communication
US9009334B1 (en) Remote browsing session management
US9009228B2 (en) Method and apparatus for sharing concurrent ad hoc web content between users visiting the same web pages
CN102714884B (en) A method for processing of contacts and the mobile terminal
CN102263706A (en) A method and apparatus for an image taken
CN103135969A (en) Method and device of operating, generating and starting application program
TWI444216B (en) Method and apparatus for gaming based on mobile terminal
CN102209111B (en) Open cross-platform system for cloud computing mobile network terminal equipment
US7707292B2 (en) Method for signing into a mobile device over a network
US20120143948A1 (en) Social networking feed extensibility based on data types
CN104615335A (en) Information processing method and client side
CN104506937A (en) Method and system for sharing processing of audios and videos
US20170293681A1 (en) Techniques to respond to user requests using natural-language machine learning based on example conversations
CN102131001B (en) Remote control system and method of mobile communication terminal
CN104899269A (en) Website link accessing method and apparatus
US20160203106A1 (en) Dynamic webpage image
CN101150542B (en) Method for displaying user status in instant communication system
CN101277277A (en) Method and system for setting chat window theme in instant communication
CN104660495A (en) Information processing method, client and server
CN103503385A (en) Method for information share and device
CN104954410A (en) Message pushing method, device thereof and server
CN103608799B (en) Automatically converting user interface objects, and code generation
CN104780458A (en) Method and electronic equipment for loading effects in instant video

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
RJ01