Register and log on to Android development, and log on to android Development

Source: Internet
Author: User

Register and log on to Android development, and log on to android Development

Yesterday, I introduced the Android client's method of sending data to the server, but it seems a bit flawed. It has been solved after debugging. Here I will introduce it to you.

It seems that the network permission requirements for Versions later than Android have become strict. As a result, the small cases compiled yesterday cannot send data to the server. When you click send data, the Android console reports an error, errors are of course a headache. Basically, they are all about http errors. Therefore, it must be because an error occurs when the Android virtual machine sends data to the server. I did not know it after checking it online, in Versions later than 4.0, the network cannot be called in the main Thread. If you need it, you should initiate another Thread to process the network connection Thread (new Runable () {private void run {call network connection in the run method }}). start ();

Of course, you can also set the Android version in AndroidManifest. xml:

 <uses-sdk        android:minSdkVersion="3"        android:targetSdkVersion="8" />

With the above two methods, I believe everyone will have a certain understanding of the Android access server.

NOTE: If any error occurs, please kindly advise. Thank you.


Logon verification for android Development

Registration uses insert, and login queries are good.

Developed with Android, a Registration Information applet registers on the first page. After the registration is completed, it jumps to the second page and displays the registration information.

You can use intent to transmit data and write the data as follows:
Intent = new Intent ();
Intent. putIntExtra ~~~; // Pass the int value, which can also be passed with many types of values.
Inttent. setClass (A. this, B. class );
StartActivity (intent );
Use the following method to receive data in Activity B:
Int a = getIntent (). getIntExtr ~~~;
After receiving the message, you can assign the word to TextView and other controls for display.

In addition, when A passes A value to B, it can be bound to A Button to set the onClick listener event.
 

Related Article

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.