Android SQLite database usage example
For a brief introduction, mainstream mobile devices such as Android and iPhone all use SQLite as the storage engine for complex data. When we develop applications for mobile devices, we may need to use SQLite to store a large amount of data
. Complete the submission
Editor.commit ();
B, read the data information1. Get Preferences
Sharedpreferences settings = getsharedpreferences ("setting", 0);
2. Take out the data
String name = settings.getstring ("name", "Default value");String url = setting.getstring ("url", "Default");
This is how sharedpreferences is us
Android Handler Usage Analysis, androidhandler1. Handler usage
Now, as a customer, there is a need to start the countdown when the Activity interface is opened. After the countdown is over, the new interface will jump (a user with active thinking may immediately think that if the countdown is turned on, similar to the pop-up page of each APP), for example:
As a
1. Use Android API functions to view1.1 activitymanager view available memory.Activitymanager. memoryinfo outinfo = new activitymanager. memoryinfo ();Am. getmemoryinfo (outinfo );Outinfo. availmem is available idle memory.1.2. Android. OS. debug queries memory usage information of a single process, such as PSS, VSS, and USS.Memoryinfo [] memoryinfoarray = aM. ge
radio box and check boxTo create a dialog box with a multiple-selection list or a single-selection list, use the Setmultichoiceitems () and Setsinglechoiceitems () methods. If you create a selectable list in Oncreatedialog (), Android automatically manages the status of the list. As long as activity remains active, the dialog remembers the option you just selected, but the selection is lost when the user exits the activity.Note: To save your selectio
must be executed before executing the Monkeyrunner, otherwise monkeyrunner cannot connect the device.Open the Android emulator with Elipse or open the emulator with the android command in CMD. Here's the point. Open simulator with android command in CMDCommand:EMULATOR-AVD test (Note: The name of the test for the virtual device--AVD is full:
://www.android.com/"); HttpURLConnection URLConnection = (httpurlconnection) url.openconnection (); try {inputstream in = new BufferedInputStre AM (Urlconnection.getinputstream ()); Readstream (in); This method is written by ourselves, from the stream to save the data to the local, to achieve from the network to obtain data. finally {urlconnection.disconnect ();} When you submit
registering time-based sampling functions (registered using register_timer_hook, enable the clock interrupt handler to access the program when it finally executes profile_tick), and place the sample in the kernel buffer. The latter runs in the background to collect data from the kernel space and write the file. The host runs on the PC, including a set of post-processing tools used to generate readable analysis reports from raw sample
This paper introduces the MediaPlayer usage of Android, and introduces the Surfaceview,surfaceview because it can obtain image data directly from hardware interfaces such as memory or DMA, so it is a very important drawing container, This time I will introduce the usage of surfaceview in more detail. There are many use
decide the best location1 [internal]: Install on internal device storage2 [external]: Install on external media1. Usage:1.1: View installed packages:Pm list packageThe names of all installed packages are displayed.Pm list package-fThe directory where the associated file is located (that is, the saved APK file) is also displayed)1.2: view known permission groups:Pm list permission-groups1.3: view all known permissions:Pm list permissions1.4: list all
: Android batch inserts data to the SQLite database.
Line 88A general query method is encapsulated here. The SQL method is not used to encapsulate it because the query method provided by SQLiteDatabase is more generic. We can see from the parameters. The usage of the Cursor object is similar to the ResultSet in JDBC. It is easy to understand.
After the DAO layer
Android handler HandlerThread usage
I. Handler
Handler is responsible for sending and processing messages in android. Its main purposes include:1) send a message as planned or execute a Runnanble (using the POST method );
2) put messages sent from other threads into the message queue to avoid thread conflicts (often used in updating UI threads)
By default, Handl
This article illustrates the drawable usage of graphic image processing in Android. Share to everyone for your reference. Specifically as follows:
How to get the resources in res
Data Packet Package:android.content.res
Main Category: Resources
Its main interface is divided into the following three parts according to function:
Getxxxx ()
For example:
int ge
have enough knowledge, know which objects are alive, And the reasons for their survival, and then combined with the data of mat to carry out specific analysis, it is possible to put some deep hidden problems to find out the cause.So today is also introduced a lot of content, the explanation of this article to here, because the Spring Festival is about to come, this is the last article this year, here first to worship an early, I wish everyone happy S
In the Android system, when we click the menu button, the menu option of menu will pop up, one of which is the setting option, after clicking the setting option, the system setting activity interface is displayed. How are these settings implemented? The Android system uses preferenceactivity to configure and manage system information. How does it save
Expandablelistview Introduction
Introduction of Expandablelistview
Expandablelistview can display a view to scroll vertically to show entries in the level two list, which is different from the list view (ListView). Expandablelistview allows two levels: Level list has two levels list.For example, in the mobile phone settings, for classification, has a very good effect. Mobile phone version of the QQ is also the effect.
the whole idea of using Expa
From Beta to RC, as Windows 7 leaks faster and faster, this new generation of operating systems is getting closer to us. A handful of innovative testers have already used Windows 7, which has not yet been officially released, as the primary operating system for day-to-day applications, and for most ordinary users who still use Windows XP or Windows Vista (especially business users who focus on efficiency and benefits), how to put existing applications, important The smooth migration of
remotely enters the log by using the setprop command$ adb shell stop$ adb shell SetProp Log.redirect-stdio true$ adb shell startsystem until you turn off the simulator/device before the settings are retained, you can use the default settings on the emulator/device by adding /data/local.prop v. List of LOGCAT commands:
Option
Description
AIDL/IPC Android AIDL/IPC process communication mechanism-detailed explanation and usage case analysis (player)
First, let's look at AIDL. What is AIDL? IPC? ------ Designing a Remote Interface Using AIDL
Generally, we use Binder and BroadCastReciver in the same process to allow the Service to communicate with the Activity, data interaction, and
can be divided into the following five ways:
1.SharedPreferences Sharing Preferences2.Internal Storage internal storage space3.External Storage External storage space4.SQLite Database Databases5.Internet NetworkEach of these methods have their own advantages and disadvantages, according to different actual conditions to choose, and can not give a unified standard. Here are a few ways to talk about their pros and cons and the most appropriate usage:
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.