Android write applications, the same need to consider the problem of reducing coupling, there are some other issues, such as the incremental update of the app, business changes, such as the ease of implementation, there will be Factory mode and a singleton figure.Factory mode is the most commonly used instantiation object pattern, and it is a pattern that replace
First, we start with the simplest,StandardThis mode is the default mode, we all know that when you use this mode, each time you send a intent, a new instance will be generated!I write a simple example:1 XML version= "1.0" encoding= "Utf-8"?>2 Manifestxmlns:android= "Http://schemas.android.com/apk/res/android"3 Package
Android uses MVP mode to save and display webview history records. androidwebview
MVP is a common design mode on android. In Launhcer, it is often seen in Mobile browsers. I have observed what other great gods wrote. Now, I will write a demo with a help.
If you have any questions, please submit them.
We will discuss it
Xiao bin want to do anything Ningchong cause far attention 2016.06.30 10:16* words 489 read 3234 comments 3 likes ObjectiveBecause the damned undead design is wet, a set of white status bar UI is designed. Of course, on iOS can be adaptive, but Android is more troublesome, so has not been engaged. Recently saw an article on the White bottom black word! Android Light status bar Black font
the model and view views, thus allowing the coupling of the code, using the MVP framework to write the project to achieve decoupling.
The biggest difference between MVP and MVC is that the V in MVC can get data from M, while the MVP in M and V are completely separated, unaware of each other's existence, and presenter communicates V and m by means of interface communication.
In Android the MVP framework activity serves as the View view layer a
First, understand the IPC motherboard mode of Android
The most critical task of system architecture design is the combination (or integration), and it is best to be unique and innovative. Android is good at using the motherboard mode to practice the IPC communication mechanism across the process in a generic interface
task appeared in Task2, and TASK3, this time click App1 found activity_b at the top, click App2 found that the TASK3 already exists, will not continue to create, display Activity_f is at the top, click the Back button from the Activity_f, go back to activity_e, then launch, and not go back to Activity_d, because Activity_d is not in the stack. To summarize,1: To create a new task, at least two conditions must be met: different apps and start in Singletask
.
Note:Although this activity is started in a new task, it is still returned to the previous activity when the return button is pressed.
"Singleinstance"
The mode is the same as that of "singletask", except that the system does not start any activity in the task that owns this instance. This activity is always independent and the only member of its task. Any activity started through this activity is opened in an independent task.
For example, the
", username) ; Set the requested parameter name and the number of Params.put ("Userpass", userpass);//Set the requested name and the number of parameters//When sending a GET request, the URL address corresponding to the parameter, the anonymous callback object Client.get (URL, params, New Asynchttpresponsehandler () {@Overridepublic void onsuccess (int statusCode, header[] headers,byte[] responsebody) {/ /Successful processing Method System.out.println ("StatusCode-------------------" + STATUSC
use of the Internet to store the data we want, this is the CS structure storage mode, but also a point of name.
How to use the Content Provider
Below are several typical content provider applications that users often encounter:
* Content Provider name:intended Data
* browser:browser bookmarks, Browser history, etc.
* Calllog:missed calls, call Datails, etc.
* Contacts:contact Details
* mediastore:media files such as audio, video and Images
There are unwritten rules in the industry that phone companies must have a prompt when they click the photo and video keys for camera. Therefore, google also put the function of playing the photo sound in the cameraService to prevent developers from developing a non-audible camera. Therefore, as long as the camera function is called, it will surely sound, this is written to the framework.
This rule is a bit out of date today. This is not the case. Today I received a BUG mentioned in the test, s
There are unwritten rules in the industry that phone companies must have a prompt when they click the photo and video keys for camera. Therefore, google also put the function of playing the photo sound in the cameraService to prevent developers from developing a non-audible camera. Therefore, as long as the camera function is called, it will surely sound, this is written to the framework.This rule is a bit out of date today. This is not the case. Today I received a BUG mentioned in the test, say
**************************************** **************************************** **************************************** ***Author: EasyWave time: 2013.02.16
Category: Android source code analysis statement: reprinted. Please keep the link
NOTE: If any error occurs, please correct it. These are my Learning Log articles ......
**************************************** **************************************** **************************************** **
memory. Enhance the performance of the program.(2) Use the enjoy meta-mode to enable the enjoyment of Meta objects to be shared in different environments.2. Disadvantages(1) Make the system more complex. In order for the object to be shared, some States need to be externally instantiated. This complicates the logic of the program.(2) The enjoy meta-mode will be the need, the enjoyment of the state of the m
Android Access Data mode: File, sharedpreferences, SQLite database, Content providerFile stream:
Use Java IO Stream to read and write files, file permissions default.
specify file permissions to write: Mode: File permissions mode_private files are private to the application, mode_world_readable are accessible to all applications, mode_worl
notified through the Getcontentresolver (). Notifychange () method.The registration and notification here is obviously not in a process, for example, in a application through the CONTENTRESOLVER registered observer, in the B application through the Contentresolver notify the Observer, The contentresolver here is not a Contentresolver object in a, and is not able to be notified by a direct call. This is actually the event registration and notification through inter-process calls. The registratio
Ubiquitous design Patterns in Android development--the ubiquitous design pattern--builder pattern in the single case model Android development
The previous introduction of the single case mode and builder mode, interested in see the above two links, this article focuses on the Observer model. Let's look at the definiti
. Note If you attempt to start an activity from a non-activity, such as starting an activity from a service, intent for example to add a flag_activity_new_task tag.Flag_activity_no_history: For example, now the stack condition is: A B C. C Jump to D through intent, this intent add flag_activity_no_history flag, then the interface displays the contents of D, but it does not press into the stack. If you press the back key, return to C, the case of the stack is: A B C. If you jump to E in D at this
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.