Original article: http://blog.csdn.net/zjujoe/article/details/6206010
Android OTA update: Compile the update package
Author: Song Lixin
Email: zjujoe@yahoo.comPreface
OTA update is a standard software upgrade method provided by the Android system. It is powerful and provide
This article introduces the principle of implementation, in order to use conveniently, a simple encapsulation of a class updater. The usage is very simple. Well, in order to support multiple languages, it's still a little cumbersome.
Usage:
Character definitions used in Strings.xmlOther languages to add themselves, the following instance programs in both English and Chinese have
The code is as follows
Copy Code
Permissions to be used to add updates in Andr
???? The students who must have seen this article have now installed Android studio and Genymotion:andSince then we will study with them, if you do not install, you can learn from my other articles of the installation tutorial, then let's start.One:
Create a project:or import a project (Elicpse and IDEA):Let's create a new project here, for example:Here we choose Android version Select 4.4:Select a
Tian haili @ csdn
After obtaining the OTA update package through the network or local device, you can start the android upgrade through the program. This document describes this process.
After obtaining the OTA update package, you can enable the OTA update directly through Andro
1. Ota features
OTA update is a standard software upgrade method provided by the Android system. It is powerful and provides full upgrade and incremental upgrade modes, which can be upgraded through SD card or USB flash disk or through network. Here, we will first study the simplest situation and complete the upgrade through the SD card.2. Compile the full OTA update
Android app check version update, download in the notification bar, update download progress, download complete automatic installation, as follows:
Check the current version number
The Versioncode in the Androidmanifest file is used to identify the version, where the server puts a new version of Apk,versioncode greater than the current version, and
Part I: Disabling the Wuauserv service and turning off UAC (save as Dw10ud.reg) Windows Registry Editor Version 5.00[hkey_local_machine\system\ Controlset001\services\wuauserv] "Start" =dword:4[hkey_local_machine\software\microsoft\windows\currentversion\Policies\system] "EnableLUA" =dword:0 Part Two: Stop wuauserv service and restart (save as Dw10ud.bat) net stop WUAUSERVSHUTDOWN/R/T 0 Part III: Supplement
to create a new Advancedviewsample module with reference to the creation method of the first knowledge ListView.This sample user interface is very simple, and the code for the new program's layout file Activity_main.xml is as follows:XML version= "1.0" encoding= "Utf-8"?>LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_
10 seconds, Server 20 seconds16. What design patterns do you use in your usual development, and can you talk about the usage scenarios of these design patterns? In peacetime, there are more singleton patterns (used when only one object is instantiated in memory), adapter mode (typically the adapter of the ListView and GridView), builder mode (ALERTDIALOG.BUILDER), the observer pattern may be more subtle, In the Android source code baseadapater the im
Original: Android 0 basic Introductory Section 59th: AnalogClock, DigitalClock, and Textclock clock componentsIn the previous issue, we studied DatePicker and Timepicker, which could not fully satisfy our processing of time and date in actual development.If you just want to show the time, without user modification, you can use the DigitalClock and AnalogClock clock components, which are very useful and easy
program.Continue to use the Listviewsample module of the Widgetsample project to create a spinner_layout.xml file in the app/main/res/layout/directory populated with the following code snippet:XML version= "1.0" encoding= "Utf-8"?>LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical"and
" encoding= "Utf-8"?>Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent" > TimepickerAndroid:id= "@+id/timepicker"Android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"android:layout_gravity= "Center_horizontal" />Relativelayout>Create a new Timepickeractivity.java file, load the new layout f
icon for the letter A is displayed.Continue to use the Listviewsample module of the Widgetsample project to create a custom_arrayadapter_layout.xml file in the app/main/res/layout/directory populated with the following code snippet:XML version= "1.0" encoding= "Utf-8"?>LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"android:orientation= "vertical"Android:layout_width= "Match_parent"A
Original: Android 0 Basics 60th: Calendar view CalendarView and timer chronometerThe previous issue studied the AnalogClock, DigitalClock, and Textclock clock components, and this issue continues to learn the Calendar view CalendarView and timer chronometer.First, CalendarViewThe Calendar view (CalendarView) can be used to display and select dates, and users can select either a date or touch to scroll throu
Original: Android 0 Basics section 62nd: Search box Component SearchviewI. Overview of SearchviewSearchview is a search box component that allows the user to enter text within a text box and allows the listener to monitor user input, and to perform an actual search through the listener when the user enters the search by submitting it.Searchview default is to show a search icon, click on the icon to expand t
,
Numberpicker.onvaluechangelistener: Used to listen for changes to the current value.
Numberpicker.onscrolllistener: The scroll state used to listen for the control. The following three states are mainly included:
Scroll_state_touch_scroll: The user presses down and then slides.
Scroll_state_fling: Equivalent to the subsequent slide operation of the Scroll_state_touch_scroll.
Scroll_state_idle:numberpicker is not scrolling.
Numberpicker.formatter: Used
The previous issue studied the AnalogClock, DigitalClock, and Textclock clock components, and this issue continues to learn the Calendar view CalendarView and timer chronometer.First, CalendarViewThe Calendar view (CalendarView) can be used to display and select dates, and users can select either a date or touch to scroll through the calendar. If you want to monitor the date change for that component, you can call CalendarView's Setondatechangelistener () method to add an event listener for this
.
Numberpicker.onscrolllistener: The scroll state used to listen for the control. The following three states are mainly included:
Scroll_state_touch_scroll: The user presses down and then slides.
Scroll_state_fling: Equivalent to the subsequent slide operation of the Scroll_state_touch_scroll.
Scroll_state_idle:numberpicker is not scrolling.
Numberpicker.formatter: Used to format the display of value in the component, such as
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.