App Inventor for Android Button click event

Source: Internet
Author: User

The Google online development tool App Inventor makes a simple button click event. by clicking the button, we can change the font color of a label;

First, open the development environment address.Http://appinventor.googlelabs.com/ode/Ya.htmlOn the basis of the project created last time. First, let's take a look

1. The first step is to drag and drop controls on our project.


Here we can rename the control to change its ID or Text value. We can change the ID of the Button to btnStart, change the Text value to "click to change" and change the Text value of the Label to "change color". The first time I saw the development interface of this environment, I thought of vs2010, this layout is too similar. I don't know if the developer of this software has referenced Microsoft, what is uncomfortable here is that when renaming or deleting a control, it must depend on the given Rename and Delete, if you double-click the control, you can rename it and delete it when you press the Del on the keyboard. It is better because it is out of Beta, so there will be a lot of changes.

2. Click "Open the Blocks Editor" to go to the logic editing page.

What we can see in area A is the drag-and-drop control, and the IDs of some controls have been changed. Click the corresponding control in area A to display many optional graphic statements, for example, the btnStart statement "when · do ·" is used to indicate what operations will be performed when we click btnStart. The content to be operated is placed inside the btnStart graphic statement, here we place label1 and change the font color of label1. The original black color turns red, the overall meaning is that when we click this button, we will do the following operations, that is, set the color of label1 to red, after the setting is complete, we can run, click new emulator to run on our simulation machine. When you click Connet to Device, it runs on the real Android mobile phone. At the same time, the mobile phone must meet the following conditions to run: ① an SD card must be available; ② Settings> Applications> check "Unknown Source" to allow programs other than android market to run ); both of my conditions are met by default. For specific mobile phone and computer configuration requirements see http://hi.baidu.com/simayilong80/blog/item/319881fa91b1478258ee9073.html

3. connect to your phone and check the effect.

Android development: Passing values between activities

Android online development tool App Inventor

Use Internet Data in Android applications

Google Android UI design tips: icons and instructions

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.