Differences between APIs of different Android versions

Source: Internet
Author: User
Tags xml attribute home screen
Differences between APIs of different Android versions Android 1.5 API change Overview: 
1. UI framework
· Framework for easier background/UI thread Interaction
· New slidingdrawer component
· New horizontalscrollview component
2. appwidget framework
· Some APIs for creating desktop appwidgets.
· Provides the API for creating livefolders based on custom content
3. Media framework
· Sound Recording and playback APIs
· Interactive MIDI playback Engine
· The Video Recording API used by developers (3GP format ).
· Video photo sharing intents
· Media search intent
4. Input Method Framework
· Input Method service framework
· Text prediction Engine
· Provide IME with download capability to users
5. application-defined hardware requirements
Applications can define hardware requirements. Applications can define hardware requirements required by this program, for example, whether a physical keyboard or trackball is required.
6. Speech Recognition Framework
· Supports Speech Recognition libraries.
7. Miscellaneous API Additions
· Locationmanager-the application can receive location change information.
· Support for webview-touch start/end/move/cancel DOM events
· Rebuilding sensor manager APIs
· Glsurfaceview-more convenient framework for creating OpenGL applications.
· Successful software upgrade and installation of broadcast intent-more peaceful and excellent software upgrade experience

Android 1.6 API change Overview:
1. UI framework
· The new Android. View. animation class controls animation behavior:
O anticipateinterpolator
O anticipateovershootinterpolator
O bounceinterpolator
O overshootinterpolator
2. · New XML Attribute Android: onclick, which describes the view. onclicklistener of a view from a layout file.
· New support for screens with different resolutions. bitmap and canvas will be scaled accordingly. The framework will automatically scale Bitmap Based on screen resolutions and other content.
To use the APIS contained in Android 1.6 in your application, you must set the "4" attribute to the manifest element.
3. Search framework
· The application can now publish relevant content, which is recommended to be placed in the quick search box. The search function within the new device range can be searched from the home screen. To support this, the search framework adds a new property to the searchable metadata file. For complete information, see the searchmanager documentation.
4. Accessibility framework
· New Android. Accessibility package that includes des classes for capturing accessibility events and forwarding them to an accessibilityservice handler.
· New accessibilityservice package that lets your application track user events and provide visual, audible, or haptic feedback to the user.
5. gesture Input
· New gesture API: Create, recognize, read, and save gestures.
6. text-to-speech
· The new Android. Speech. TTS package provides the TTS text reading function to generate a sound file for playback from a text file.
7. Graphics
· Classes in Android. graphics support scaling different screen sizes.
8. Telephony
· The New smsmanager sends and receives text messages.
9. Utilities
· The New displaymetrics field determines the screen density of the current device.
10. Android manifest Elements
O New Elements
O new labels
O glesversion: specify the minimum version of OpenGL ES
·
11. New Attributes of elements:
O target SDK version: The application can specify the target version. it can run in the old version (as low as minsdkversion), which is developed according to the specified version of the application. specifying this version allows the platform to disable compatibility code that is not required or enable newer features that are not available to older applications.
O maxsdkversion: specify the maximum version of the program to run. Important: read the document carefully before using these attributes.
12. New Permissions
· Change_wifi_multicast_state: allows applications to enter the Wi-Fi multi-point transmission mode.
· Global_search: allows a global search system to precisely determine the content provider.
· Install_location_provider: allows the application to install a location provider in location manager.
· Read_history_bookmarks: allows applications to read (cannot write) user browsing records and bookmarks.
· Write_history_bookmarks: allows applications to write (cannot read) user browsing records and bookmarks.
· Write_external_storage: allows programs to write data to external storage. the application uses API Level 3 to grant this permission by default (which is visible to the user); the application uses API level4 or higher and must explicitly declare this permission.

Android 2.0 API change Overview:
1. Bluetooth
· Enable and disable Bluetooth
· Device and service discovery
· Use RFCOMM to connect a pluggable device to send and receive data
· Publish RFCOMM service and listen to receive RFCOMM connections
2. Sync adapters
· The new APIs synchronizes the bridge adapter to connect to any backend
3. Account Manager
· Centralized account manager APIs, secure storage and use of trusted tokens/passwords
4. Contacts
· The New Communication APIs allows you to obtain data from multiple accounts.
· The new fast communication framework APIs allows developers to create a communication tag in their applications. one-click tag opens a new window showing how to contact the current person.
5. webview
· Classes not supported: urlintercepthandler, plugin, plugindata, pluginlist, and urlinterceptregistry.
6. Camera
· New Features of color mode, scene mode flash mode, focus mode, white balance rotation and other settings.
· When the scaling level changes, a new scaling callback interface is called back.
7. Media
· Mediascanner now generates a thumbnail for all images. When they are inserted into mediastore.
· New thumbnail API: used to retrieve the image and video thumbnail.
8. Other framework
· Android. r. the new system theme in the style can display the current acitivities system wallpaper or keep the previous activity in the background. the new wallpaper manager API replaces and adds wallpaper APIs. We can allow our applications to set system wallpapers.
· The new service APIs helps the application accurately process the service lifecycle. The service will be disabled under the specified low memory status.
O service. setforeground () is not recommended, and this method is not actually executed now .. it is replaced by a new API, startforeground (), that helps (and requires) associating an ongoing notification with the foreground state.
· Motionevent: if the device permits it, motionevent will return multi-point touch information. A maximum of three points can be obtained simultaneously.
· Keyevent now has a new button to send APIs to help implement action-on-up and long button actions. A new mechanism is used to cancel the button (Virtual button ).
· Windowmanager. layoutparams now has a new constant that allows the window to wake up the screen when it is locked or in other situations. This allows applications such as alarm clocks to wake up the device.
· Connection status of the new intent APIs broadcast device. when the device is placed on the desktop or in the parking lot, special activities can be started by the program.
9. Key events executed on key-up
Android 2.0 can use virtual buttons home, menu, back, and search, instead of physical buttons, to provide users with the best user experience on their devices, the Android platform now adds these buttons to key-up and performs key-down/key-up pairs instead of key-down ., this helps prevent unexpected button events and allows the user to press the button area and drag the button without generating an event.
This change will only affect your application. If it is an intercept button event, it is best to use key-down instead of key-up .. In special cases, if your application intercepts the back key, you should ensure that your application properly handles the button event.

Android 2.0.1 API change Overview:
· The New quickcontactbadgestyle * attribute allows the application's quickcontactbadge component to receive the necessary style.
· When the filter is declared in manifest, action_configuration_changed broadcast is removed. To receive the broadcast, the application must register registerreceiver (broadcastreceiver, intentfilter ).
Performance Changes:
1. Bluetooth
Changed the returned values of action_request_enable and action_request_discoverable.
· Action_request_enable: If Bluetooth is enabled successfully, result_ OK is returned. If the user rejects the request to enable Bluetooth, result_canceled is returned.
· Action_request_discoverable: if the user refuses to enable the Bluetooth or Bluetooth discoverable function, result_canceled is returned.
2. Communication
The action_insert intent returns result_canceled in cases where the contact was not persisted (for example, save the cut to an empty operation ).
Fixed errors:
3. Resources
Now the framework can be selecting a folder of application resources based on API levels (drawable-v4 is the resource used by API level4). The current version of this function does not work properly and the problem has been fixed.
4. Contacts
The action_insert intent now returns the appropriate kind of Uri when the request is made using the (now deprecated) Contacts APIs.
5. other framework fixes
· Getcallingpackage () is now the correct report package name, not the process name.

Android 2.1 API change Overview:
1 ,? Live wallpapers Dynamic Desktop
? The following APIs can be used to develop dynamic desktops:
· New Android. Service. wallpaper package.
· New wallpaperinfo class.
· Upgraded wallpapermanager.
NOTE: If your application provides the live wallpapers function, you must add an element to your application manifest. android: Name = "android. software. live_wallpaper ". example:
2. Telephone
· The New signalstrength class provides some information about the current network signal. This information can be called back from onsignalstrengthschanged (signalstrength.
· New ondataconnectionstatechanged (INT, INT) callback.
3. Views
· The New View method isopaque () and ondrawscrollbars (canvas ).
· New remoteviews Methods addview (INT, remoteviews) and removeallviews (INT ).
· The New viewgroup method ischildrendrawingorderenabled () and setchildrendrawingorderenabled (Boolean ).
4. WebKit
· New webstorage Method for webpage data caching.
· The New geolocationpermissions method obtains the source of geolocation permissions and sets them to webview.
· The New websettings method manages software caches, Web Cache, and screen scaling.
· What are the restrictions on the new webchromeclient Method for video processing, history, custom view, and software cache ??

Android 2.2 API change Overview:
1. Better support for Microsoft Exchange.
Several new features of Android make it more suitable for the exchange enterprise environment. Some of the new features are listed as follows: User Name/password-based exchange account Automatic Detection supports Exchange Calendar Synchronization
With improved security, administrators can enforce security policies across devices.
Restore exit settings-the administrator can reset the device to exit settings so that the sensitive data can be erased after the device is stolen or lost.
Global Address List lookup-you can help the user automatically fill in the recipient's email address based on the list returned by the server
Device management API. Android 2.2 has improved and added a large number of device Management APIs, which can be used by developers in applications:
Application Data Backup API-you can back up application data to the cloud. If you switch to another Android device, you can recover data from the previous device.
2. Cloud-to-device message API. Users/systems in the cloud can use this enhancement to trigger actions on devices. This feature can send mobile warnings to mobile phones and support two-way push synchronization services.
You can directly install an application on an external memory device (SD card), migrate the application from the internal device to the SD card, and vice versa.
3. network sharing. Android 2.2 can connect multiple services to the Internet through a hotspot provided by an Android phone.
Performance. With the new Dalvik JIT compiler, Android 2.2 is faster than Android 2.1 for CPU-intensive applications ~ 5 times. Based on the linpack benchmark test results, froyo nexus is installed.
One phone can reach 37.5 mflops, and the same phone number can only reach 2.1 mflops if Android 6.5 is used.
Faster browsing speed. Because the browser now uses the chrome V8 engine, JavaScript code processing speed is 2 ~ Faster than Android 2.1 ~ 3 times.
Access the device API from the browser. Now, you can directly access a large number of device APIs from your browser, such as accelerators, cameras, voice recognition, and translation, so that Web applications can interact with devices in an unprecedented way. For example, you can upload a photo to the Internet after it is taken, and all this is done in a browser.
4. Supports flash 10.1. Froyo supports the latest flash 10.1
Beta version. Recently, the introduction of JIT compiler has greatly improved the performance, which has played a huge role in the running of flash applications, because we all know that flash applications are CPU-intensive applications.
Android store. Android 2.2 developers and store users will benefit from the following new features:
You can search for apps in the Android store, including APP data.
Update -- all applications are automatically updated after you click the button once.
5. Crash and freeze reports. Android2.2 integrates the crash/freeze report feature so that the user can report the complete details to the application publisher during the crash.
Browse the store from the PC and download the application directly to the device. You can select the Store application on the PC, and then the application can be sent to the loaded device. To use this feature, You need to log on and register the device in the Android store-
6. Music management. You can convert all non-DRM music from Windows Media or Mac iTunes to Android devices for playback.

Android 2.3 API change Overview: 
Android 2.3 ginger pie is released, codenamed gingerbread. What are the new features and improvements?
1. added the android.net. Sip package named sipmanager class, which allows you to easily develop SIP-based VoIP applications. At the same time, you must have at least two permissions <uses-Permission Android: Name = "android. permission. internet "> and <uses-Permission Android: Name =" android. permission. use_sip "> If You Need to filter out only models that support VoIP APIs on the market, you can use androidmanifest at the time of release. add in XML
<Uses-feature Android: Name = "android. software. SIP "Android: required =" true "> and <uses-feature Android: Name =" android. software. sip. voIP "> these two labels.
2. near Field Communications (NFC) supports close-range communication. NFC can realize data exchange and communication without contact, and can effectively replace rfid sim card to implement mobile payment and other extension functions, of course, android123 prompts that hardware support is required.
, Add a package in Android. NFC contains nfcadapter, ndefmessage, ndefrecord, and other classes. Similar to the Bluetooth processing method, you must declare the permission to use this API <uses-Permission Android: Name = "android. permission. NFC "> to filter out NFC-supported devices on the market, you must add <uses-feature Android: Name =" android. hardware. NFC "Android: required =" true ">.
3. Added support for Gyroscope and other sensors.
Android 2.3 has added some new sensors, such as gyroscope, rotation vector, linear acceleration linear accelerator gravity and barometer support. To filter these functions, add the Android: Name = "android. Hardware. sensor. gyroscope" Android: required = "true"> similar to <uses-feature Android: Name = "android. Hardware. sensor. gyroscope" Android: required = "true.
4. multi-camera support
Added camera. camerainfo to manage front and rear camera
Add getnumberofcameras (), getcamerainfo (), and getnumberofcameras () to get the number of cameras.
Added the get () method to get the camera configuration information camcorderprofile.
Added getjpegencodingqualityparameter () to obtain JPEG encoding quality parameters. You can view the parameters in the camerapreview. Java file in the apidemos sample program.
5. added the photo taking API.
For example, get the focal length getfocusdistances () to get the preview FPS getpreviewfpsrange (), get the focal length range getsupportedpreviewfpsrange (), and set the education setpreviewfpsrange ()
6. reverb sound effects
This Android 2.3 framework has added support for sound effects such as bass, headphones, and virtualization.
Added the Android. Media. audiofx package.
Added the audioeffect class to provide sound control.
Adds an audio session ID and sets audiotrack and mediaplayer.
Attachauxeffect (), getaudiosessionid (), and setaux1_tsendlevel () are added to the new audiotrack ().
New attachauxeffect (), getaudiosessionid (), setaudiosessionid (INT), and setaux=tsendlevel ().
The relevant sound effects are in the apidemos example of audiofxdemo. java.
6. Improvement of photo EXIF information
Add a latitude and longitude label in JPG format EXIF. You can also use the getaltitude () method to obtain the latitude and longitude EXIF information.
Added setorientationhint () to allow the program to get the video recording direction.
7. Download Management
Download Management added in Android 2.3 supports long-running HTTP download service support. You can ensure that you still retry the download operation after the phone is restarted. The whole process is performed in the background.
The downloadmanager class is instantiated using getsystemservice (download_service) and processed by the intent action_icationication_clicked.

8. Restricted Mode
It helps developers monitor the performance of their applications, handle thread blocking, and avoid ANR.
Strictmode. threadpolicy and strictmode. vmpolicy obtain VM information.
For Android applications optimized by restricted mode, you can view the details of the android. OS. strictmode package.

Android 3.0 API change Overview: 
What APIs are added to the android 3.0 SDK? We will summarize the new features in the flat honeycomb system, the first thing to clarify is that when android123 finds that the resolution of the simulator is set to a normal WVGA resolution, the features of the tablet will automatically disappear, which is no big difference from Android 2.3, in this way, in the future, Android 3.0 will continue to be supported by mobile phones in addition to compatible tablets. It is said that 3.0 of the Code has further improved the A9 dual-core CPU.
1. fragments container
For details about Android fragments, the android development network has already used several articles a few days ago. You can refer to fragment's introduction to activity-android fragments.
2. Action bar activity bar
The action bar in the activity bar can replace the traditional title bar in the activity window, including program icons and some new interfaces in the activity option menu. In addition, the action bar allows you
Include Select menu items directly in the action bar-as "action items"-for quick access to global user actions.
In your xml Declaration for the menu item, include the attribute, Android: showasaction with a value of "ifroom ". when there's enough room in the action bar, the menu item appears directly in the bar. otherwise, the item is placed in the overflow menu, revealed
By the icon on the right side of the action bar.
Add interactive widgets to the action bar-as "Action views"-such as a search box.
In the XML for the menu item that shoshould behave as an action view, include the Android: actionviewlayout attribute with a layout resource for the action view or Android: actionviewclass with the Class Name of the widget. like action items, an action view appears
Only when there's room for it in the action bar. if there's not enough room, it is placed in the overflow menu and behaves like a regular menu item (for example, an item can provide a searchview as an action view, but when in the overflow menu, selecting
Item activates the Search dialog ).
Add an action to the application logo when tapped and replace it with a custom logo
The application logo is automatically assigned the Android. R. Id. Home ID,
Which the system deliveres to your activity's onoptionsitemselected () callback when tapped. simply respond to this ID in your callback method to perform an action such as go to your application's "home" activity.
To replace the icon with a logo,
Add breadcrumbs for navigating backward through fragments
Add built in tabs and a drop-down list for navigation
Customize the action bar themes and custom backgrounds
For more information about actionbar, see action bar usage-android activity bar series.
3. System clipboard system clipboard
The clipboard in Android 3.0 is enhanced. This time, more content, such as URL and intent, can be added in addition to plain text. For the clipboard class clipboardmanager, it is still instantiated through getsystemservice (clipboard_service, the new clipdata class is used to manage specific replication objects. content. clipdata. item. The specific use of android123 will be written in future articles.
4. Drag
Start to drag the content in your activity. You can use startdrag () method in a view. Here, view. dragshadowbuilder provides shadow during drag and drop. You can use ondraglistener to set the process of drag and drop through setondraglistener () of view. The ondrag () method is automatically called during drag and drop.
5. Enhanced appwidgets
Appwidget of Android 3.0 supports richer controls, such as gridview, listview, stackview, viewflipper, and adapterviewflipper. previously, you must use remoteview to display a text or image. This new remoteviewsservice enhances the desktop plug-in function.
6. Enhanced Status prompt bar
The new notification API can enrich your status bar and new notification. the builder class can help you easily implement it. It supports the setlargeicon Method for large icons and usually displays some social software, such as contact photos or album thumbnails, and sets custom status bars, you can use the setticker () method.
VII. Content Loader
The new framework API provides a tear for asynchronous loading of content, which is merged with the UI components and fragment to dynamically load data from the ready-made workers. The cursorloader subclass is used to obtain the data in contentresolver.
8. a2dp Bluetooth and headset control APIs
Android honeycomb does not forget to enhance Bluetooth again. You can call getprofileproxy () to process a2dp or headset settings by initializing javasthprofile. servicelistener can get the client connection or disconnection callback.
IX. animation Frame
In Android 3.0, we need to learn more about the animation playback class objectanimator and layouttransition.
10. Extend the UI framework
Add the following UI controls
Adapterviewanimator
Adapterviewflipper
Calendarview
Listpopupwindow
Numberpicker
Popupmenu
Searchview
Stackview
11. Graphics
1. 2d graphic hardware accelerates hardware accelerated 2D graphics by adding Android: hardwareaccelerated = "true" to the androidmanifest. XML element. He can optimize the program running to be smoother and more efficient in terms of scrolling and animation.
2. Set the rendering mode. For example, layer_type_hardware hardware acceleration and layer_type_software use the setlayertype () method.
3. rendering script for 3D graphics, you can look at the renderscript class.

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.