2

On my Android phone are a (PAW) Web Server with PHP-plugin.

I wrote a PHP script, but no start application.

<?php
  echo("Hello World!");
  $output = exec('HelloWorld.apk');
  echo "<pre>$output</pre>";
?>

So how to run HelloWorld.apk or a HelloWorld.jar application from my webpage?

oers
  • 18,436
  • 13
  • 66
  • 75
Lewi
  • 23
  • 1
  • 6

1 Answers1

2

Android can not directly execute APKs or common compiled Java bytecode.

APKs have to be installed before you can execute them. If the user has enabled "install apps from unknown sources" you can provide the APK as separate download. Make sure that the MIME type of the downloaded APK file is correctly set to application/vnd.android.package-archive.

Then you can just link to the APK file in your web page. The user then is getting asked if he wants to install the App.

How you can start the app from a web page is already discussed here: Make a link in the Android browser start up my app?

Community
  • 1
  • 1
Robert
  • 39,162
  • 17
  • 99
  • 152