One, PreferencesPreferences is a lightweight method of storing data, using the following methods:Save values in a:Sharedpreferences.editor sharedata = getsharedpreferences ("Data", 0). Edit ();Sharedata.putstring ("name",
In the development of Android applications, sometimes to save the user's information, in the entire application can be accessed, of course, with the Android-supported SQLite database is OK, but if only to store some of the comparative advice or a
1.Java FoundationMany friends began to learn Android when they started, and seemed too worried. Android application development is based on the Java language, so there is no solid Java basics, but the mechanical copying of other people's Code, it
To manage fragment, you need to use Fragmentmanager, and to get it, you call Method Getfragmentmanager () in the activity.
You can use Fragmentmanager to do these things:
1 Use the method Findfragmentbyid () or Findfragmentbytag () to obtain the
In the development of Android applications, transaction processing is very important when using a database. first Android database operations (especially write operations) are very slow, and packing all operations into one transaction can
Under the Android platform, when multithreaded programming, it is often necessary to do some processing in a separate thread outside the main threads, and then update the user interface display. However, the problem with directly updating the page
Java has a very useful tool class, you can less than a lot of if else to judge, but not many people use, published this article is intended to let many people use this tool class, improve code quality and force lattice
Math.PI returns the
In design mode, the simplest is the single case mode. Let's take a look at the single case mode
Original: http://www.iteye.com/topic/575052
The singleton pattern can be simple, and all it takes is one class to complete (see this chapter's poor UML
The hole the Android developer encountered as an iOS developer, suddenly let me touch the Android development content, in fact, my heart is very reluctant. Why I'm learning about Android is not that I'm not doing iOS development, or that I'm not in
The Java Native Interface (JNI) standard is part of the Java platform that allows Java code to interact with code written in other languages. JNI is a local programming interface that enables Java code that runs inside a Java Virtual machine (VM) to
Date curdate = new Date ();
String datestr = new SimpleDateFormat ("Yyyy-mm-dd HH:mm:ss SSS", Locale.china). Format (curdate);
Various dates in Java represent the following letters:
An alphabetic date or time element represents an example
Today, Jinshan WPS to the school to open a lecture, holding a try attitude to participate in the lecture written, reported the server engineer position, but the written position does not have this position, because this semester opened the Android
String str = "Hello";
Canvas.drawtext (str, x, y, paint);
1. Rough calculation of text width
log.d (TAG, "measuretext=" + paint.measuretext (str));
2. To compute the rectangle in which the text is located, you can get a width-high
Rect Rect = new
comparison of Asynctask and handler
1 The principle of asynctask implementation, and the applicable advantages and disadvantages
Asynctask, a lightweight asynchronous class provided by Android, can directly inherit Asynctask, implement asynchronous
Toast is the most commonly used but now many of the procedures in the market do not notice a point, is the toast immediate shutdown problem
Toast played a role in prompting the cancellation should be canceled as soon as possible
User cannot manually
one: In the source code development mode
1: Include header file:
#include
2: Define macro Log_tag
#define LOG_TAG "My LOG TAG"
3: Link log corresponding. So library
Add the following statement to the Android.mk
The four components of Andong are designed to solve the problem of cross process communication 1. Radio 2.contentProvide 3.Service inside the commonly used aidl===== is actually binder mechanism 4.Activity such as Call system call application (need
An Apache package is provided in Android. It must be noted that the encoding format must be consistent before data can be correctly obtained.Java code
Public static msgmodel dopost (string URL, map data)
Throws clientprotocolexception,
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