Use Python to develop Android applications: Section 3 write programs on a computer and run them on a mobile phone

Source: Internet
Author: User
This section

1. Some traditional methods
2. Generate a QR code image from the program code.
3. Scan the generated QR code on your mobile phone and convert it to a py script.

Preface

Writing scripts on the most mobile phone is a hard task. Although SL4A provides us with the API Quick insertion function, in addition, the elegant Python saves us the trouble of entering semicolons and parentheses, but it does not have intelligent awareness, no keyword completion, narrow buttons, and difficult to enter symbols, I still don't have the courage to write more than 50 lines of programs on my cell phone. write code on your computer and copy it to your mobile phone! So, how to quickly send the code written on the PC to the mobile phone?

1. Some traditional methods

1.1 data lines
I don't need to talk about this. It should all be done, but it is very troublesome to carry the data line with me. So I should look for other methods!
1.2 wifi
Similar to the data cable principle, many android PC clients have supported connecting to mobile phones through wifi, such as pods, but no Wi-Fi is available anywhere.
1.3 Use the notes management software with the network synchronization function
By using the notes management software, such as evernote and Shanda Mai Ku (using this link for registration, you can upgrade the 200 M control to 1G. As the invitee, my space will also increase by M, win-win !)
Write a script on the pc end, upload it, download it on the mobile phone, and paste it to SL4A.

2. Generate a QR code image from the program code.

The preceding methods either require hardware (data lines and wireless routes) or require additional software (note management software) to be downloaded, in fact, the author of SL4A also considered this issue and provided us with an interesting way to input code: scan the QR code!

The method is as follows:
1. Open the QR code generation page: http://zxing.appspot.com/generator/, select :text in the drop-down list behind Contents
2. Enter the script name, such as HelloWorld. py, in the first line of the scripts area after Text content.
3. Enter the script content below him.
4. In the Barcode size drop-down list, select L
5. Click Gernerate to generate the QR code
6. Save the QR code generated on the right or share it with your friends!
Generated QR code:

3. Scan the generated QR code on your mobile phone and convert it to a py script.

The QR code is generated. How can I import it to my mobile phone?
1. Start SL4A to enter the script list
2. Press the MENU key (MENU)
3. Click Add.
4. Click Scan Barcode
5. Scan the generated QR code and the script will be automatically displayed in the list (the name is the name of the first line)
Ps: The QR code can contain up to 4296 characters, so it can only be used to store shorter scripts!

This article references: http://code.google.com/p/android-scripting/wiki/SharingScripts

Welcome to the Douban SL4A group and make progress in the discussion: Douban SL4A group (http://www.douban.com/group/SL4A)

The article is reproduced from:Iron ride (http://cooleep.com /)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.