Three methods
1. Use an XML file to define res/drawable/radio. xml
Android: state_checked = "false"
Android: drawable = "@ drawable/tabswitcher_long"/>
Android: state_checked = "true"
Android: drawable = "@ drawable/tabswitcher_short"/>
It is easy to use XML files, but sometimes it must be implemented dynamically using java code. This is complicated. This requires inheriting RadioButton and overwriting the onDraw method.
The image in the Code is a Bitmap object.
@
In the previous article, we talked about the UI and the stage. Now we can easily build a project.
Because the actor class is drawn based on the x and y values, we can change the actor position by controlling the x and y values. However, other actor
Starting from today, we will step by step implement what we want to achieve in demand analysis. First, we will achieve dynamic display of the date and time at the top of the curriculum.
The date is automatically updated every day, and the
Two risks should be taken into consideration before camera photography can be used.
[1] Not every android machine can use your application
Main reasons:
The camera takes pictures. The app calls the android system API, the system API, and the
Some time ago, we engaged in android animation. After using the animation on the page, the effect was quite good, which greatly improved the user experience. However, by chance, to add a display and disappear animation in the popupwindow, I used
In android development, many of my friends may determine the network type of the mobile phone, because the current android mobile phone may be in a 4-digit status.
1. No network (this status may be due to the shutdown of the mobile phone, the
1. SimpleDateFormat formatter = new SimpleDateFormat ("MM dd, yyyy HH: mm: ss ");
2. Date curDate = new Date (System. currentTimeMillis (); // obtain the current time
3. String str = formatter. format (curDate );
4. import java. text.
Use the android. hardware. Camera class to take photos. The procedure is as follows:
A. Get the Camera instance object,
Camera camera = Camera. open ();
Alternatively, Camera camera = Camera. open (int cameraId );
CameraId indicates the
Matrix (1) in the previous Android plot, I talked about the principle and Calculation Method of Matrix, which is difficult to understand when it comes to advanced mathematics. Fortunately, Android provides a series of Matrix
The gravity sensor can be used to obtain the interaction experience between the user and the mobile phone. However, the gravity sensor provides a wide range of data. How can we obtain data that is different from the user's existing operation
If you want to understand a technology, master a technology, or become a master or expert, learning is an inevitable way. In my opinion, there are two factors that determine the learning efficiency and Achievements: one is the learning method and
This section describes parameter transfer between activities. We know that intent can achieve mutual jump between activities. We also need to pass some parameters while redirecting. The following describes how to pass parameters in an activity,
Daming will write some high-quality blogs in the future, which should be as thorough as possible, and be able to read from different perspectives. When there are many problems, the technology is actually a window, when you have a lot of windows,
When developing android applications, it is easy to scroll horizontally or to make a marquee. The attributes of textview are supported. As long as the settings are accurate, textview will scroll, making development easier, however, textview does
Nowadays, Android is very popular. Many people compile Android programs in linux, but there are not many people who know how to develop Android applications in Eclipse.
I will explain how to compile Android applications in Eclipse
1. First,
1. as follows:
The first part is to put an image named icon.png in the drawablefolder. First, it indicates that Android only supports images with the extension png, jpg, and gif;
Then write the main. xml file with the following
Preface
Many people think that there should be no memory leakage due to the garbage collection mechanism of JAVA programs.
In fact, if we no longer use an object in a program, but because there are still references pointing to it, the garbage
Introduction
Toast is a pop-up Message that allows you to easily notify users of some time, such as saving data to the SD card. It is worth noting that you cannot cancel Toast. In most cases, Toast is just a short message, but you can also customize
In this section, let's take a look at configuration changes (such as screen orientation, language switching, or input device changes!
As we can see from the official documentation, when the configuration changes, any content displayed on the user
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.