Notices


Reply
Thread Tools
Posts: 201 | Thanked: 529 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,337 | Thanked: 1,048 times | Joined on Oct 2009 @ Michigan, 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: 81 | Thanked: 217 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: 2,028 | Thanked: 4,718 times | Joined on Feb 2013 @ Supa Natural Vancouver Island
#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,
5-n900's
-3 flawless
-1 loose usb (i don't muck with it & stress it , considering selling it, another can fix the loose usb)
-1 no telephony (perfect for permanent set-up as mini-pc with one of my monitors)
half a neo900 pre- "bought"....due for production any day now.


PIMP MY N8X0
Everything you need tightly explained in layman's terms ..in an easy to understand format.. and a video walkthrough to boot.
http://talk.maemo.org/showthread.php?t=94294
THE LOST GRONMAYER CATALOGS
http://talk.maemo.org/showthread.php...ight=gronmayer
N8X0 VIDEO ENCODING THE EASY WAY
http://talk.maemo.org/showthread.php...ght=mediacoder
242gb ON N800
http://talk.maemo.org/showthread.php?t=90634

THE PAIN-FREE MAEMO DEVELOPMENT LIVE DISTRO-ISO FOR THE NOOB TO THE PRO
http://talk.maemo.org/showthread.php?t=95567

AFFORDABLE MASS PRODUCTION FOR MAEMO PARTS
http://talk.maemo.org/showthread.php?t=93325

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

The Following User Says Thank You to endsormeans For This Useful Post:
Posts: 81 | Thanked: 217 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: 52 | Thanked: 188 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: 81 | Thanked: 217 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: 349 | Thanked: 1,401 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: 81 | Thanked: 217 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 17:15.