Android

Copy arr library file in the libs folder of App-level directory (create if missing)

After, Add arr file and additional library as below.

2. AndroidManifest.xml settings

Add Internet permission for servlet communication.

3. Host, Scheme setting

  • launchMode of Activity will not operate properly, if it is not a "singleTask" on a specific browser.

  • The scheme, host, and past MUST be equal to set items on RSBridge for JSP.

  • scheme uses the custom scheme like "rsbsample" and Android may be able to use a known scheme such as "http", "https".

  • scheme can apply more than one as shown as the above example. At this time, intent-filter may be able to create separately depending on whether the host and path.

4. API

4.1 Create

CLASS

Content

Purpose

Creator for initial implementation

Use

OmniLinkManager(this, OmniLinkListener)

Parameter

Activity, OmniLinkListener

Return

void

Example

var omniLinkManager = OmniLinkManager(this, object: OmniLinkListener {

override fun receive(data: String) {

}

override fun sendFinish() {

}

})

Note

  • Creator

4.2 setPackageName

CLASS

Content

Purpose

Redirects to the market, when target App is not stored on the device

Use

setPackageName(String)

Parameter

packageName

Return

void

Example

omniLinkManager.setPackageName(“target package name”)

Note

  • Use the transmitting App

  • Returns the error msg when the Package is not saved

4.3 setActivity

CLASS

Content

Purpose

Use when the target App already exists in the Os stack

Use

setActivity(Activity)

Parameter

activity

Return

void

Example

omniLinkManager.setActivity(this)

Note

  • uses the target App

4.4 callApp

CLASS

Content

Purpose

Use when calling and forward data from the transmitting App to the target App

Use

callApp(String, String, String, String)

Parameter

host, scheme, type, select

Return

void

Example

omniLinkManager.callApp(this)

Note

  • Uses the transmitting App

4.5 returnResult

CLASS

Content

Purpose

Forwards the Result data to the transmitting App

Use

callApp(OmniLinkData)

Parameter

omniLinkData

Return

void

Example

omniLinkManager.returnResult(omniLinkData)

Note

  • Uses the target App

4.6 receiveResult

CLASS

Content

Purpose

parsing the delivered data from the target app to transmitting app

Use

receiveResult(Int, Int, Intent)

Parameter

requestCode, resultCode, intent

Return

void

Example

omniLinkManager.receiveResult(requestCode, resultCode, intent)

Note

  • Uses the transmitting App

4.7 isExistPackage

CLASS

Content

Purpose

Checks if an App in that package exists in the device

Use

isExistPackage(Context, String)

Parameter

context, packageName

Return

Boolean

Example

Util.isExistPackage(context, “package name”)

Note

  • Uses transmitting App

  • Uses target App

4.8 exit

CLASS

Content

Purpose

After exiting an App, removes the termination app in the OS stack

Use

exit(Activity)

Parameter

activity

Return

void

Example

Util.exit(this)

Note

  • Uses the transmitting App

5. Sample source

5.1 MainActivity.kt (Transmitting App)

5.2 MainActivity.kt (Target App)

Last updated

Was this helpful?