I am working on automating the process of launching the dependencies for an android project. One of the dependencies is launching Termux (Installed through F-Droid not Play store as recommended).
I am trying to launch the installed Termux application through another application and add some commands to its ~./bashrc file for the sake of automation. I know that an installed app can be launched trough another android app (more details are here).
I wonder to know if this is possible for Termux as well? I wonder to know if we can use intent concept to launch Termux from an android app as well? If yes what is the Termux package name? I tried using "com.termux" as its packagename in my sample code, but it did not work. In other words, the following line returns null:
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.termux");
<>上>
我可以打开另一台安装的器具(我开发并安装在桌旁的纸面上),使用上文所示的“静态”概念(用替代适当的包装名称,而不是用词包名称)。
Note: I have installed the Termux through F-Drioid not google play store.
<>新观测:
- I confirmed through Package names application the Termux package name is "com.termux" and its activity class name is also "com.termux.app.termuxActivity"
- But seems like the "com.termux" is not accessible through package manager. When i try to pass "com.termux" to the following function it returns false.
任何想法或建议?
public boolean isPackageExisted(String targetPackage){
enter code here
PackageManager pm=getPackageManager();
try {
PackageInfo info=pm.getPackageInfo(targetPackage,PackageManager.GET_META_DATA);
} catch (PackageManager.NameNotFoundException e) {
return false;
}
return true;
}