Python for Android
Go on, tap your app name, then tap the run wheel. After a moment, you should see the spinner dialog appear while your script contacts the Beans'R'Us Web site and requests the current price of coffee (Figure 5). Shortly thereafter, the current price appears in another dialog (Figure 6). Congratulations! The script has been ported to your Android virtual device.
To run a Python script on your physical Android device, install SL4A together with Python for Android on your handset, then transfer your script.
To install SL4A on your physical Android device, enable the Unknown Sources option in your device's Application settings. This setting is required to enable the installation of non-Market apps on your phone. With this done, you can follow the same steps you used when installing SL4A and Python on your emulator. To speed things up a little, install Barcode Scanner from the Android Market and use it to “read” the QR Codes from your desktop screen.
There are a number of ways to get your script onto a real phone. I've found the success of using something like Bluetooth connectivity or USB cabling arrangements can very much depend on the hardware on which you're running. What works on one handset, doesn't on another, and so on. Your mileage may vary depending on your actual device. When I need to transfer a file, I've come to rely on a solution that works no matter which handset I use (as long as the handset can talk to a local Wi-Fi network). What I do is switch on the OpenSSH server on my development PC running Linux, then use the AndFTP file transfer app on the handset to scp files from the desktop to the phone. AndFTP is available from the Android Market as a free download and installs in minutes. Once I connect to my desktop with AndFTP, I can navigate to a directory of my choice, mark the files that I want, then download them to my SD card on the handset.
AndFTP works well, and I've come to depend on it for all my Android file transfers (see Resources). Just be sure to transfer your scripts to /sdcard/sl4a/scripts on the phone to ensure that your script names appear within the SL4A list of scripts.
With your script file transferred to your physical device, start SL4A as before, tap your app's name and tap the run wheel. As expected, your app runs just as it did on the emulator, only faster! I haven't included a screenshot of the app running on a real phone for two reasons. First, it looks exactly the same as it did in the emulator, and second, it's running on your device, so you can take a look at it there!
There's one further kink to SL4A that might interest you. The project includes draft instructions on creating a standalone, downloadable Android APK package (see Resources). Once created, the APK file bundles your custom Python script with information that allows other Android users to install Python for Android automatically onto their handsets and then run your app from the smartphone's main menu of apps. Describing the process of creating the APK likely would take another article, so I leave it to the brave among you to try out the instructions on the SL4A Wiki. To see and learn a little about one such successfully created APK, check out Split Hitter on the Web (see Resources).
Programming your app in Java is not the only option on Android. With SL4A, very capable scripting languages come to Android, taking the platform to a new level of hackability. If you can, get involved. More people means more eyeballs, and more eyeballs means more help and more code. Official support from Google will come if enough programmers get involved, which can only help raise the project's profile within Google's HQ. SL4A is already a good project, and I can only imagine the great project it will be with “official status” bestowed on it by Google. Let's hope this happens sooner rather than later.
You can learn lots more from the wiki documentation hosted at the SL4A Web site. Be sure to browse the Tutorials section of the wiki for links to what others are doing with SL4A. There's also an active (and very friendly) SL4A mailing list that Damon uses to announce new versions, track feature requests, report patches and spread the word about SL4A. If you build an app for Android using SL4A, join the list, and I'll see you there.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- RSS Feeds
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Tech Tip: Really Simple HTTP Server with Python
- Home, My Backup Data Center
- New Products
- Android is Linux -- why no better inter-operation
17 min 15 sec ago - Connecting Android device to desktop Linux via USB
45 min 45 sec ago - Find new cell phone and tablet pc
1 hour 43 min ago - Epistle
3 hours 12 min ago - Automatically updating Guest Additions
4 hours 21 min ago - I like your topic on android
5 hours 7 min ago - Reply to comment | Linux Journal
5 hours 28 min ago - This is the easiest tutorial
11 hours 43 min ago - Ahh, the Koolaid.
17 hours 21 min ago - git-annex assistant
23 hours 21 min ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.






Comments
Looks like Paul's been time
Looks like Paul's been time travelling again. i like the article though. It covers exactly what i have spent the past hour searching for.
Well at least you got the
Well at least you got the info a week early! ;) This is a very comprehensive article about app programming. While I don't have the technical expertise to craft the SL4a technique without conquering a steep learning curve, it does open my eyes to a new way to do things. This is particularly helpful since I've been learning how mobile solutions are being tapped into by users. As one can imagine, a company that does mobile marketing(example: http://www.exacttarget.com) is going to have different needs then a company that specializes in manufacturing, or a user who wants to simplify his/her "mobile" life. Right now I fall into the latter category, but that doesn't mean I won't have a vastly different agenda in regards to app programming in the future.
Time will tell if Android development via Python is something I will tap into, but it's nice to have the programming app horizon broadened. Options are good!
Amazing!
this essay is posted on "Apr 30, 2011 By Paul Barry in Mobile". And today is Apr 23.
I noticed that to. I wonder
I noticed that to. I wonder what planet he was on when he published the article.