Use Python to write programs on your computer that are running on a mobile phone on your Android system.

Source: Internet
Author: User
Tags first row

1. A number of traditional methods

2. The code of the program to generate a two-dimensional code picture

3. Use mobile phone to scan the generated two-dimensional code and convert it into a PY script

Objective

Writing scripts on the phone is a hard thing to do every day, although SL4A provides us with the API quick Insert function, and graceful Python saves us the pain of entering semicolons and parentheses, there is no IntelliSense, no keyword completion, small buttons, difficulty in entering symbols, Or do I have the guts to write more than 50 lines on my phone? Write the code on the computer instead, then copy it to the phone! So, how quickly can you send the code on your PC to your phone?

1. A number of traditional methods

1.1 Data Cable

This will not need me to say it, it should be, but with the data cable is a very troublesome thing, so we should find some other ways!

1.2 WiFi

As with the principle of data lines, many Android PC clients have already supported mobile phones via WiFi, such as pea pods, but there is no wifi anywhere.

1.3 Using the note management software with network synchronization

Through note management software, such as Evernote, Grand Mancuso (Use this link registration, you can upgrade 500M control to 1G, as an invitation, my control will also grow 200M, hehe!)

Write a good script on the PC side, upload it, then download it on the phone and paste it into the sl4a.

2. The code of the program to generate a two-dimensional code picture

Several of the above methods are either required for hardware (data cable, no line by), or to download additional software (note management software), are more troublesome, in fact, SL4A's author also considered this problem, for us to provide a very interesting way of code input: Scan two-dimensional code!

The method is as follows:

1. Open Two-dimensional Code Generation page: http://zxing.appspot.com/generator/, select from the Drop-down list after contents: Text

2. After text content, enter the name of the script in the first line of the area, such as: helloworld.py

3. Enter the contents of the script below him.

4. In the Drop-down list after barcode size, select: L

5. Click Gernerate to generate two-dimensional code

6. Save the two-dimensional code generated on the right or share it with your friends!

The resulting two-dimensional code is as shown in the figure:

3. Use mobile phone to scan the generated two-dimensional code and convert it into a PY script

Two-dimensional code generation, how to import it into the phone?

1. Start sl4a into the script list

2. Press Menu key

3. Click Add

4. Dot Scan Barcode

5. Scan generated two-dimensional code, the script will automatically appear in the list (name is the name of the first row)

PS: Two-dimensional code can hold a maximum of 4,296 characters, so only used to store a shorter script!

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.