Reply
Thread Tools
Posts: 207 | Thanked: 552 times | Joined on Jul 2011
#1
I've just found the Termux and Termux:API apps in Google Play and I thought I'd point them out because they add some interesting goodness to your Android 5.0+ device (root not required).

Once you've installed Termux you can open it and run:
$ apt install python
to install Python 3.5. I think Ruby, Lua and others are also available.

Installing Termux:API gives you CLI utilities with the ability to access device capabilities like camera, gps, sms, etc... I haven't tested it yet but I think you should be able to access these from your Python scripts using subprocess / shlex.

Both of the above are free and there's an additional modestly priced app, Termux:Widget, that adds a widget to your homescreen that you can use to provide shortcuts to your scripts.
 

The Following 3 Users Say Thank You to switch-hitter For This Useful Post:
bandora's Avatar
Posts: 1,338 | Thanked: 1,055 times | Joined on Oct 2009 @ California, USA / Jordan
#2
Nice! I usually use JuiceSSH to SSH into my linux box and do stuff there.. But this is nice too!
__________________
FarahFa.com
 
Posts: 100 | Thanked: 307 times | Joined on Jan 2015 @ Argentina
#3
Hi, I installed all the apps availables about Termux from f-droid on a Xiaomi Redmi 4a Android 6

It's good this. No requires root, and you can do many things, like executing a script, install man, python. Now I installed the default version

Code:
Python 3.6.3 (default, Oct  6 2017, 07:46:32)
[GCC 4.2.1 Compatible Android Clang 5.0.300080 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
But it doesn't have the SimpleHTTPServer module

Code:
$ python -m SimpleHTTPServer
/data/data/com.termux/files/usr/bin/python: No module named SimpleHTTPServer
Any idea how to get/add this module?


Still I am unable to reproduce audio .wav
Installed paplay (i couldn't find aplay)
but
Code:
$ paplay C4.wav
W: [pulseaudio] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
When audio issue get solved I could use espeak (actually installed but no audio )
 

The Following User Says Thank You to maegon9y00 For This Useful Post:
endsormeans's Avatar
Posts: 3,141 | Thanked: 8,161 times | Joined on Feb 2013 @ From my Gabriola Island hermitage, near the Edge of the World
#4
.wav ?

hm.
is it critical for you to be able to play .wav?
it is after all in fact proprietary in nature .
As in ..."owned by microswift and IBM "
so getting the right to develop any software to run .wav has to go through them naturally.
Meaning...no one really wants to pay either or both of them money to use their format.

considering termux "is" terminal...
shouldn't CMUS or MOC run fine?
Normally fine ...I mean...
As in ..any of the other formats?
Both are more than adequate audio players...
there are others ...but those two are pretty decent...

update:

In fact ...come to think of it...
aplay most assuredly should play .wav ....through ALSA
but not pulse
Pulse is a No go.
No one is going to "fix" it.
This is Pulse's issue ..
Pulse's decision..
their dominion so to speak...

...and the state of Pulse and .wav has pretty much been this way for ...what...ever? ...I think...
It isn't about to get "fixed" ...since it was never broken to begin with...
since Pulseaudio doesn't run .wav

And yup...aplay should be running the .wav via ALSA
but...
not via Pulseaudio.
Pulseaudio in the mix just mucks things up for you.

the routing is not right ...(at least not right for running .wav)

I am sure there is some obscure freakin' weird ***** fix out there ...where you can run .wav through pulse ...but the brain tumour you will develop in trying to "fix" this so it runs through Pulse...may not be worth it.
__________________
Lurker since 2007, Member since 2013, Certifiable since 1972

Owner of :
1-n770 (in retirement), 3-n800's / 3-n810's (still in daily use), 5-n900's ((3 are flawless, 1 loose usb ( parts), 1 has no telephony (parts))
3-nexus 5's : 1 w/ Floko Pie 9.1 (running beautifully) waiting for Stable Droid 10 rom, 1 w/ ̶Ubuntu Touch, 1 with Maru OS (intend maemo leste when ready)

1/2 - neo900 pre- "purchased" in 2013. N̶o̶w̶ ̶A̶w̶a̶i̶t̶i̶n̶g̶ ̶r̶e̶f̶u̶n̶d̶ ̶p̶r̶o̶c̶e̶s̶s̶ ̶l̶a̶s̶t̶ ̶f̶e̶w̶ ̶y̶e̶a̶r̶s̶ - neo900 start up declared officially dead -
Lost invested funds.


PIMP MY N8X0 (Idiot's Guide and a video walkthrough)http://talk.maemo.org/showthread.php?t=94294
THE LOST GRONMAYER CATALOGShttp://talk.maemo.org/showthread.php...ight=gronmayer
N8X0 VIDEO ENCODING THE EASY WAYhttp://talk.maemo.org/showthread.php...ght=mediacoder
242gb ON N800http://talk.maemo.org/showthread.php?t=90634
THE PAIN-FREE MAEMO DEVELOPMENT LIVE DISTRO-ISO FOR THE NOOB TO THE PROhttp://talk.maemo.org/showthread.php?t=95567
AFFORDABLE MASS PRODUCTION FOR MAEMO PARTShttp://talk.maemo.org/showthread.php?t=93325

Meateo balloons now available @ Dave999's Meateo Emporium

Last edited by endsormeans; 2017-11-28 at 13:44.
 

The Following User Says Thank You to endsormeans For This Useful Post:
Posts: 100 | Thanked: 307 times | Joined on Jan 2015 @ Argentina
#5
What I really want is to use terminal as I use it in n900.
my purpose is use the espeak in the way worked on n900.
You could set a simple reminder like

Code:
$ sleep 600; espeak "hey buddy, 10 minutes of nap is enough. Go back to work now"
This kind of use i am pointing in. But actually, espeak
Doesn't make a sound in termux
 
Posts: 54 | Thanked: 208 times | Joined on Oct 2011 @ Brazil
#6
Originally Posted by maegon9y00 View Post
But it doesn't have the SimpleHTTPServer module

Code:
$ python -m SimpleHTTPServer
/data/data/com.termux/files/usr/bin/python: No module named SimpleHTTPServer
Any idea how to get/add this module?
SimpleHTTPServer is a Python 2 module.

Code:
$ apt install python2
$ python2 -m SimpleHTTPServer
 

The Following 3 Users Say Thank You to brunelli For This Useful Post:
Posts: 100 | Thanked: 307 times | Joined on Jan 2015 @ Argentina
#7
Excellent! THANKS brunelli

$ python2 -m SimpleHTTPServer running!

Code:
python2 -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
 

The Following User Says Thank You to maegon9y00 For This Useful Post:
Ken-Young's Avatar
Posts: 387 | Thanked: 1,700 times | Joined on Feb 2010 @ Cambridge, MA, USA
#8
Originally Posted by maegon9y00 View Post
What I really want is to use terminal as I use it in n900.
my purpose is use the espeak in the way worked on n900.
You could set a simple reminder like

Code:
$ sleep 600; espeak "hey buddy, 10 minutes of nap is enough. Go back to work now"
This kind of use i am pointing in. But actually, espeak
Doesn't make a sound in termux
espeak won't directly produce audio under termux, for some reason. But you can produce a .wav file, and play it with play-audio:

Code:
$ sleep 600; espeak -w temp.wav "hey buddy, 10 minutes of nap is enough. Go back to work now";play-audio temp.wav;rm temp.wav
That works, at least on my Pixel XL.
 

The Following User Says Thank You to Ken-Young For This Useful Post:
Posts: 100 | Thanked: 307 times | Joined on Jan 2015 @ Argentina
#9
Great!. Yes, it works here also. Xiaomi Redmi 4a.

I have another script I wanna run on termux. It's about the number of days passed since birthday. The next week or perhaps this weekend I'll do the tests
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 22:44.