Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
Android

Ask Slashdot: Scripting-Friendly Smartphones? 197

Posted by timothy
from the also-must-have-infinite-battery-life-and-candy dept.
An anonymous reader writes "I am choosing a smartphone for work, moving up from a long history of just-a-phone phones. This coincides with moving into an environment where I will have a desktop machine in my office, rather using my laptop — so I'll VPN in from home, and am looking forward to not trucking my laptop around everywhere. BUT ... this means I now won't have my laptop all the time. I have gotten used to scripting various little things that make my life easier, and would like to carry that over to the phone. For example, periodically check that a certain machine is online and backing things up the way it is supposed to; if the lab monitoring system sends me an email that the -80 freezer is up to -50, play a sound and run the vibrate system in a specific, arbitrarily chosen pattern; when I press this button, record an MP3, when I release it prep an email with it attached, that sort of thing. Does such a beast exist? Has anyone used one and if so what do you think? Bonus points if you know if I can use it with Rogers (Canadian wireless provider used by my workplace)." I've heard good things about (but never used) the payware Android app called Tasker; what other recommendations do you have for running the world from a smartphone?
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Scripting-Friendly Smartphones?

Comments Filter:
  • by Anonymous Coward

    Any android phone that can be rooted + SL4A.

  • Your choices are... (Score:5, Informative)

    by Anonymous Coward on Sunday July 22, 2012 @10:01PM (#40733333)

    Nokia n900 would be my first choice for reasons that are obvious.

    HTC HD2 would be my second choice. Laugh if you must, but the interface HTC slapped over WM 6.5 makes it halfway decent and the APIs are open for pretty much anything you want to put on it.

    • by AbRASiON (589899) *

      I loved my HTC HD2
      Once I put Android on it - they even have 4.0.4 now. Very awesome.

    • by RobbieThe1st (1977364) on Monday July 23, 2012 @01:01AM (#40733977)

      It's as you said: Nokia N900, hands down.
      You get:
      1. Fully unlocked phone, unlocked bootloader and real Linux.
      2. Loads of "hacker" tools and apps.
      3. Busybox ash(stock) or full Bash if you want.
      4. The phone part is fully scriptable with dbus commands. There's even a dbus monitor daemon to run a script when a certain dbus signal is sent.
      5. Hardware keyboard, decent specs(CPU's a bit weak, but greatly overclockable), and good screen.
      6. Debian Chroot gives full LXDE system right on your phone if you need it.
      7. Real web-browser functionality: tablet-friendly stock microB(FF based, renders like FF 3), Firefox Mobile, Chromium(desktop version basically), Opera

      Really, it seems to be the only option.
      The N9 might also be doable, but there you have to enable developer mode, and have no hardware keyboard, screen's poorer(AMOLED vs LCD), and it's just more hassle.

  • Android Scriptin (Score:5, Informative)

    by Anonymous Coward on Sunday July 22, 2012 @10:07PM (#40733371)

    Don't forget about sl4a, it's still a legitimate project.

    • Re:Android Scriptin (Score:5, Informative)

      by bjwest (14070) on Sunday July 22, 2012 @10:27PM (#40733461)

      Don't know who the dumb fuck was going through modding all these posts down, but (s)he needs to have their head smacked.

      This is what I was going to suggest. Using sl4a [google.com] allows the use of Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell. That pretty much covers all the good scripting languages except Rexx, and I haven't heard much about Rexx in years.

      Of course, if you stop and think about it, Android's entire API is a scripting language, so...

      • Re: (Score:3, Informative)

        by timothyb89 (1259272)

        For added fun, Tasker has SL4A integration, so you can have Tasker run arbitrary scripts when various events occur. SL4A also lets you (in addition to its own APIs) lets you install, e.g., additional python modules, and the Java-interpreted scripting languages (BeanShell, Rhino, and probably JRuby) let you directly invoke the Android APIs. The latest Tasker release also has JavaScript support and exposes more device functionality to it than SL4A's APIs do.

        I'm not really sure what all of the hate for device

      • Re: (Score:2, Informative)

        by jones_supa (887896)

        Don't know who the dumb fuck was going through modding all these posts down, but (s)he needs to have their head smacked.

        As I noted yesterday [slashdot.org], there seems to be some malicious modding going on here.

        • *shrugs* there's always been malicious modding going on. Piss off the wrong person, and they'll stalk you next time they have modpoints and downmod everything in your history. How else can you explain month-old +5 posts suddenly getting a -1 troll mod literally the day after you call somebody out on their bullshit?

          The system is completely broken, sadly. Unsurprisingly, but sadly.

      • I don't know who has been modding down the sl4a posts, but whoever it is, he knows what he is doing.
        I have been working with sl4a lately because my son has an Android phone, and I can tell you that it is half baked. There is much functionality that is missing regardless of the language that you choose. Much of it just does not work. I made a python script to send an SMS message every 4 minutes. In the script I have a time.sleep(240). Ten minutes later... still no SMS message.

        If you want real scrip

    • Re: (Score:2, Interesting)

      by Anonymous Coward

      While sl4a can do some things you can't do otherwise, don't forget it is an alpha quality software -- that is, it is quite unreliable. It crashes often, it uses archaic APIs, runs slowly and uses megatons of memory.

      This is also true of Tasker -- while versatile, it is a resource and battery hog. There is a trial version on the website, so you should get it and give it a try. Maybe it isn't useful enough for you.

      There is also a cheaper Takser - AutomateIt (nagware) and Automateit Pro. This overlaps somewha

      • by donutz (195717)

        "This is also true of Tasker -- while versatile, it is a resource and battery hog."

        I see why you're posting this as Anonymous Coward. Because you clearly don't know what you're talking about.

        Tasker is not a battery hog. However, it doesn't prevent you from doing things that hog the battery. Want to keep your screen on and not let the phone sleep while unplugged? Knock yourself out. Want to get a GPS fix every minute? Have at it. Turn on and leave on the LED camera flash while your phone is in your pocket? W

  • by Anonymous Coward on Sunday July 22, 2012 @10:07PM (#40733373)

    The Nokia's N900 (not the newer 900) is a full linux distro that happens to also function as a phone. It is the best computer I have ever purchased.

    • by hobarrera (2008506) on Sunday July 22, 2012 @11:12PM (#40733645) Homepage

      AC is quite right (I came to point out the exact same phone actually).
      Another great point is the hardware keyboard; it's really a paint to attempt to script or code or use ssh on a touchscreen-keyboard.

      The OS is not just a Linux kernel with new stuff strapped on; it's a descendant of Debian GNU/Linux inside, so unless you're a windows user, you won't have any issues hacking from this phone.

      • by mattr (78516)

        I have used sl4a on my HTC EVO 4G Wimax. But I found that it is one of the models that will not work with a bluetooth silicone keyboard. This really burns me up and I have tried a couple in stores.
        For one model, the market app would not install.
        Another model, it would pair but not connect.
        If anyone knows a keyboard (silicone or not) that would work with it..
        Anyway you should note there are issues such as battery and what happens when connectivity is lost.
        For example in a gps tracking app, you would want to

  • n900 (Score:3, Insightful)

    by Anonymous Coward on Sunday July 22, 2012 @10:12PM (#40733395)

    n900. it's open source and has a full slide out keyboard for when you have to write a script on it an emergency. normally i prefer to write such things on my desktop then use ssh to get them over to the phone, but it can be done on the phone itself too.

  • Really any large screen high resolution smart phone will do the trick. Basically you want a phone (most of the time) and a terminal some of the time. On screen keyboards suck. high resolution makes them easier to pack into a small foot print but doesn't address the big issue of lack of real estate. For this, I recommend (as small as you can get it) a blue tooth keyboard. Personally I use an old iGo Stowaway Ultra-Slim Bluetooth Keyboard. Small enough to carry around in the car with me, or in my pocket, if
    • Not really, not *any* high-res phone. He'll definitely need an open OS (open meaning that he can hack it and do whatever he wants, not open-source), and he'll most likely need an ssh client among other things. It's better to look for a phone which has those thing out-of-the-box, rather than trying to force some other model work as something it isn't.

    • How exactly do you set up the keyboard when you want to work (physically)? I used to have one too, but it was too flimsy to use on my lap with the phone on it (there was a flip-out cradle of sorts built in - seemed to be made for much smaller, lighter phones though), making a laptop the better choice for when I was out and about... I always saw the appeal of having a full-sized keyboard in your pocket, but finding a place that would actually allow me to use it (and prop up the phone so that I could actually

    • by Joce640k (829181)

      Might be better to set up a web interface to the scripts on his desktop machine then use the phone's web browser to run them.

      That way the phone becomes irrelevant, he can also do it from cybercafes when his phone runs out of battery, when he needs a bigger screen, etc.

      • by azalin (67640)
        The web server is a very nice idea, but regrettably doesn't cover things like notification/events in cases that require immediate attention. On the other hand it might be rather easy to send out sms from the server (ideally from at least two different phone numbers - normal/emergency) and set custom ringtones for those. You could even include a (deep) link to the server.
        In that case almost any smartphone (or even wap capable one) would do. It would be elegant and easy to update and replace.
  • by hardaker (32597) on Sunday July 22, 2012 @10:15PM (#40733409) Homepage

    The N9 is a wonderful phone, can certainly be scripted (I ssh into mine all the time to do things), but lacks a physical keyboard. The onscreen one is great, but because it takes half the screen it makes the shell-window smaller. (really, you might want an N950, but those "don't exist" and getting one is difficult, plus the antenna issues make it less useful as a real phone).

    The N900, now hard to locate, has a great screen, a great keyboard and is the predecessor to the N9. But they have a known issue with the USB port breaking over time, so if you do actually succeed in finding one to buy don't expect it to last forever and ever. But this is 2000+ where things aren't expected to last longer than a few years.

    sigh

    • Re: (Score:3, Informative)

      by oik (790336)

      Seconded. I have both phones now and have moved to having the N9 as my phone and the N900 just be my pocket/travel *nix box. I've not (touch wood) seen any problems with the USB port but it's something which is a known issue. The N900, while not perfect, is a damn good little machine.

    • Indeed; the N900 actually descends from the "pocket computer" idea, and they finally added phone functionalities; not the other way round, so it's a pretty complete computer. Hardware keyboard is the real big difference between the two, and will, most likely, be the feature that tips the scales (according to preference).

      Let's hope Jolla makes some nice N900 successor! :)

    • by gmuslera (3436)
      You should try Finger Term in the N9, transparent keyboard, so you can type over the screen, the main problem is that your fingers aren't transparent. The N900/N950 hardware keyboards are better anyway, but the overall experiencie of N9 could worth the difference.
    • but lacks a physical keyboard

      When I need a keyboard, I use one of these critters with my N9: http://rapoo.com/showdetails.aspx?P_No=E6300 [rapoo.com]

    • by cdp0 (1979036)

      You can use FingerTerm [ovi.com] on Nokia N9, like I do. It isn't as good as a HW full keyboard, but it's the next best thing. Even more, it is also opensource [unlink.org].

      Aegis security system is a bit more limiting than I would like it to be, but you can easily bypass the limitations with inception [endno.de] (for the moment the site seems to be down, so just use your favorite search engine to get some info). With inception you don't even need a computer, everything is done on the phone afaik. Haven't yet tried it myself, because so far

    • The N900, now hard to locate, has a great screen, a great keyboard and is the predecessor to the N9. But they have a known issue with the USB port breaking over time, so if you do actually succeed in finding one to buy don't expect it to last forever and ever. But this is 2000+ where things aren't expected to last longer than a few years.

      It is just some manufacturing batches that have issues with the USB, and even if you were to be an unlucky person it can always be fixed; the N900 is rather easy to open so you can just re-solder the USB-port more securely if it comes loose. One can also solder an extra USB-port by connecting it to the pads underneath the battery, though a USB-port and wires hanging out from there isn't terribly practical if you're still planning to use the phone a lot on the go.

      With that in mind I really don't have a probl

  • by swillden (191260) <shawn-ds@willden.org> on Sunday July 22, 2012 @10:16PM (#40733419) Homepage Journal

    My suggestion is Tasker, but unless there's a mail parser plugin I haven't come across (or unless you write one), it won't take actions based on the content of e-mail messages. It will, however, react to SMS message content. So one way to handle your custom notifications is to write a script that runs on another always-on, always-connected machine. Have it receive and parse the e-mails and when one of them meets your criteria, have it send you a text message with relevant content, then have Tasker do whatever is appropriate when that message arrives.

    To make sure your script-running server is up, use something like Ping HostMonitor. You can also use that to monitor the status of any Internet-accessible hosts.

    The biggest downside of this approach is that it relies on SMS to reliably notify you. You might also want to have Tasker send an e-mail acknowledgement when you get the SMS, and have your script keep re-sending the texts periodically until it receives the ACK.

    • by icebrain (944107)

      Yes, everything OP wants can be done with Tasker, except that it can't parse email... unless you use K9mail. Tasker has support for that app, letting you parse the emails like you do with SMS. I've been debating whether to get K9mail myself, just for that reason.

  • by A nonymous Coward (7548) on Sunday July 22, 2012 @10:17PM (#40733423)

    I've done similar things, where I want my phone to tell me if some external activity has happened or has changed beyond certain parameters.

    I do the analysis elsewhere, such as on that desktop PC, and the alert consists of sending a text message to the phone (or multiple phone numbers). Google for the how, it's a common practice and easy (and free) to do. Depends on the carrier, altho some sites claim to figure that out for you, but I just figure each one out and avoid them. this does mean that if a phone number changes carrier, I have to change the script, but since so far I have only sent texts to my own phone, it's no biggie. Just have one central script to send the actual alert.

    • agreed; do the scripts on some perma server somewhere that is always running, always has power, is trustable to be relied on, etc.

      your phone is a thin client. have it receive emails or some alert, but all heavy lifting should be on a server.

      this is not a hard thing; why was this a slashdot question? (don't answer that)

      • by hughk (248126)

        your phone is a thin client. have it receive emails or some alert, but all heavy lifting should be on a server.

        Why?

        Even older smartphones have much more power than many desktop computers did 15 years ago. The I/O may not be up to much, especially over a network connection, but they definitely can do a lot of other work.

  • If you're comfortable with scripting, you may want to write your own android app to do just what you need. Just make sure you buy an android phone that can install non-market applications. To test this in the store, ask to see a running phone of the model you're considering, and follow this procedure:

    1. From the main screen, tap the menu button.
    2. Tap Settings.
    3. Tap Applications.
    4. Look for a checkbox that says "Unknown sources - Allow installation of non-Market applications", and make sure you can en
    • by tangent3 (449222)

      And if you want to develop the app right on your mobile phone, you can use https://play.google.com/store/apps/details?id=com.aide.ui&hl=en [google.com]

    • by WillKemp (1338605)

      Just make sure you buy an android phone that can install non-market applications.

      You only need to be able to turn on USB debugging (under "developer options" in 4.0.3) - then you can install any app you develop via a USB connection. It's easiest if you use Eclipse etc. Google "android development eclipse", or something similar, for help in setting it up. It's pretty easy!

  • Against the flow (Score:4, Interesting)

    by ArhcAngel (247594) on Sunday July 22, 2012 @10:30PM (#40733481)
    You probably won't get many recommendations for BlackBerry but a BlackBerry combined with a PlayBook may just be what you are looking [blackberry.com] for.
  • by Cramit (609487) <CMSpooner@@@gmail...com> on Sunday July 22, 2012 @10:41PM (#40733531)
    Android Scripting Environment is a layer that allows various scripting languages interact with the Android API. It supports a bunch of languages and allows for a decent level of control over the Android device. http://code.google.com/p/android-scripting/ [google.com]
  • by wintersdark (1635191) on Sunday July 22, 2012 @10:45PM (#40733545)

    I'd recommend a two-pronged approach, if you're looking for something user friendly and not requiring building an intermediate server.

    First, check out the unbridled awesomeness that is If This Then That: http://ifttt.com/ [ifttt.com] It allows you to create simple (or complex) triggers based on all manner of inputs with all manner of outputs. Email, SMS, Social Networking, etc. I use it with a "private"(read: used only for this, and nothing actually private is tweeted) twitter account to pass data about. I originally used SMS, but I moved to twitter later as it's remarkably convenient and can be adapted easily to a number of different devices, whereas SMS is limited to phones (for the most part).

    Then, on your sexy Android phone - I'm using a Note, personally, it's the closest I can get to a tablet but still be able to comfortably put it in a pocket - use Tasker to intercept and act.

    Really, though, the first thing I'd do in your shoes is seriously investigate IFTTT. It's very easy to use and flat out awesome.

    • Re: (Score:3, Informative)

      by wintersdark (1635191)

      Unfortunately, I can't remember how to edit a post. Excuse my ignorance, I don't post often.

      Anyways, check this IFTTT.com recipe out: http://ifttt.com/recipes/46081 [ifttt.com] - it searches a gmail account, and sends results as SMS messages to your mobile number.

      So, you set it to search for From:yourworkaddress or Subject:FreezeTemp or what have you, and poof! Whenever your freezer is getting toasty, you get SMS messages.

      • by Raenex (947668)

        Unfortunately, I can't remember how to edit a post.

        You can't, and it's a feature that prevents people from changing the conversation history. Preview is your friend.

  • by tanveer1979 (530624) on Sunday July 22, 2012 @11:00PM (#40733613) Homepage Journal

    Why would you want to run the script on your phone?
    Of course there are apps for that.... but then why? Here is what I do. I use VPN (Cisco VPN is the one supported in most corporate environments, and is available on linux), and then just ssh to any machine I want.
    There is talk of even remote desktop kind of client coming to android.
    Alternatively, you could just ssh to the machine you want to access, and then do as you please.
    I use a Galaxy note, and since the screen is 5", its very usable. However, on smaller phones(like my older optimus one from LG), such stuff was a pain.

    So all your scripts will run on the server, in your lab, and email will be sent to you. Its far more easy to set up these scripts on the computer in your lab. Heck, you could write the scripts locally, and then ssh to your server and put them there.

    But if you still want to do stuff like access email, parse through it, and then do something(ssh to server blah blah), you may as well write your own app. On the market, most such apps will do only a part of what you want.

    Somebody has suggest N900(linux), and if you want everything on your phone, a linux phone is what you are looking for.

    • A "remote desktop", as you put it, is available for plenty of others mobile OSs already, generally using VNC, though there are some other, less popular, protocols floating around.
      I've no idea where other OSs stand related to the Cisco-VPN support though, since I tend to stay clear of all proprietary protocols while I can :)

      • In the corporate environment, Cisco VPN is extensively used, and even in companies where all development happens on linux platform, Cisco VPN is like a de facto standard.

        • It's funny that as an IT employee and software developer for around 10 years, I've never come across it. Not once.
          Maybe that's just the corporations you've come across.

    • by vawwyakr (1992390)
      Talk of? There are several remote desktop clients already.
  • Windows Phone has TouchDevelop [touchdevelop.com] from MS Research, not sure how comprehensive it is but it does give you on-device scripting of functionality.
    • by gl4ss (559668)

      but not background scripting which is what he wants. on windows phone you would have to tie it to ms's push notification system and have a server handle most of the work, at which point you could be just as well sending sms messages. you really can't script different types of responses to different types of emails fetched on windows phone reliably currently, while touchdevelop seems to be oriented at simple ui scripts which fetch data from server and display it.

      as ridiculous as it might sound to some n900,n

  • My solutions: (Score:3, Interesting)

    by zoloto (586738) on Sunday July 22, 2012 @11:24PM (#40733677)
    Since you're on rogers: http://www.rogers.com/web/content/iphone4s [rogers.com]
    I suggest:
    Prowl: For push notifications. It's free and you will find the perl script handy. There are some powershell ones floating around somewhere too. http://www.prowlapp.com/ [prowlapp.com]
    Prompt: CLI. If you jailbreak (highly recommended) you can ssh to localhost, it's better than any Terminal app in cydia. http://itun.es/i624Jj [itun.es]
    There are others but I never use them. My coworker and i opted for a home brewed app that handled a lot of our needs by phone in the event we had to be called about something off-hours.
  • by bmalia (583394) on Sunday July 22, 2012 @11:51PM (#40733747) Journal
    Seems better to have a separate dedicated machine that runs the scripts and monitors everything and send email alerts that you can receive on your phone.
    • This also addresses the fact that the dedicated box surely has a more reliable connection than the phone does.

      Missing a notification of a that a script ran is much preferable to the script not running at all.

  • by fatp (1171151) on Sunday July 22, 2012 @11:57PM (#40733761) Journal
    How about a native (ARM) linux distribution. To name some (semi-)automated installation tools

    Linux Installer
    https://play.google.com/store/apps/details?id=com.galoula.LinuxInstall [google.com]

    Debian Kit
    https://play.google.com/store/apps/details?id=org.dyndns.sven_ola.debian_kit [google.com]

    Complete Linux Installer (NEW)
    https://play.google.com/store/apps/details?id=com.zpwebsites.linuxonandroid [google.com]
    • by ami.one (897193)

      ^ LinuxOnAndroid [blogspot.in] is pretty good if you want a chrooted linux running on your phone simultaneously with your Android. You run a vnc server to connect to the chrooted linux if you want the full gui desktop. Otherwise, you can just use the shell.

      I have been using it on a Nexus S 4G since last 6 months. Nothing much to install. Just download the image (3-4GB) and use the app to run a script which sets up devices and does chroot. Or you can do that yourself on the android shell. And the developer Zac is quite re

  • Though I don't use it myself, notify my android looks very good. https://play.google.com/store/apps/details?id=com.usk.app.notifymyandroid&feature=search_result [google.com]

    Also, it integrates with tasker. And once you get tasker into the game, there's not much you can't do.

  • by obarthelemy (160321) on Monday July 23, 2012 @01:19AM (#40734045)

    I have no clue why everyone is rushing to have you put scripts on a smartphone, which can be lost, stolen, run out of battery...

    You do your scripting on a PC at work, and only receive reports on, or do *emergency* remoting from, your phone. At most you tweak your phone so that if it receives an email/text with keyword "ALERT" from sender my.scripts.at.work, it does something noisy.

    Any phone can do that, it's a matter of finding the right size/features balance. I'd go for a big screen, and maybe a hardware keyboard if you think you'll be doing a lot of remote editing, though the best phone keyboard is a lot worse than any laptop's, so don't plan on using it too much.

  • Rather than using the Phone to do the monitoring and polling, I'd consider using a service on the network at work and then make your phone a client of this service.
    An example would be to use Nagios to do the monitoring and then use one of the countless Nagios Clients available to read the monitoring state from the service. You'll get the added bonus of knowing what happens if your Network coverage goes away to fill in the blanks after the event and be able to escalate to someone else if you're not available
  • This would be the right question, in my humble opinion.

  • Ruboto IRB (in Google play)
    tuProlog (from their site)
    BASIC ( in Google play)

    Not so bad. Need no root.

  • python for android/sl4a

    check the API's first to see if it has everything you need.

  • You're doing it wrong IMHO.

    The monitoring portion should be on platforms near the servers, not on your own device (mobile or desktop). Plus something to monitor the monitor, located farther away, preferably at another site. There are no good monitoring packages IMO, but many reasonable and usable ones. All of them should be as scriptable as you need.

    You need one device on your person to receive alerts; a cell phone with SMS is good. My current job requires two devices on different networks, but that may

"Pascal is Pascal is Pascal is dog meat." -- M. Devine and P. Larson, Computer Science 340

Working...