How do I launch the LinkReader mobile app from within another mobile app?

For iOS:


Supported as of LinkReader v4.4

In order to launch LinkReader from you application, you may use the hplinkreader:// app URL. In the sample code below, LinkReader will be launched if it is installed on the user's device. Otherwise, the user will be directed to the AppStore to download it.
NSURL *readerURL = [NSURL URLWithString:@"hplinkreader://"];
if ( [[UIApplication sharedApplication] canOpenURL: readerURL] ) {
[[UIApplication sharedApplication] openURL:readerURL];
} else {
NSURL *appStoreURL = [NSURL URLWithString:@"https://itunes.apple.com/us/app/linkreader/id716209670?mt=8"];
[[UIApplication sharedApplication] openURL: appStoreURL];
}

Note for iOS9
In iOS9 you must whitelist any URL scheme your App wants to query in Info.plist under the LSApplicationQueriesSchemes key. Just add hplinkreader to the array, and you are all set to go.

For Android: 


Supported by LinkReader v4.1

In order to invoke the Android app the interested developer should implement the method as it is below:

private static final String LINKREADER_PACKAGE = "com.hp.link";

public void startLinkReaderApp(View view) {
    Intent intent = getPackageManager().getLaunchIntentForPackage(LINKREADER_PACKAGE);
    if (intent != null) {
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    } else {
        intent = new Intent(Intent.ACTION_VIEW);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setData(Uri.parse("market://details?id=" + LINKREADER_PACKAGE));
        startActivity(intent);
    }
}

The startLinkReaderApp method may be renamed as needed.

Feedback and Knowledge Base