I'm just getting started with java. I'm looking to open chrome to a specific page using a JNI from a button in the UI. I'm getting an error that the chrome file cannot be found. My questions are:
- Can be chrome be found in the same place on all android phones?
- If so, what is the path?
- If not, how would you approach finding the path to chrome here?
- Is there an import required on this page to make this function happen?
- Do I need to enable a permission in my app package to achieve this?
Runtime runtime = Runtime.getRuntime();
String[] s = new String[] {"\\system\\app\\Chrome\\Chrome.apk", "https://www.google.com"};
try
{
runtime.exec(s);
}
catch (IOException e)
{
e.printStackTrace();
}
and then the error
W System.err: java.io.IOException: Cannot run program "\system\app\Chrome\Chrome.apk": error=2, No such file or directory
Thank you in advance!