TWI714006B - Method and device for starting Active system of Android system - Google Patents

Method and device for starting Active system of Android system Download PDF

Info

Publication number
TWI714006B
TWI714006B TW108107051A TW108107051A TWI714006B TW I714006 B TWI714006 B TW I714006B TW 108107051 A TW108107051 A TW 108107051A TW 108107051 A TW108107051 A TW 108107051A TW I714006 B TWI714006 B TW I714006B
Authority
TW
Taiwan
Prior art keywords
activity
push message
intent
pendingintent
activation
Prior art date
Application number
TW108107051A
Other languages
Chinese (zh)
Other versions
TW202001554A (en
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 開曼群島商創新先進技術有限公司
Publication of TW202001554A publication Critical patent/TW202001554A/en
Application granted granted Critical
Publication of TWI714006B publication Critical patent/TWI714006B/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

說明書披露一種Android系統Activity的啟動方法和裝置。該方法包括:回應於來自服務端的推送訊息,基於預定的Activity啟動規則對所述推送訊息進行解析;若解析失敗,則將所述推送訊息攜帶的啟動字串轉換為Intent;基於所述Intent創建PendingIntent;當所述PendingIntent對應的通知欄訊息被觸發時,啟動所述推送訊息對應的Activity。The manual discloses a method and device for starting Android system Activity. The method includes: responding to a push message from a server, parsing the push message based on a predetermined activity startup rule; if the parsing fails, converting the startup string carried in the push message into an Intent; creating based on the Intent PendingIntent; when the notification bar message corresponding to the PendingIntent is triggered, start the Activity corresponding to the push message.

Description

Android系統Activity的啟動方法和裝置Method and device for starting Android system Activity

本說明書係關於終端技術領域,尤其關於一種Android系統Activity的啟動方法和裝置。This manual relates to the field of terminal technology, and especially relates to a method and device for starting Android system Activity.

Activity(活動)是Android系統中最基本、也是最為常見的四大組件之一。Activity提供一個螢幕,可給用戶提供互動式的介面功能。在Android系統中,可基於Activity啟動規則,透過Intent(意圖)來實現Activity的啟動。Activity is one of the four most basic and common components in the Android system. Activity provides a screen that can provide users with interactive interface functions. In the Android system, the activation of the Activity can be realized through the Intent (intent) based on the activation rules of the Activity.

有鑑於此,本說明書提供一種Android系統Activity的啟動方法和裝置。 具體地,本說明書是透過如下技術方案實現的: 一種Android系統Activity的啟動方法,包括: 回應於來自服務端的推送訊息,基於預定的Activity啟動規則對所述推送訊息進行解析; 若解析失敗,則將所述推送訊息攜帶的啟動字串轉換為Intent; 基於所述Intent創建PendingIntent; 當所述PendingIntent對應的通知欄訊息被觸發時,啟動所述推送訊息對應的Activity。 一種Android系統Activity的啟動裝置,包括: 解析單元,回應於來自服務端的推送訊息,基於預定的Activity啟動規則對所述推送訊息進行解析; 轉換單元,若解析失敗,則將所述推送訊息攜帶的啟動字串轉換為Intent; 創建單元,基於所述Intent創建PendingIntent; 啟動單元,當所述PendingIntent對應的通知欄訊息被觸發時,啟動所述推送訊息對應的Activity。 一種Android系統Activity的啟動裝置,包括: 處理器; 用於儲存機器可執行指令的記憶體; 其中,透過讀取並執行所述記憶體儲存的與Android系統Activity的啟動邏輯對應的機器可執行指令,所述處理器被促使: 回應於來自服務端的推送訊息,基於預定的Activity啟動規則對所述推送訊息進行解析; 若解析失敗,則將所述推送訊息攜帶的啟動字串轉換為Intent; 基於所述Intent創建PendingIntent; 當所述PendingIntent對應的通知欄訊息被觸發時,啟動所述推送訊息對應的Activity。 由以上描述可以看出,本說明書可利用字串與Intent之間的轉換,在客戶端未配置Activity啟動規則時,將啟動該Activity的intent轉換為啟動字串配置到服務端的推送訊息中,從而實現Activity啟動功能的雲端化。在新增Activity時,無需在客戶端中配置對應的Activity啟動規則,即可實現Activity的啟動,簡單便捷。對於用戶而言,也無需頻繁升級客戶端,體驗較佳。In view of this, this manual provides a method and device for starting Android system Activity. Specifically, this specification is implemented through the following technical solutions: A method for starting Android system Activity includes: In response to the push message from the server, the push message is parsed based on a predetermined activity startup rule; If the analysis fails, convert the activation string carried in the push message into an Intent; Create a PendingIntent based on the Intent; When the notification bar message corresponding to the PendingIntent is triggered, the Activity corresponding to the push message is started. An activation device for Android system Activity, including: The parsing unit, in response to the push message from the server, parses the push message based on a predetermined activity startup rule; The conversion unit, if the analysis fails, convert the activation string carried in the push message into an Intent; The creation unit creates a PendingIntent based on the Intent; The activation unit, when the notification bar message corresponding to the PendingIntent is triggered, activates the Activity corresponding to the push message. An activation device for Android system Activity, including: processor; Memory used to store machine executable instructions; Wherein, by reading and executing the machine executable instructions corresponding to the activation logic of the Android system Activity stored in the memory, the processor is prompted to: In response to the push message from the server, the push message is parsed based on a predetermined activity startup rule; If the analysis fails, convert the activation string carried in the push message into an Intent; Create a PendingIntent based on the Intent; When the notification bar message corresponding to the PendingIntent is triggered, the Activity corresponding to the push message is started. As can be seen from the above description, this manual can use the conversion between string and intent. When the client does not configure the activity start rule, the intent that starts the activity is converted to the start string and configured in the push message of the server. Realize the cloudization of Activity startup function. When adding an Activity, you do not need to configure the corresponding Activity startup rules in the client to realize the startup of the Activity, which is simple and convenient. For users, there is no need to upgrade the client frequently, and the experience is better.

這裡將詳細地對示例性實施例進行說明,其示例表示在附圖中。下面的描述涉及附圖時,除非另有表示,不同附圖中的相同數字表示相同或相似的要素。以下示例性實施例中所描述的實施方式並不代表與本說明書相一致的所有實施方式。相反,它們僅是與如所附申請專利範圍中所詳述的、本說明書的一些方面相一致的裝置和方法的例子。 在本說明書使用的術語是僅僅出於描述特定實施例的目的,而非旨在限制本說明書。在本說明書和所附申請專利範圍中所使用的單數形式的“一種”、“所述”和“該”也旨在包括多數形式,除非上下文清楚地表示其他含義。還應當理解,本文中使用的術語“和/或”是指並包含一個或多個相關聯的列出專案的任何或所有可能組合。 應當理解,儘管在本說明書可能採用術語第一、第二、第三等來描述各種資訊,但這些資訊不應限於這些術語。這些術語僅用來將同一類型的資訊彼此區分開。例如,在不脫離本說明書範圍的情況下,第一資訊也可以被稱為第二資訊,類似地,第二資訊也可以被稱為第一資訊。取決於語境,如在此所使用的詞語“如果”可以被解釋成為“在……時”或“當……時”或“回應於確定”。 圖1是本說明書一示例性實施例示出的一種Android系統Activity的啟動方法的流程示意圖。 所述Android系統Activity的啟動方法可以應用在智慧型終端上裝載的客戶端軟體中,所述智慧型終端可以包括:平板電腦、智慧型手機、PDA(Personal Digital Assistant,掌上型電腦)等,本說明書對此不作特殊限制。 請參考圖1,所述Android系統Activity的啟動方法可包括以下步驟: 步驟102,回應於來自服務端的推送訊息,基於預定的Activity啟動規則對所述推送訊息進行解析。 步驟104,若解析失敗,則將所述推送訊息攜帶的啟動字串轉換為Intent。 在本實施例中,所述啟動字元串通常由開發人員預先配置在推送訊息中。 例如,開發人員可以先在本地透過Intent的方式啟動推送訊息對應的Activity,然後透過Intent與字串之間的轉換,將該Intent轉換為字串,為便於區分,可將Intent轉換後得到的字串稱為轉換字串,再將轉換字串配置到服務端的推送訊息中。 步驟106,基於所述Intent創建PendingIntent。 步驟108,當所述PendingIntent對應的通知欄訊息被觸發時,啟動所述推送訊息對應的Activity。 由以上描述可以看出,本實施例可利用字串與Intent之間的轉換,在客戶端未配置Activity啟動規則時,將啟動該Activity的intent轉換為啟動字串配置到服務端的推送訊息中,從而實現Activity啟動功能的雲端化。在新增Activity時,無需在客戶端中配置對應的Activity啟動規則,即可實現Activity的啟動,簡單便捷。對於用戶而言,也無需頻繁升級客戶端,體驗較佳。 圖2是本說明書一示例性實施例示出的另一種Android系統Activity的啟動方法的流程示意圖。 請參考圖2,所述Android系統Activity的啟動方法可包括以下步驟: 步驟202,回應於來自服務端的推送訊息,基於預定的Activity啟動規則對所述推送訊息進行解析。 在本實施例中,所述預定的Activity啟動規則通常由開發人員預先配置在客戶端軟體中,可用於實現對對應Activity的啟動。 在本實施例中,在接收到服務端發送的推送訊息後,客戶端可以根據已配置的Activity啟動規則對推送訊息進行解析。 若解析成功,可實現對所述推送訊息對應的Activity的啟動。 例如,客戶端可以基於所述Activity啟動規則創建PendingIntent,並透過通知欄訊息將所述推送訊息展示給用戶。所述通知欄訊息被用戶點擊後的跳轉行為依賴創建的所述PendingIntent。例如,用戶在點擊所述通知欄中展示的推送訊息後,客戶端可以調用所述PendingIntent中的Intent,進而展示所述推送訊息對應的Activity。 若解析失敗,則執行步驟204。換言之,若基於預定的Activity啟動規則均無法解析所述推送訊息,則執行步驟204。 步驟204,將所述推送訊息攜帶的啟動字串轉換為Intent。 基於前述步驟202的解析結果,若解析失敗,通常說明客戶端中未配置與所述推送訊息對應的Activity的啟動規則。 在本實施例中,針對未在客戶端上配置啟動規則的Activity,開發人員可以預先在本地透過Intent的方式啟動該Activity,在啟動成功後,可透過string str_intent= Intent.toUri(flags)將該Intent轉換為啟動字串,並將該啟動字串配置到與該Activity對應的服務端推送訊息中。 例如,可以將該啟動字串作為Key值配置到推送訊息中。 又例如,可以將該啟動字串配置到推送訊息的指定欄位中,本說明書對此不作特殊限制。 在本實施例中,針對解析失敗的推送訊息,客戶端可以根據啟動字串的配置位置,透過Intent intent=Intent.parseUri (string, flags)將該推送訊息攜帶的啟動字串轉換為Intent。 例如,可以將該推送訊息中的指定Key值對應的Value值轉換為Intent。 又例如,可以將該推送訊息中指定欄位的字串轉換為Intent,本說明書對此不作特殊限制。 在本實施例中,若無法將所述推送訊息攜帶的啟動字串轉換為Intent,則可以結束處理流程。 步驟206,基於所述Intent創建PendingIntent。 基於前述步驟204,在將所述推送訊息攜帶的啟動字串轉換為Intent後,可以基於該Intent創建一個PendingIntent,該並將所述推送訊息透過通知欄展示給用戶。 步驟208,當所述PendingIntent對應的通知欄訊息被觸發時,啟動所述推送訊息對應的Activity。 在本實施例中,當用戶點擊展示的通知欄訊息時,客戶端可以調用所述PendingIntent中的Intent,進而展示所述推送訊息對應的Activity。 由以上描述可以看出,本說明書可利用字串與Intent之間的轉換,在客戶端未配置Activity啟動規則時,將啟動該Activity的intent轉換為啟動字串配置到服務端的推送訊息中,從而實現Activity啟動功能的雲端化。在新增Activity時,無需在客戶端中配置對應的Activity啟動規則,即可實現Activity的啟動,簡單便捷。對於用戶而言,也無需頻繁升級客戶端,體驗較佳。 與前述Android系統Activity的啟動方法的實施例相對應,本說明書還提供了Android系統Activity的啟動裝置的實施例。 本說明書Android系統Activity的啟動裝置的實施例可以應用在終端裝載的客戶端軟體上。裝置實施例可以透過軟體實現,也可以透過硬體或者軟硬體結合的方式實現。以軟體實現為例,作為一個邏輯意義上的裝置,是透過其所在終端的處理器將非易失性記憶體中對應的電腦程式指令讀取到記憶體中運行形成的。從硬體層面而言,如圖3所示,為本說明書Android系統Activity的啟動裝置所在終端的一種硬體結構圖,除了圖3所示的處理器、記憶體、網路介面、以及非易失性記憶體之外,實施例中裝置所在的終端通常根據該終端的實際功能,還可以包括其他硬體,對此不再贅述。 圖4是本說明書一示例性實施例示出的一種Android系統Activity的啟動裝置的框圖。 請參考圖4,所述Android系統Activity的啟動裝置300可以應用在前述圖3所示的終端中,包括有:解析單元301、轉換單元302、創建單元303以及啟動單元304。 其中,解析單元301,回應於來自服務端的推送訊息,基於預定的Activity啟動規則對所述推送訊息進行解析; 轉換單元302,若解析失敗,則將所述推送訊息攜帶的啟動字串轉換為Intent; 創建單元303,基於所述Intent創建PendingIntent; 啟動單元304,當所述PendingIntent對應的通知欄訊息被觸發時,啟動所述推送訊息對應的Activity。 可選的,所述啟動字串位於所述推送訊息的指定欄位中。 可選的,所述轉換單元302,在所述推送訊息攜帶的啟動字串無法轉換為Intent時,結束處理流程。 可選的,所述推送訊息攜帶的啟動字串預先基於所述推送訊息對應的Activity配置。 上述裝置中各個單元的功能和作用的實現過程具體詳見上述方法中對應步驟的實現過程,在此不再贅述。 對於裝置實施例而言,由於其基本對應於方法實施例,所以相關之處參見方法實施例的部分說明即可。以上所描述的裝置實施例僅僅是示意性的,其中所述作為分離部件說明的單元可以是或者也可以不是物理上分開的,作為單元顯示的部件可以是或者也可以不是物理單元,即可以位於一個地方,或者也可以分佈到多個網路單元上。可以根據實際的需要選擇其中的部分或者全部模組來實現本說明書方案的目的。本領域普通技術人員在不付出創造性勞動的情況下,即可以理解並實施。 上述實施例闡明的系統、裝置、模組或單元,具體可以由電腦晶片或實體實現,或者由具有某種功能的產品來實現。一種典型的實現設備為電腦,電腦的具體形式可以是個人電腦、膝上型電腦、行動電話、相機電話、智慧型電話、個人數位助理、媒體播放機、導航設備、電子郵件收發設備、遊戲控制台、平板電腦、可穿戴設備或者這些設備中的任意幾種設備的組合。 與前述Android系統Activity的啟動方法的實施例相對應,本說明書還提供一種Android系統Activity的啟動裝置,該Android系統Activity的啟動裝置包括:處理器以及用於儲存機器可執行指令的記憶體。其中,處理器和記憶體通常藉由內部匯流排相互連接。在其他可能的實現方式中,所述設備還可能包括外部介面,以能夠與其他設備或者部件進行通信。 在本實施例中,透過讀取並執行所述記憶體儲存的與Android系統Activity的啟動邏輯對應的機器可執行指令,所述處理器被促使: 回應於來自服務端的推送訊息,基於預定的Activity啟動規則對所述推送訊息進行解析; 若解析失敗,則將所述推送訊息攜帶的啟動字串轉換為Intent; 基於所述Intent創建PendingIntent; 當所述PendingIntent對應的通知欄訊息被觸發時,啟動所述推送訊息對應的Activity。 可選的,所述啟動字串位於所述推送訊息的指定欄位中。 可選的,還包括: 當所述推送訊息攜帶的啟動字串無法轉換為Intent時,結束處理流程。 可選的,所述推送訊息攜帶的啟動字串預先基於所述推送訊息對應的Activity配置。 與前述Android系統Activity的啟動方法的實施例相對應,本說明書還提供一種電腦可讀儲存媒體,所述電腦可讀儲存媒體上儲存有電腦程式,該程式被處理器執行時實現以下步驟: 回應於來自服務端的推送訊息,基於預定的Activity啟動規則對所述推送訊息進行解析; 若解析失敗,則將所述推送訊息攜帶的啟動字串轉換為Intent; 基於所述Intent創建PendingIntent; 當所述PendingIntent對應的通知欄訊息被觸發時,啟動所述推送訊息對應的Activity。 可選的,所述啟動字串位於所述推送訊息的指定欄位中。 可選的,還包括: 當所述推送訊息攜帶的啟動字串無法轉換為Intent時,結束處理流程。 可選的,所述推送訊息攜帶的啟動字串預先基於所述推送訊息對應的Activity配置。 上述對本說明書特定實施例進行了描述。其它實施例在所附申請專利範圍的範圍內。在一些情況下,在申請專利範圍中記載的動作或步驟可以按照不同於實施例中的順序來執行並且仍然可以實現期望的結果。另外,在附圖中描繪的過程不一定要求示出的特定順序或者連續順序才能實現期望的結果。在某些實施方式中,多工處理和並行處理也是可以的或者可能是有利的。 以上所述僅為本說明書的較佳實施例而已,並不用以限制本說明書,凡在本說明書的精神和原則之內,所做的任何修改、等同替換、改進等,均應包含在本說明書保護的範圍之內。Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with this specification. On the contrary, they are only examples of devices and methods consistent with some aspects of this specification as detailed in the scope of the appended application. The terms used in this specification are only for the purpose of describing specific embodiments, and are not intended to limit the specification. The singular forms of "a", "the" and "the" used in this specification and the scope of the appended application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and/or" as used herein refers to and includes any or all possible combinations of one or more associated listed items. It should be understood that although the terms first, second, and third may be used in this specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information can also be referred to as second information, and similarly, the second information can also be referred to as first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "when" or "in response to certainty". Fig. 1 is a schematic flowchart of a method for starting an Android system Activity shown in an exemplary embodiment of this specification. The activation method of the Android system Activity can be applied to client software loaded on a smart terminal. The smart terminal can include a tablet computer, a smart phone, a PDA (Personal Digital Assistant, palmtop computer), etc. The manual does not make special restrictions on this. Please refer to Figure 1, the method for starting the Android system Activity may include the following steps: Step 102: In response to the push message from the server, the push message is parsed based on a predetermined activity startup rule. Step 104: If the analysis fails, convert the activation string carried in the push message into an Intent. In this embodiment, the activation character string is usually pre-configured in the push message by the developer. For example, the developer can first start the activity corresponding to the push message by means of intent locally, and then convert the intent to a string through the conversion between the intent and the string. For easy distinction, the word obtained after the intent conversion can be converted The string is called the conversion string, and then the conversion string is configured in the push message of the server. Step 106: Create a Pending Intent based on the Intent. Step 108: When the notification bar message corresponding to the PendingIntent is triggered, start the Activity corresponding to the push message. As can be seen from the above description, this embodiment can use the conversion between a string and an intent. When the client does not configure the activity start rule, the intent that starts the activity is converted into a start string and configured into the push message of the server. So as to realize the cloudization of Activity startup function. When adding an Activity, you do not need to configure the corresponding Activity startup rules in the client to realize the startup of the Activity, which is simple and convenient. For users, there is no need to upgrade the client frequently, and the experience is better. Fig. 2 is a schematic flowchart of another method for starting an Android system Activity shown in an exemplary embodiment of this specification. Please refer to Figure 2. The method for starting the Android system Activity may include the following steps: Step 202: In response to the push message from the server, the push message is parsed based on a predetermined activity startup rule. In this embodiment, the predetermined activity startup rule is usually pre-configured in the client software by the developer, and can be used to implement the startup of the corresponding activity. In this embodiment, after receiving the push message sent by the server, the client can parse the push message according to the configured Activity startup rules. If the analysis is successful, the activation of the activity corresponding to the push message can be realized. For example, the client can create a PendingIntent based on the Activity startup rule, and display the push message to the user through a notification bar message. The jump behavior after the notification bar message is clicked by the user depends on the PendingIntent created. For example, after the user clicks on the push message displayed in the notification bar, the client can call the Intent in the PendingIntent to display the Activity corresponding to the push message. If the analysis fails, step 204 is executed. In other words, if the push message cannot be parsed based on the predetermined activity startup rules, step 204 is executed. Step 204: Convert the activation string carried in the push message into an Intent. Based on the analysis result of the aforementioned step 202, if the analysis fails, it usually means that the activation rule of the activity corresponding to the push message is not configured in the client. In this embodiment, for an activity that is not configured with a startup rule on the client, the developer can start the activity locally through an Intent in advance, and after the startup is successful, use string str_intent= Intent.toUri(flags) The intent is converted into an activation string, and the activation string is configured in the server push message corresponding to the activity. For example, you can configure the startup string as the key value in the push message. For another example, the startup string can be configured in the designated field of the push message, and this manual does not make special restrictions on this. In this embodiment, for a push message that fails to parse, the client can convert the start string carried in the push message into an Intent through Intent intent=Intent.parseUri (string, flags) according to the configuration position of the start string. For example, the Value value corresponding to the specified Key value in the push message can be converted into an Intent. For another example, the string of the specified field in the push message can be converted into an Intent, which is not specifically restricted in this manual. In this embodiment, if the activation string carried in the push message cannot be converted into an Intent, the processing flow can be ended. Step 206: Create a Pending Intent based on the Intent. Based on the foregoing step 204, after the activation string carried in the push message is converted into an Intent, a Pending Intent can be created based on the Intent, and the push message is displayed to the user through the notification bar. Step 208: When the notification bar message corresponding to the PendingIntent is triggered, start the Activity corresponding to the push message. In this embodiment, when the user clicks on the displayed notification bar message, the client can call the Intent in the PendingIntent to display the Activity corresponding to the push message. As can be seen from the above description, this manual can use the conversion between string and intent. When the client does not configure the activity start rule, the intent that starts the activity is converted to the start string and configured in the push message of the server. Realize the cloudization of Activity startup function. When adding an Activity, you do not need to configure the corresponding Activity startup rules in the client to realize the startup of the Activity, which is simple and convenient. For users, there is no need to upgrade the client frequently, and the experience is better. Corresponding to the foregoing embodiment of the method for starting Android system Activity, this specification also provides an embodiment of the device for starting Android system Activity. The embodiment of the activation device of the Android system Activity in this specification can be applied to the client software loaded on the terminal. The device embodiments can be implemented through software, or through hardware or a combination of software and hardware. Take software implementation as an example. As a logical device, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory through the processor of the terminal where it is located. From the perspective of hardware, as shown in Figure 3, it is a hardware structure diagram of the terminal where the startup device of the Android system Activity of this manual is located, except for the processor, memory, network interface, and non-transitory In addition to the lossy memory, the terminal where the device is located in the embodiment may also include other hardware according to the actual function of the terminal, which will not be repeated here. Fig. 4 is a block diagram of a device for starting Activity of the Android system according to an exemplary embodiment of this specification. Please refer to FIG. 4, the activation device 300 of the Android system Activity can be applied to the terminal shown in FIG. 3, and includes: an analysis unit 301, a conversion unit 302, a creation unit 303, and an activation unit 304. Wherein, the parsing unit 301 responds to the push message from the server, and analyzes the push message based on a predetermined activity startup rule; The conversion unit 302, if the analysis fails, convert the activation string carried in the push message into an Intent; The creating unit 303 creates a PendingIntent based on the Intent; The activation unit 304 activates the Activity corresponding to the push message when the notification bar message corresponding to the PendingIntent is triggered. Optionally, the activation string is located in a designated field of the push message. Optionally, the conversion unit 302 terminates the processing flow when the activation string carried in the push message cannot be converted into an Intent. Optionally, the activation string carried in the push message is based on the Activity configuration corresponding to the push message in advance. For the implementation process of the functions and roles of each unit in the above-mentioned device, refer to the implementation process of the corresponding steps in the above-mentioned method for details, which will not be repeated here. For the device embodiment, since it basically corresponds to the method embodiment, the relevant part can refer to the part of the description of the method embodiment. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Those of ordinary skill in the art can understand and implement it without creative work. The systems, devices, modules, or units explained in the above embodiments may be implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. The specific form of the computer can be a personal computer, a laptop computer, a mobile phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet, a wearable device, or a combination of any of these devices. Corresponding to the aforementioned embodiment of the method for starting Android system Activity, this specification also provides a starting device for Android system Activity. The starting device for Android system Activity includes a processor and a memory for storing machine executable instructions. Among them, the processor and the memory are usually connected to each other through an internal bus. In other possible implementation manners, the device may also include an external interface to be able to communicate with other devices or components. In this embodiment, by reading and executing the machine executable instructions stored in the memory and corresponding to the startup logic of the Android system Activity, the processor is prompted to: In response to the push message from the server, the push message is parsed based on a predetermined activity startup rule; If the analysis fails, convert the activation string carried in the push message into an Intent; Create a PendingIntent based on the Intent; When the notification bar message corresponding to the PendingIntent is triggered, the Activity corresponding to the push message is started. Optionally, the activation string is located in a designated field of the push message. Optional, also includes: When the activation string carried in the push message cannot be converted into an Intent, the processing flow is ended. Optionally, the activation string carried in the push message is based on the Activity configuration corresponding to the push message in advance. Corresponding to the foregoing embodiment of the method for starting Android system Activity, this specification also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the following steps are implemented: In response to the push message from the server, the push message is parsed based on a predetermined activity startup rule; If the analysis fails, convert the activation string carried in the push message into an Intent; Create a PendingIntent based on the Intent; When the notification bar message corresponding to the PendingIntent is triggered, the Activity corresponding to the push message is started. Optionally, the activation string is located in a designated field of the push message. Optional, also includes: When the activation string carried in the push message cannot be converted into an Intent, the processing flow is ended. Optionally, the activation string carried in the push message is based on the Activity configuration corresponding to the push message in advance. The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the attached patent application. In some cases, the actions or steps described in the scope of the patent application may be performed in a different order from the embodiment and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired result. In some embodiments, multiplexing and parallel processing are also possible or may be advantageous. The above descriptions are only preferred embodiments of this specification, and are not intended to limit this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in this specification Within the scope of protection.

300‧‧‧Android系統Activity的啟動裝置 301‧‧‧解析單元 302‧‧‧轉換單元 303‧‧‧創建單元 304‧‧‧啟動單元 300‧‧‧Activity startup device for Android system 301‧‧‧Analysis unit 302‧‧‧Conversion unit 303‧‧‧Create Unit 304‧‧‧Start unit

圖1是本說明書一示例性實施例示出的一種Android系統Activity的啟動方法的流程示意圖。 圖2是本說明書一示例性實施例示出的另一種Android系統Activity的啟動方法的流程示意圖。 圖3是本說明書一示例性實施例示出的一種用於Android系統Activity的啟動裝置的一結構示意圖。 圖4是本說明書一示例性實施例示出的一種Android系統Activity的啟動裝置的框圖。Fig. 1 is a schematic flowchart of a method for starting an Android system Activity shown in an exemplary embodiment of this specification. Fig. 2 is a schematic flowchart of another method for starting an Android system Activity shown in an exemplary embodiment of this specification. Fig. 3 is a schematic structural diagram of an activation device for Android system Activity shown in an exemplary embodiment of this specification. Fig. 4 is a block diagram of a device for starting Activity of the Android system according to an exemplary embodiment of this specification.

Claims (9)

一種Android系統Activity的啟動方法,該方法應用於客戶端,包括:回應於來自服務端的推送訊息,基於預定的Activity啟動規則對該推送訊息進行解析;若解析失敗,則確定本客戶端未配置該Activity啟動規則,則將該推送訊息攜帶的啟動字串轉換為Intent;基於該Intent創建PendingIntent:當該PendingIntent對應的通知欄訊息被觸發時,啟動該推送訊息對應的Activity;若解析成功,則基於該Activity啟動規則創建PendingIntent,當該PendingIntent對應的通知欄訊息被觸發時,啟動該推送訊息對應的Activity。 A method for starting an activity in an Android system, which is applied to a client, includes: responding to a push message from a server, and analyzing the push message based on a predetermined activity start rule; if the analysis fails, it is determined that the client is not configured Activity start rule, then convert the start string carried in the push message into an Intent; create a PendingIntent based on the Intent: when the notification bar message corresponding to the PendingIntent is triggered, start the activity corresponding to the push message; if the analysis succeeds, it is based on The Activity startup rule creates a PendingIntent, and when the notification bar message corresponding to the PendingIntent is triggered, the Activity corresponding to the push message is started. 根據請求項1所述的方法,該啟動字串位於該推送訊息的指定欄位中。 According to the method described in claim 1, the activation string is located in a designated field of the push message. 根據請求項1所述的方法,還包括:當該推送訊息攜帶的啟動字串無法轉換為Intent時,結束處理流程。 The method according to claim 1, further comprising: when the activation string carried in the push message cannot be converted into an Intent, ending the processing flow. 根據請求項1所述的方法,該推送訊息攜帶的啟動字串預先基於該推送訊息對應 的Activity配置。 According to the method described in claim 1, the activation string carried in the push message is based on the push message corresponding to Activity configuration. 一種Android系統Activity的啟動裝置,該裝置應用於客戶端,包括:解析單元,回應於來自服務端的推送訊息,基於預定的Activity啟動規則對該推送訊息進行解析;轉換單元,若解析失敗,則確定本客戶端未配置該Activity啟動規則,則將該推送訊息攜帶的啟動字串轉換為Intent:創建單元,基於該Intent創建PendingIntent;啟動單元,當該PendingIntent對應的通知欄訊息被觸發時,啟動該推送訊息對應的Activity;若解析成功,則基於該Activity啟動規則創建PendingIntent,當該PendingIntent對應的通知欄訊息被觸發時,啟動該推送訊息對應的Activity。 An activation device for Android system Activity. The device is applied to a client and includes: a parsing unit, which responds to a push message from a server, and parses the push message based on a predetermined activity startup rule; a conversion unit, if the parsing fails, it determines This client does not configure the activity start rule, then the start string carried in the push message is converted into an Intent: create a unit, create a PendingIntent based on the intent; start a unit, when the notification bar message corresponding to the PendingIntent is triggered, start the The activity corresponding to the push message; if the analysis is successful, a PendingIntent is created based on the activity start rule, and when the notification bar message corresponding to the PendingIntent is triggered, the activity corresponding to the push message is started. 根據請求項5所述的裝置,該啟動字串位於該推送訊息的指定欄位中。 According to the device described in claim 5, the activation string is located in a designated field of the push message. 根據請求項5所述的裝置,該轉換單元,在該推送訊息攜帶的啟動字串無法轉換為Intent時,結束處理流程。 According to the device described in claim 5, the conversion unit ends the processing flow when the activation string carried in the push message cannot be converted into an Intent. 根據請求項5所述的裝置, 該推送訊息攜帶的啟動字串預先基於該推送訊息對應的Activity配置。 The device according to claim 5, The activation string carried in the push message is based on the activity configuration corresponding to the push message in advance. 一種Android系統Activity的啟動裝置,該裝置應用於客戶端,包括:處理器;用於儲存機器可執行指令的記憶體;其中,透過讀取並執行該記憶體儲存的與Android系統Activity的啟動邏輯對應的機器可執行指令,該處理器被促使:回應於來自服務端的推送訊息,基於預定的Activity啟動規則對該推送訊息進行解析;若解析失敗,則確定本客戶端未配置該Activity啟動規則,則將該推送訊息攜帶的啟動字串轉換為Intent;基於該Intent創建PendingIntent;當該PendingIntent對應的通知欄訊息被觸發時,啟動該推送訊息對應的Activity;若解析成功,則基於該Activity啟動規則創建PendingIntent,當該PendingIntent對應的通知欄訊息被觸發時,啟動該推送訊息對應的Activity。 An activation device for Android system Activity. The device is applied to a client and includes: a processor; a memory for storing machine executable instructions; wherein, the activation logic stored in the memory and the Android system Activity is read and executed Corresponding machine executable instructions, the processor is prompted: in response to the push message from the server, the push message is parsed based on the predetermined activity start rule; if the analysis fails, it is determined that the client does not configure the activity start rule, Then convert the start string carried in the push message into an Intent; create a PendingIntent based on the Intent; when the notification bar message corresponding to the PendingIntent is triggered, start the activity corresponding to the push message; if the analysis is successful, start the rule based on the activity Create a PendingIntent, and start the activity corresponding to the push message when the notification bar message corresponding to the PendingIntent is triggered.
TW108107051A 2018-06-11 2019-03-04 Method and device for starting Active system of Android system TWI714006B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810596983.8 2018-06-11
CN201810596983.8A CN109150951B (en) 2018-06-11 2018-06-11 Method and device for starting Activity of Android system

Publications (2)

Publication Number Publication Date
TW202001554A TW202001554A (en) 2020-01-01
TWI714006B true TWI714006B (en) 2020-12-21

Family

ID=64801892

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108107051A TWI714006B (en) 2018-06-11 2019-03-04 Method and device for starting Active system of Android system

Country Status (3)

Country Link
CN (1) CN109150951B (en)
TW (1) TWI714006B (en)
WO (1) WO2019237780A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109150951B (en) * 2018-06-11 2020-05-29 阿里巴巴集团控股有限公司 Method and device for starting Activity of Android system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103593605B (en) * 2013-10-24 2016-11-09 复旦大学 A kind of Android platform application program dynamic analysis system based on authority usage behavior
CN105700896B (en) * 2014-11-24 2019-03-08 阿里巴巴集团控股有限公司 A kind of starting method and apparatus of App
CN104486389B (en) * 2014-12-04 2018-02-13 上海斐讯数据通信技术有限公司 Communication port method for building up and system between a kind of window management service and APP
US20180017403A1 (en) * 2016-07-12 2018-01-18 Google Inc. Navigation API for Linking Software Applications
CN106775817A (en) * 2016-11-23 2017-05-31 深圳铂睿智恒科技有限公司 Intelligent terminal is spread its tail control method, system and the intelligent terminal of advertisement
US20180160252A1 (en) * 2016-12-05 2018-06-07 Microsoft Technology Licensing, Llc Pre-provisioning of a device
CN106897057B (en) * 2017-01-20 2020-10-16 北京奇虎科技有限公司 Method and device for calling notification bar by plug-in
CN107193674B (en) * 2017-06-29 2020-01-03 武汉斗鱼网络科技有限公司 Method and device for processing online push message
CN109150951B (en) * 2018-06-11 2020-05-29 阿里巴巴集团控股有限公司 Method and device for starting Activity of Android system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
"Android Notification的使用", https://yq.aliyun.com/articles/649735, 2017/02/17.
"Android Notification的使用", https://yq.aliyun.com/articles/649735, 2017/02/17. "將Intent序列化, 像Uri一樣傳遞Intent!!!", https://www.cnblogs.com/plokmju/p/7660825.html, 2017/10/13. "Android小技巧——Uri启动Activity", https://blog.csdn.net/DaltSoftware/article/details/78962405, 2018/01/03. *
"Android小技巧——Uri启动Activity", https://blog.csdn.net/DaltSoftware/article/details/78962405, 2018/01/03.
"將Intent序列化, 像Uri一樣傳遞Intent!!!", https://www.cnblogs.com/plokmju/p/7660825.html, 2017/10/13.

Also Published As

Publication number Publication date
CN109150951A (en) 2019-01-04
CN109150951B (en) 2020-05-29
TW202001554A (en) 2020-01-01
WO2019237780A1 (en) 2019-12-19

Similar Documents

Publication Publication Date Title
US11213743B2 (en) Method, system and electronic device for achieving remote control of computer game by game controller
US10963447B2 (en) Automatic lock removal method for scalable synchronization in dynamic data structures
WO2020024408A1 (en) Test device, test method and storage medium
JP2019518257A (en) State control method and apparatus
US20180302350A1 (en) Method for determining candidate input, input prompting method and electronic device
WO2020221105A1 (en) Short voice message processing method and device, and medium
US20160150009A1 (en) Actionable souvenir from real-time sharing
JP2011040045A (en) Dynamic content preference and behavior sharing between computing devices
KR20170098795A (en) Contextually aware dynamic group formation
WO2018090871A1 (en) Application service indication method and application service indication device
US20170134364A1 (en) Note update method and device
WO2019071928A1 (en) Method and apparatus for implementing list view, and readable storage medium and device
TWI714006B (en) Method and device for starting Active system of Android system
JP6507263B2 (en) Content filtering based on user mobile network and data plan
CN111111201A (en) Skill creating method, skill creating device, skill creating server and skill creating medium based on game
US20170188214A1 (en) Method and electronic device for sharing multimedia information
US20240091655A1 (en) Method, apparatus, electronic device and storage medium for game data processing
CN107357481B (en) Message display method and message display device
US8655865B1 (en) Method and apparatus for indexing rich internet content using contextual information
WO2019237949A1 (en) Search method and device
US10608900B2 (en) Generating a deferrable data flow
CN113672757B (en) Audio playing method and device
WO2017084358A1 (en) Camera parameter read-write method and apparatus, and terminal device
US20170263068A1 (en) Method for generating counting events and electronic device
US20140298287A1 (en) Methods and systems for creating data applications