Skip to Content

Start native apps from a web page

There is a nice blog on SCN about how to use the portal on device to start native apps from Eyal Nathan The example used in the blog is about iOS and more for standard applications – like the twitter app. As the example shows a nice use case for having a mobile portal site with dynamically created content based on the user profile, let`s make sure that the app launcher feature also works on Android and also enhance the example a little bit.

When you develop your corporate app, you can define how the app can be called from a web page. For this, you have to add an intent filter to AndroidManifest.xml

<data android:scheme="name" android:host="host" android:pathPrefix="path" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

The important part here is <data>: this section defines a schema. When the schema is being invoked by the browser, the app will open. Each app can have several intent filters defined, so it is possible to assign the app to different schemes.


Trying this out is very easy. Just create a standard Android app and edit the AndroidManifest.xml.

<manifest xmlns:android=""
  android:versionName="1.0" >
  <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
    android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" >
      android:label="@string/title_activity_main" >
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <data android:scheme="tobiastest" android:host="sap" android:pathPrefix="/tobiashofmann" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="http" android:host="" android:pathPrefix="/tobiashofmann" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

This adds 3 intent filters to the app. The first one is standard, the second defines that the app is responsible for the schema tobiastest and the third one for a “normal” http link. To call the app from a web page, insert links to the 2 new schemes:



If the user clicks on the 1st link (><a href= “tobiastest://sap/tobiashofmann” />), the app is started directly.


If the user now clicks on the 2nd link (<a href= “” >Cool SAP app TobiasHofmann</a>), he gets asked which app to call.


This is because the schema used is HTTP and the browser apps are already registered for this schema.

The 2nd example shows that you have to be carefully in choosing the schema. You should only create one when you own the schema when you plan to make your application public. In case of internal applications, you should be able to use your company name (domain) as a schema name. In the later case you can use the same schema, host and separate apps by the path.


Define in AppA:

<data android:scheme=”tobiastest” android:host=”sap” android:pathPrefix=”/tobiashofmann” />

And in AppB

<data android:scheme=”tobiastest” android:host=”sap” android:pathPrefix=”/helloworld” />

Click a link for:

  • tobiastest://sap/tobiashofmann -> AppA will be called
  • tobiastest://sap/helloworld -> AppB will be called


You can use a web page – ideally portal on device with content delivery defined by roles – to give the users an easy way to start apps. The transition between web and native is transparent: meaning that it is easy to use the SAP Portal as a starting point for mobile workers. After logging in (for instance, to a HR mobile portal) they get a list of apps presented they need to execute the task. If the app is now online or native, the user does not need to know. Instead of going to the home screen of the smartphone and start searching for the right app, the portal does that for him.

When apps are delivered automatically to the users smartphone (via Afaria), users may even be switched over to a native app without even knowing it. For them, the way to access / start the app is the same.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.