I downloaded a C compiler for my tablet from the Play Store called C4droid. It cost $3. It locally compiles and runs a C program. The set up of an Android system is a problem though. I feel like I'm living in a tiny little box and every time I try to move to do anything I bump in to a wall. The file system permissions are set up in such a way that I can't run my code without this software setting it up and it can only set up one program at a time. I feel like I'm wearing handcuffs while using this tablet.
I have included a copy of my little program here along with its output...
bash-4.3$ cat /sdcard/C/show_args.c
#include <stdio.h>
#include <stdlib.h>
int main( int argc, char **argv )
{
int count;
printf( "Program name: %s\n", argv[ 0 ] );
if ( argc > 1 )
{
for( count = 1; count < argc; count++ )
{
printf( "argv[ %d ]: %s\n", count, argv[ count ] );
}
}
exit( 0 );
}
/* EOF */
bash-4.3$run
Program name: /data/data/com.n0n3m4.droidc/files/temp
bash-4.3$ ls -l /data/data/com.n0n3m4.droidc/files/temp
-rwxrwxrwx u0_a355 u0_a355 28784 2017-12-08 21:37 temp
bash-4.3$ ls -al /data/data/com.n0n3m4.droidc/files
opendir failed, Permission denied
bash-4.3$
The command 'run' is an alias to run the above program as it is sure a lot easier to type. If I copy the 'temp' binary to /sdcard/C/ then it winds up with 0660 instead of 0777 and is owned by root:sdcard_r showing me to be a member of the sdcard_r group.
The compiler also seems to support something called GIT. What is that? Does it stand for something like Graphical Interface Toolkit? This compiler is supposed to allow me to write and make my own apps (apk) right on my tablet, which would sure solve the one program at a time problem.
I used Termius to run the program in the listing above. The C4droid program has its own terminal emulator. The included shells on my tablet are extremely limited along with any command bins.
What do I need to #include and call to set up an apk app? Is there a free tutorial somewhere?
Any helpful comments would be appreciated. Thank you.
Signed,
Matthew Campbell
I have included a copy of my little program here along with its output...
bash-4.3$ cat /sdcard/C/show_args.c
#include <stdio.h>
#include <stdlib.h>
int main( int argc, char **argv )
{
int count;
printf( "Program name: %s\n", argv[ 0 ] );
if ( argc > 1 )
{
for( count = 1; count < argc; count++ )
{
printf( "argv[ %d ]: %s\n", count, argv[ count ] );
}
}
exit( 0 );
}
/* EOF */
bash-4.3$run
Program name: /data/data/com.n0n3m4.droidc/files/temp
bash-4.3$ ls -l /data/data/com.n0n3m4.droidc/files/temp
-rwxrwxrwx u0_a355 u0_a355 28784 2017-12-08 21:37 temp
bash-4.3$ ls -al /data/data/com.n0n3m4.droidc/files
opendir failed, Permission denied
bash-4.3$
The command 'run' is an alias to run the above program as it is sure a lot easier to type. If I copy the 'temp' binary to /sdcard/C/ then it winds up with 0660 instead of 0777 and is owned by root:sdcard_r showing me to be a member of the sdcard_r group.
The compiler also seems to support something called GIT. What is that? Does it stand for something like Graphical Interface Toolkit? This compiler is supposed to allow me to write and make my own apps (apk) right on my tablet, which would sure solve the one program at a time problem.
I used Termius to run the program in the listing above. The C4droid program has its own terminal emulator. The included shells on my tablet are extremely limited along with any command bins.
What do I need to #include and call to set up an apk app? Is there a free tutorial somewhere?
Any helpful comments would be appreciated. Thank you.
Signed,
Matthew Campbell