J JohnK Active Member Licensed User Longtime User Jun 19, 2020 #1 Hi, Its been a loooong time since I was here, so sorry if this has been covered recently. Can we create a terminal app (ie no GUI/Activities, and run directly from the shell / terminal window)? I wish to do things in the shell / command line, that I cannot do with ASH scripting, but can within B4X
Hi, Its been a loooong time since I was here, so sorry if this has been covered recently. Can we create a terminal app (ie no GUI/Activities, and run directly from the shell / terminal window)? I wish to do things in the shell / command line, that I cannot do with ASH scripting, but can within B4X
DonManfred Expert Licensed User Longtime User Jun 19, 2020 #2 For windows (B4J) you can create nonui Apps. Not on Android. Upvote 0
J JohnK Active Member Licensed User Longtime User Jun 19, 2020 #3 thanks. I saw it on the Java Code builder UI, but did not check it in the latest version of B4A. am I the only one that wants this feature? Upvote 0
thanks. I saw it on the Java Code builder UI, but did not check it in the latest version of B4A. am I the only one that wants this feature?
DonManfred Expert Licensed User Longtime User Jun 19, 2020 #4 Android does not provide a shell your could use. Android is designed to run APKs. You can create as much Apps as you want and call one of the apps from your app. There is no such thing as nonui in Android. Upvote 0
Android does not provide a shell your could use. Android is designed to run APKs. You can create as much Apps as you want and call one of the apps from your app. There is no such thing as nonui in Android.
B Brian Dean Well-Known Member Licensed User Longtime User Jun 19, 2020 #5 am I the only one that wants this feature? Click to expand... What feature are you talking about? If you mean writing a non-UI utility running under Windows or Linux then DonManfred has already answered your question. Look at B4J. Upvote 0
am I the only one that wants this feature? Click to expand... What feature are you talking about? If you mean writing a non-UI utility running under Windows or Linux then DonManfred has already answered your question. Look at B4J.
J JohnK Active Member Licensed User Longtime User Jun 19, 2020 #6 Brian Dean said: What feature are you talking about? If you mean writing a non-UI utility running under Windows or Linux then DonManfred has already answered your question. Look at B4J. Click to expand... No, its android specific. We are in the "B4A - Android" forum. And he answered that it currently does not. And hence the question if I am the only one. Upvote 0
Brian Dean said: What feature are you talking about? If you mean writing a non-UI utility running under Windows or Linux then DonManfred has already answered your question. Look at B4J. Click to expand... No, its android specific. We are in the "B4A - Android" forum. And he answered that it currently does not. And hence the question if I am the only one.
B Brian Dean Well-Known Member Licensed User Longtime User Jun 19, 2020 #7 No, its android specific. Click to expand... Okay. But I think that you should be asking Google this question. They are the "it" that does not currently provide a "terminal app", surely. Or are we talkjing about something like "connectivity services"? Upvote 0
No, its android specific. Click to expand... Okay. But I think that you should be asking Google this question. They are the "it" that does not currently provide a "terminal app", surely. Or are we talkjing about something like "connectivity services"?
aeric Expert Licensed User Longtime User Jun 19, 2020 #8 Check Termux Termux - Apps on Google Play Terminal emulator and Linux environment. play.google.com Upvote 0
DonManfred Expert Licensed User Longtime User Jun 19, 2020 #9 aeric said: Check Termux Click to expand... Even with that said you are not able to create apps which you are able run in such a shell using b4x Upvote 0
aeric said: Check Termux Click to expand... Even with that said you are not able to create apps which you are able run in such a shell using b4x
cimperia Active Member Licensed User Longtime User Jun 19, 2020 #10 Thanks for the link @aeric . Upvote 0
aeric Expert Licensed User Longtime User Jun 19, 2020 #11 DonManfred said: Even with that said you are not able to create apps which you are able run in such a shell using b4x Click to expand... I never tested it. I thought we can create a .jar file using B4J and run inside that emulator. Upvote 0
DonManfred said: Even with that said you are not able to create apps which you are able run in such a shell using b4x Click to expand... I never tested it. I thought we can create a .jar file using B4J and run inside that emulator.
J JohnK Active Member Licensed User Longtime User Jun 19, 2020 #12 I don't think I am being understood. I am not looking to create a terminal nor use a terminal to run shell scripts. I am looking to create apps that have no UI and can be run directly from a shell command/script, and outputs text to stdout and stderr. They are commands that you run within a terminal. If you are an old windows user, think commands run at the command prompt. For unix, think bash commands/scripts (its almost the same in android). For example, if you open a terminal on an android device, there are thousands of commands you can run. Some examples: Code: Copy getenforce; Will return the SELinux enforcing state Code: Copy free; Will return a summary of your devices memory Code: Copy cmd package list packages -3; Will return a list of 3rd party packages installed on the device Code: Copy dumpsys batterystats; Will output your devices battery stats and history. People often confuse these with being a part of ADB, but in most cases they are simply shelling out and running the command on the device from a pc. Upvote 0
I don't think I am being understood. I am not looking to create a terminal nor use a terminal to run shell scripts. I am looking to create apps that have no UI and can be run directly from a shell command/script, and outputs text to stdout and stderr. They are commands that you run within a terminal. If you are an old windows user, think commands run at the command prompt. For unix, think bash commands/scripts (its almost the same in android). For example, if you open a terminal on an android device, there are thousands of commands you can run. Some examples: Code: Copy getenforce; Will return the SELinux enforcing state Code: Copy free; Will return a summary of your devices memory Code: Copy cmd package list packages -3; Will return a list of 3rd party packages installed on the device Code: Copy dumpsys batterystats; Will output your devices battery stats and history. People often confuse these with being a part of ADB, but in most cases they are simply shelling out and running the command on the device from a pc.
DonManfred Expert Licensed User Longtime User Jun 19, 2020 #13 aeric said: I never tested it. I thought we can create a .jar file using B4J and run inside that emulator. Click to expand... to run a jar file the path to the java executeable must be known. I do not think that there is a JDK installed on my Device. I do have termux installed.... I tried to call java from the console. No command java found. Upvote 0
aeric said: I never tested it. I thought we can create a .jar file using B4J and run inside that emulator. Click to expand... to run a jar file the path to the java executeable must be known. I do not think that there is a JDK installed on my Device. I do have termux installed.... I tried to call java from the console. No command java found.
DonManfred Expert Licensed User Longtime User Jun 19, 2020 #14 JohnK said: Some examples Click to expand... Yes, right. But probably none of them is written in java. They are native linux apps. Again: you CAN create nonui apps (jar) with b4j and you can run this apps/jars on any machine capable of running java apps. On windows/linux a JDK must be installed. On Android it is not possible. Upvote 0
JohnK said: Some examples Click to expand... Yes, right. But probably none of them is written in java. They are native linux apps. Again: you CAN create nonui apps (jar) with b4j and you can run this apps/jars on any machine capable of running java apps. On windows/linux a JDK must be installed. On Android it is not possible.
aeric Expert Licensed User Longtime User Jun 19, 2020 #15 DonManfred said: to run a jar file the path to the java executeable must be known. I do not think that there is a JDK installed on my Device. I do have termux installed.... I tried to call java from the console. No command java found. Click to expand... How about this? Installing and using Java in Termux Hey Guys Today, I am trying to execute java program in Termux. To run java program, you needs to install two packages – Eclipse – Compiler for Java dx – Command which takes in cl… hacksj4u.wordpress.com Upvote 0
DonManfred said: to run a jar file the path to the java executeable must be known. I do not think that there is a JDK installed on my Device. I do have termux installed.... I tried to call java from the console. No command java found. Click to expand... How about this? Installing and using Java in Termux Hey Guys Today, I am trying to execute java program in Termux. To run java program, you needs to install two packages – Eclipse – Compiler for Java dx – Command which takes in cl… hacksj4u.wordpress.com
J JohnK Active Member Licensed User Longtime User Jun 20, 2020 #16 DonManfred said: Yes, right. But probably none of them is written in java. They are native linux apps. Again: you CAN create nonui apps (jar) with b4j and you can run this apps/jars on any machine capable of running java apps. On windows/linux a JDK must be installed. On Android it is not possible. Click to expand... I was actually thinking about something related to this. If I was to create a NON-UI app using B4J, it would seem logical I could take the source, and compile using the JDK targeting android? Regarding Termux, I don't want another dependency. There should be no need for such a dependency. As for my examples, I also build full ROMs from source. Some or similar stand alone android apps are built as part of the ToyBox build (check your devices' /system/xbgin and/or /system/bin folders). I haven't explicitly checked if some are written in java, or all are C/C++, but there is no "Native Linux" programming language. There are device specific proprietary binaries (such as bootloader and hardware drivers), but the commands above and similar are not part of those; they are within the android source, somewhere. I am pretty sure busybox is written in C (here is the beep command source in C https://git.busybox.net/busybox/tre...e&id=be947c4d97c0dacb703a6f24dd813ff6dd3a33b6 which does not work on either of my devices) so would expect the same from ToyBox, but there is no reason in my mind that some parts or similar may not of, but could of been written in Java. I think my best bet would be to bite the bullet and code then up using notepad (Java). I am only looking at some VERY simple features such as toasts & "beep" (triggered from the command line), so they shouldn't be much code nor complexity. And then compile them using the command line. Weird thing is that all examples I can find on the internet are for apps with an Activity. Upvote 0
DonManfred said: Yes, right. But probably none of them is written in java. They are native linux apps. Again: you CAN create nonui apps (jar) with b4j and you can run this apps/jars on any machine capable of running java apps. On windows/linux a JDK must be installed. On Android it is not possible. Click to expand... I was actually thinking about something related to this. If I was to create a NON-UI app using B4J, it would seem logical I could take the source, and compile using the JDK targeting android? Regarding Termux, I don't want another dependency. There should be no need for such a dependency. As for my examples, I also build full ROMs from source. Some or similar stand alone android apps are built as part of the ToyBox build (check your devices' /system/xbgin and/or /system/bin folders). I haven't explicitly checked if some are written in java, or all are C/C++, but there is no "Native Linux" programming language. There are device specific proprietary binaries (such as bootloader and hardware drivers), but the commands above and similar are not part of those; they are within the android source, somewhere. I am pretty sure busybox is written in C (here is the beep command source in C https://git.busybox.net/busybox/tre...e&id=be947c4d97c0dacb703a6f24dd813ff6dd3a33b6 which does not work on either of my devices) so would expect the same from ToyBox, but there is no reason in my mind that some parts or similar may not of, but could of been written in Java. I think my best bet would be to bite the bullet and code then up using notepad (Java). I am only looking at some VERY simple features such as toasts & "beep" (triggered from the command line), so they shouldn't be much code nor complexity. And then compile them using the command line. Weird thing is that all examples I can find on the internet are for apps with an Activity.
J JohnK Active Member Licensed User Longtime User Jun 20, 2020 #17 hey, just came across one example for the "pm" function. Which can be called from the shell interface on your device eg: Code: Copy pm list packages -3' cmds/pm/src/com/android/commands/pm/Pm.java - platform/frameworks/base - Git at Google Upvote 0
hey, just came across one example for the "pm" function. Which can be called from the shell interface on your device eg: Code: Copy pm list packages -3' cmds/pm/src/com/android/commands/pm/Pm.java - platform/frameworks/base - Git at Google