When we are creating albums and uploading related applications, we need to take snapshots of images. At this time, we need to take snapshots of images.
Android has a bitmapfactory class to deal with such requirements.
The implementation steps
Mainactivity is as follows:
CopyCode The Code is as follows: Package CN. testcallback;
Import Android. OS. Bundle;
Import Android. widget. Toast;
Import Android. App. activity;
/**
* Demo description:
* Use of callback interfaces in
Activity A and B
A. activity B that obtains data returns the activity of the data.
Click the button on A to display the selected data in the contact list of B in textview OF A using baseadapter.
1: declare the read and write permissions of Bactivity
Android resource naming rules
In recent months, a lot of work has been involved in android resources. For complex applications, resource naming rules are necessary. In addition to developers, the uidesigner (or the person related to the cut chart)
Add permission
First, add the network access permission to manifest:
Copy codeThe Code is as follows:
...
The complete Manifest file is as follows: Copy codeThe Code is as follows: Package = "com. example. httpdemo1"Android: versionCode =
Some techniques can also be used to transmit data between activities. Either windows or Linux operating systems support a clipboard technology, that is, a program copies some data to the clipboard, then any other program can obtain data from the
Paste the Code:
1. Extended Gallery:
Copy codeThe Code is as follows: public class GalleryFlow extends Gallery {
Private Camera mCamera = new Camera (); // Camera class
Private int mMaxRotationAngle = 60; // Maximum Rotation Angle
Private int
The html data in loadData () cannot contain '#', '% ','\','? '4th special character. If this character is displayed, A parsing error occurs, indicating that some html code is not found on the webpage. What should I do? We need to encode UrlEncoder
1) how to obtain a MediaPlayer instance:You can use the new method directly:MediaPlayer mp = new MediaPlayer ();You can also use the create method, such:MediaPlayer mp = MediaPlayer. create (this, R. raw. test); // you do not need to call
If you have used multimedia applications, you will be troubled by how to obtain multimedia files in the SD card. Android is still very powerful. If you know how to call the android api, everything will be okay.
When a mobile phone or simulator is
This document uses Matrix to scale and rotate images in Android. The sample code is as follows:
Copy codeThe Code is as follows: package com. android. matrix;
Import android. app. Activity;
Import android. graphics. Bitmap;
Import android. graphics.
1. Question proposal
1) Why multithreading is required?
2) How to Implement multithreading?
3) What is the core of the multithreading mechanism?
4) How many implementation methods are there?
2. Problem Analysis 1) The essence of Multithreading is
Locale is provided through merger in the region and latin input language set by the system. Therefore, it is supported in both the system region settings and the input language.
LanguageList is read from the latin_preferences.xml file that stores
Modify the following code in \ packages \ apps \ Camera \ res \ values \ arrays. xml:
Copy codeThe Code is as follows:
@ string/pref_camera_continuous_number_normal
@ string/pref_camera_continuous_number_large
40 99
You need to add
In Android, there is a service called a service, which is actually an Interface called: Android Interface Definition Language. This Interface can provide cross-process access services, abbreviated as AIDL.
The benefit of this service is that a
As follows:
Copy codeThe Code is as follows: private void readImage (String filename) throws FileNotFoundException, IOException {
FileInputStream fIn = new FileInputStream (filename );
// Replace the following two sentences:Required
Today I encountered a very strange problem:
In Android, ImageView cannot display the loaded local SDCard image.
The specific process is: first call the local camera program to take the camera, and then load the captured image to the ImageView for
In Android, when you use ImageView to display an image, you can see that the image is not correctly displayed. The orientation is incorrect or incorrect.
To solve this problem, we naturally think of two steps:
1. automatically identifies the image
When using LinearLayout, the Child control can set layout_weight. Layout_weight is used to set the importance of the subspace in LinearLayout (control size and weight ). The lower the value of layout_weight, the more important the control is. If
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