I. Android Application Architecture
After installing Android to IDE, we can see the following program architecture:
L src
Directory for storing original java code
L gen
The gen directory stores all files automatically generated by Android
The Android framework provides two animation systems: Property animation (introduced in Android3.0) and view animation. These two animation systems are both feasible options, but attribute animation is usually the preferred method because it is more
StartActivity can start a new Activity. The new Activity is relatively independent from the Activity that starts it and does not return the results of the Activity that calls it. When writing an application, you sometimes need to return results from
The last few examples of Activity classification examples are used to display translucent Activity. The examples are similar. The translucent effect of the Activity is mainly achieved through Style and Theme.
Let's take a look at the definition of
This example is different from Translucent in Blur, that is, other activities displayed behind the current Activit are displayed in Fuzzy mode.
This is set through the Flag of the window object.
[Java]GetWindow (). setFlags (WindowManager.
The Intents sample code is very simple:
[Java]Intent intent = new Intent (Intent. ACTION_GET_CONTENT );Intent. setType ("audio /*");StartActivity (Intent. createChooser (intent, "Select music "));Intent intent = new Intent (Intent.
Applications can use Notifications to notify users of an event (such as an SMS ). Icationicationmanager is used to process notifications. icationicationmanager can:• Display a new icon on the Status Bar.• Display additional information or start an
In addition to Notification, Toast can also be used to notify the user of an event. Toast is a transparent dialog box that automatically disappears after several seconds of display on the screen. Similar to Tooltip. A feature of Toast does not
Remote Service Controller and Android ApiDemo instance using Local Service (40): App-> Service-> Local Service Controller
The "Started" mode of the Service is used. The definition of RemoteService in AndroidManifest. xml is as follows:
You can bind
I. Applicable scenarios
Using $. post () in jQuery allows you to easily initiate a post request. In android apps, sometimes you need to obtain some data from the server, and you must also use the post request.
Ii. Main types to be used
In android,
I. Text message sharing
01Intent intent = new Intent (Intent. ACTION_SEND );02// Intent. setType ("text/plain"); // plain text03// Share images04Intent. setType ("image/png ");05// Add an image06File f = new File ("/sdcard/sd.png ");07Uri u = Uri.
The android. Content package defines some classes, which are mainly used to access or publish data on devices, and consists of three packages.
Content sharing (android. content) is mainly used to share some data on each part of the Application. Its
HashMap imageCache knows about the number of SoftReference classes, and it will be OK.
Mechanism: In simple terms, she will help us manage the memory and prevent memory overflow. Another point is equivalent to map. Temporarily cache some images
In fact, the implementation method of StatusBar has been greatly corrected in the StatusBar architecture. For example, the operations of the original StatusBar are in the Service process, now many operations such as icon display update are moved to
In this example, SensorManager is used, preferably on a mobile phone.
SensorManager is used to manage various sensors in Android devices. The method for obtaining the SensorManager instance object is to use getSystemService:
[Java]Private
Generally, you can use ImageButton to display a Button. However, sometimes we want to change the button status, for example, before the button is pressed, after the button is pressed, it is another way. Android allows us to change the button image
Canvas provides drawText and drawPostText to display text on the screen. The font type and size are defined by setting the paint attribute.
Painting also provides the size (width, height, range, etc.) occupied by the text on the screen when the text
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