In recent years, mobile platforms have become increasingly popular. Open your own QQ. There are 31 online friends, 13 of which are on mobile phones and 42% are on mobile phone users. Open Sina Weibo, Tianya, and maopu websites, there are countless
today, I encountered a problem while working on the project. When you click the "resident notification bar" icon, the application is restarted. What I want to achieve is to return the started application if the application has been started;
My androidProgramIt cannot be associated with the simulator. After the simulator starts up, the simulator does not respond. When I run the simulator again, it will open another simulator. However, after the simulator is turned on, the program I
I. Introduction to Adapter
An adapter object acts as a bridge betweenAdapterviewAnd the underlying data for that view. The adapter provides access to the data items. The adapter is also responsible for makingViewFor each item in the data set.
An
1. Install the android SDKDownload the SDK package for Linux on the official website: Release
On the SDK and AVD Manager interface, select the package to be downloaded under the project where the installation package can be installed. We recommend
Java provides a complete Io stream system for file operations. Android also supports accessing files in mobile phone memory in this way, including internal memory and external memory.
In Android, you can create a file to save data on the storage
Insetdrawable indicates that a drawable is embedded into another drawable, and some padding is left inside it. This is similar to the padding attribute of drawable. The difference is that padding indicates the margin between drawable content and
1. Create ninepatchdrawable
A ninepatch is also a PNG image, but the difference is that a scalable area can be defined for images in this format. When the content of a view exceeds the normal size, images in this format are automatically stretched
A transitiondrawable is a special drawable object that can fade in and out between two drawable resources.
Each under a node represents a drawable resource. There can be only two . Previous conversion callstartTransition(). Backward,
1. Create and use layerdrawable
A layerdrawable is a drawable that can manage a group of drawable objects. The drawable resource of layerdrawable is drawn in the order of the list, and the last drawable of the list is drawn in the top layer.
A set
A statelistdrawable is defined in an XML file. Based on the different states of the object, several different images are used to represent the same image. For example, a button has multiple states, such as getting focus, losing focus, and clicking.
From the inheritance structure of drawable, there are still a few that have not been introduced.
1. colordrawable
Colordrawable is easy to use. You can use the element to define a colordrawable and use it elsewhere.
In the color. xml file, define:
The vast majority of Android 2D graphics APIs are stored in Android. in Graphics, it provides low-level graphics tools, including canvas, color filters, point, rectangle, etc. We can use them to draw the image we want directly on the screen.
There
Clipdrawable is used to cut a drawable, which can control the cut area of the drawable and the alignment mode relative to the container. The progress bar in Android uses a clipdrawable to achieve the effect, it determines the size of the cut area
Mediaplayer is mainly used to play audio. Therefore, it does not provide an image output interface. In this case, surfaceview is used to display the image output during mediaplayer playback.
Note the following:
1. mediaplayer manages playback, so
After the android source code is compiled, various errors may occur immediately, because some dependent packages are not installed.
To avoid the following errors, installJdk1.5It must be jdk1.5. Otherwise, it cannot be compiled.
Then, check whether
When developing mobile phones, we sometimes use sensors, especially in game development. Next I didn't come to learn how to get the sensor.
Here we need a real Android phone. I use Huawei c8650.
To obtain a sensor from a mobile phone, follow these
Section 1 libutils Overview
Libutils is the underlying library of Android. This library is implemented in C ++, And the API provided by libutils is also C ++. Android-Based C language programs and libraries are mostly developed based on libutils.The
Problem description: in many cases, we need to use an efficient underlying module written in other languages (C) in our android applications, generally through system. loadlibrary (libname), and we also need to debug this library written in C. print
Recently developed, asynctask + progressdialog is used to display the progress information. However, when asynctask is stopped, the instance of the activity will not be GC after the activity is finished. After the program is run multiple times,
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