Let me talk about Android programming. When we first studied JSON, we all know that JSON, as a popular data exchange format, has many advantages, android web applications are widely used. Here I will record the process of learning JSON as follows:
MainActivity is as follows:
Copy codeThe Code is as follows: package cn. testshape;
Import android. OS. Bundle;
Import android. app. Activity;
/**
* Demo description:
* Use of custom shapes
*/
Public class MainActivity extends Activity {
@
Canvas. In English, this word indicates Canvas. In Android, Canvas is used as a Canvas. We can draw anything we want on the Canvas with the help of the Set Paint class; it is also the core class of the Bitmap class. You can also set Canvas
Copy codeThe Code is as follows: public class MainActivity extends Activity {
// Declare controls
// Path and thread count
Private EditText et_url, et_num;
// Progress bar
Public static ProgressBar pb_thread;
// Operations for displaying
Add permission
First, add the network access permission to manifest:
Copy codeThe Code is as follows:
...
The complete Manifest file is as follows: Copy codeThe Code is as follows: Package = "com. example. httpdemo1"Android: versionCode =
1. Question proposal
1) Why multithreading is required?
2) How to Implement multithreading?
3) What is the core of the multithreading mechanism?
4) How many implementation methods are there?
2. Problem Analysis 1) The essence of Multithreading is
Today I encountered a very strange problem:
In Android, ImageView cannot display the loaded local SDCard image.
The specific process is: first call the local camera program to take the camera, and then load the captured image to the ImageView for
Previously, the ExpandableListView: External:
First, let's take a look at the well-encapsulated IphoneTreeView:
Copy codeThe Code is as follows: public class IphoneTreeView extends ExpandableListView implements
OnScrollListener,
Let's talk about usage directly. I know how to use it first, and then I know what's going on.
1. HttpPost Copy codeThe Code is as follows: try {// Create a connectionHttpClient httpClient = new DefaultHttpClient ();HttpPost post = new HttpPost (url
TextView in Android supports some Html format tags. This includes common font size and color settings and text links. It is easy to use. You only need to use Html class conversion. For example:
TextView. setText (Html. fromHtml (str ));
I. Implement
Next, let me introduce how to use Android Handler. Handler can send Messsage and Runnable objects to the Message Queue of the associated thread. Each Handler object is associated with the thread that created it, and each Handler object can only be
First look:
First, you have to write a class named CornerListView.
[Java]
Copy codeThe Code is as follows :/**
* Rounded ListView example
* @ Description: rounded ListView example
* @ FileName: CornerListView. java
*/
Public class CornerListView
This time, we were working on Lephone adaptation. The test group submitted a bug: the text in the title bar was not completely displayed for a long time. In fact, this was not a bug, this problem has not appeared on other machines in the past, but
The action of the Image Library on JB and JB2 is: horizontal screen full screen display, and vertical screen display status bar. How to make the portrait screen do not show the status bar.
Modify toggleStatusBarByOrientation () method in
You should be familiar with setting the scene mode. However, in Android, how can you set the scene mode through your own program? There are many kinds of scenes, that is, you can use the built-in system, you can also use custom mode. However, when
Copy codeThe Code is as follows: public class MirrorView extends View {
Paint m_paint;
Int m_nShadowH;
Drawable m_dw;
Bitmap m_bitmap;
// Xxxx
Matrix mMatrix;
Int shadowHeight;
Public MirrorView (Context context, Bitmap bitmap ){
Super (context );
M_
I believe most people have read many articles about getting screen pixels when reading this article. From other articles, we know that the screen pixels are obtained based on the DisplayMetrics class.The specific calculation method is width =
There are a lot of code on the Internet to solve horizontal and vertical scrolling of android listview. I didn't follow what they said (I didn't find O (else _ blank) O ~) I am using Add HorizontalScrollView
Java code
Copy codeThe Code is as
In Android, there are two main ways for intent to pass objects: Bundle. putSerializable (Key, Object) and Bundle. putParcelable (Key, Object); of course, these objects have certain conditions. The former implements the Serializable interface, and
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