Haven't updated the blog for a long time, recently in the company's project, which is my contact with the first formal project. Through the inspection of the project, found oneself accumulated a year of knowledge or far from enough, want to improve,
For example, to get the name of the application that opens the camera, just add the following code to the open () method in Frameworks/base/core/android/hardware/camera.java.
Copy Code code as follows:
Application application =
From the start of the Android program, I was told that the common sense
One, DP (or dip device independent pixels)
An abstract unit based on screen density. On a 160-point display per inch, 1dp=1px. Different devices have different display effects,
Create started Service
An application component (for example, an activity) invokes StartService () to start a service, passing the required parameters through intent to Service,service will get intent in the Onstartcommand function.
There are two
Recently in the company, the project is not very busy, and occasionally see a brother in Csdn help, help to a custom gradient progress bar, I looked at the progress bar, feel pretty, try to customize view to achieve a, nonsense do not say, first on
Obfuscation packaging for Android applications1. Add the following proguard.config=proguard.cfg in the project.properties of the engineering document, as shown below:Target=android-8
Proguard.config=proguard.cfg
Eclipse will generate proguard.cfg
Each handler object is associated with the line threads relative that created it, and each handler object can only be associated with one line threads relative.Handler is generally used for two purposes: 1 execution of Scheduled tasks, you can be
The use of Android handler, before speaking handler, we first mention a small problem, is how to let the program 5 seconds update title.First of all, let's take a look at the people who are used to Java programming and how to write the program
Introduction of NDK and JNI
NDK is all called the native Development Kit local language (c&c++) development package. The corresponding is the frequently contacted ANDROID-SDK, (software Development Kit) software development package (only supports
The structure of EditText in the API
Java.lang.Object
Android.view.View
Android.widget.TextView
Android.widget.EditText
Known Direct subclass:
Autocompletetextview, Extractedittext
Known indirect subclass:
Multiautocompletetextview
In the development will often use the countdown function, including the phone to send verification code, and so on, before my practice is to use handler + Timer + TimerTask to achieve, now found this class, decisively abandoned before the practice,
The context is the object that we often use to write Android programs, meaning contextual objects. The context in which activity is commonly used is still application. Activity is used to show the active interface, contains a lot of views, and the
Recently, in the porting of Hevsocks5client to Android, after adding SIGNALFD and TIMERFD related system call support, you can directly use NDK to compile the executable. The direct native exectuable is not always easy to use on the Android system.
Easy to install problems and solutions:1, update the SDK may not be able to connect to the server, can be C:\WINDOWS\system32\drivers\etc under the Hosts file last added:#Google主页203.208.46.146 www.google.com#这行是为了方便打开Android开发官网 don't seem to turn
This cottage a new version of the list of QQ slide Delete, the last article on the slide to delete the QQ, speculated that the principle is ListView itself each item there is a button, but the general state of the hidden off, detect the left slide
Micro-Letter Dialog list Sliding Delete effect is very good, for reference to the GitHub on the Swipelistview (Project address: Https://github.com/likebamboo/SwipeListView), on which a number of refactoring, Finally realized the Micro-letter dialog
This example for you to share the Android to determine the current app state of the specific implementation code for your reference, the specific contents are as follows
First type:
/**
* To determine whether the current application is
This example for you to share the Android phone socket communication code for your reference, the specific contents are as follows
1, socket communication first to define a good service end of the IP address and port number;
(1). First look at the
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