An embedded relational database Integrated on the Android platform. SQLite3 supports NULL, INTEGER, and REAL (floating point
TEXT (string TEXT) and BLOB (binary object) data types. Although only five types are supported
Sqlite3 also accepts data types such as varchar (n), char (n), decimal (p, s), but will be transferred during operation or storage
The corresponding five data types.
The biggest feature of SQLite
Android SQLite-related java source code has repeatedly mentioned support for nested transaction.
SQLite itself does not support nested transactions and can only be replaced by savepoint.
Nested transactions are similar
BEGIN BEGIN ......
Not many people may write this statement directly. In more cases, one program calls other programs while others have t
Original address: http://www.cr173.com/html/19165_1.htmlIn the design idea of Android, in order to ensure the user smooth operation experience. Some time-consuming tasks cannot be run in the UI thread, such as accessing the network. So we have to re-open a background thread to run these tasks. However, these tasks often end up needing to access and control the UI controls directly or indirectly. For example, access to the network to obtain data, and t
Android UI access is not locked, so accessing the UI on multiple threads is not secure. So android specifies that the UI can only be accessed in the UI thread.But is there an extreme situation? Makes it possible for us to access the UI in a child thread to make the program run? Next we'll use an example to confirm it.T
(60), m varchar (60), a varchar (60) ") ;}@ Override public void onUpgrade (SQLiteDatabase db, int oldVersion, int newVersion) {Log. e ("DBOpenHelper", "onUpgradeonUpgradeonUpgradeonUpgrade"); db.exe cSQL ("drop table if exists config"); db.exe cSQL ("drop table if exists application "); db.exe cSQL ("drop table if exists install"); db.exe cSQL ("drop table if exists smslist"); onCreate (db );}}
Using transactions to insert multiple data records in
Android UI access is not locked, so accessing the UI on multiple threads is not secure. So android specifies that the UI can only be accessed in the UI thread.But is there an extreme situation? Makes it possible for us to access the UI in a child thread to make the program run? Next we'll use an example to confirm it.T
executing
The best way to run() do this is to add a flag bit to the function, and the worker thread will check to see if the flag bit is set at any time, and if it is set, let the run() function return immediately.//设置标志位,为退出线程使用booleanfalsenew Runnable() { @Override publicvoidrun() { //耗时的操作 while(!needStop) { } }};
If the main thread is going to cancel the work of this one, it will be fine to modify this flag bit.needStop = true;
2.2 Th
I think there has been a lot of discussion about this topic. Today is a study to summarize it.In the design idea of Android, in order to ensure the user smooth operation experience. Some time-consuming tasks cannot be run in the UI thread, such as accessing the network. So we have to re-open a background thread to run these tasks. However, these tasks often end up needing to access and control the UI controls directly or indirectly. For example, acces
I. Task
To explain what is a task in Android, You need to mention the application and Activity.
Activity: the most basic application component in Android. An Activity is usually a separate screen used to present data and interact with users.
Application: for example, QQ Software is an application, usually composed of multiple activities.
With the above two concep
Yusong Momo introduces you to the database SQLite Of The World Of Game Development
If the original Yusong Momo article is reprinted, please note: It is reprinted to my independent domain name blogYusong Momo program Research Institute, Original address: http://www.xuanyusong.com/archives/287
Database SQLite IntroductionThe four most classic operations of the database are addition, deletion, modification,
support a process that is often displayed on the interface.
Thread:Even if different processes are assigned to the component, the thread needs to be reallocated. For example, the user interface needs to respond quickly to the user, so some time-consuming operations, such as network connection, downloading, or operations that take up a lot of server time, should be placed in other threads.
The Thread is created through the standard java object Threa
maximum specified by the thread pool, the task is denied and the caller is called by the rejectedexecution of the Rejectedexecutionhandler.Category: 1, fixedthreadpool thread pools with fixed threads, which are not recycled when the thread is idle, can quickly respond to an external request. Only the core process. 2, Cachedthreadpool the number of threads is not the core process of the thread pool, thread
Summary:Threads are often used in Android development, and many students immediately use the new thread () {...} When thinking about threads. Start () in this way. This way, if the above code is called multiple times in an activity, multiple anonymous threads are created, an
Android programmers must master the sqlite database connection Table query
Basic Principles of SQL query: two cases are introduced. 1. Single Table query: filter the records in the table based on the WHERE condition to form an intermediate table (this intermediate table is invisible to users ); then SELECT the corresponding Column Based on the SELECT column to return the final result. 2. join queries for tw
message queue in two ways: sendmessage or post. Both messages are inserted at the end of the message queue and executed first-in-first-out. However, messages sent using the two methods are executed in a slightly different way: a message object is sent using sendmessage, which will be processed by the handlemessage () function of handler; the post method sends a runnable object, which is executed by itself.
4. Logoff Logoff is the manager of the message queue in each line.
Android provides four data storage methods. Because Android data is basically privateProgramTo use the data, you must use the contentproviders provided by Android.
Four Data Storage Methods in Android:
Shared preferences
Similar to our commonly used INI files, this file is used to save some property settings of t
Disclaimer: This article is in reference to "decrypt Google Android" and the Android Video tutorial (www.mars-droid.com).As we all know, the application on the PC when need to do some complex data operation, but do not need UI UI, we will dedicate a thread to the application to perform these complex data operations. Through threading, you can perform time-consuming operations such as data processing, data d
Threads are often used in Android development.
new Thread(){...}.start();
In this way. In this way, if the above Code is called multiple times in an activity, Multiple anonymous threads will be created. If these threads are not de
1. Using Pipe flow pipes"Pipeline" is part of the java.io package. It's Java's feature, not Android-specific. A "pipe" establishes a one-way channel for two threads. Producers are responsible for writing data, and consumers are responsible for reading the data.The following is an example of communication using a pipeline flow.public class Pipeexampleactivity extends Activity {private static final String TAG
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.