ContentProvider
<ContentProviderBinder name = "name1" dependency = "name2">
<ContentProviderBinder name = "name2">
triggers name1 name2 inquiry after inquiry ended,
name1 name2 queries can use variables.
And if the data changes name2 re-query, it will trigger a re-query name1.
- content provider provides application information query universal interface, define a new xml code to query content provider, and query the binding information to the variables used to display information about third-party applications, as long as third-party applications to provide the corresponding The content provider. For example, you can display weather information, e-mail, to-do, notes, etc., you can also write an application to query any information you want by content provider to provide to the lock screen to use.
<VariableBinders>
<ContentProviderBinder uri = "content: // sample / test" c uriFormat = "" uriParas = "" columns = "col1, col2" where = "" args = "" order = "" countName = "count_name">
<Variable name = "variable_name1" type = "int" column = "col1" row = "0" />
<Variable name = "variable_name2" type = "string" column = "col2" row = "0" />
</ ContentProviderBinder>
</ VariableBinders>
VariableBinders
: the definition of variables to bind to the source, currently only supports content provider.ContentProviderBinder
: Define a content provider and bind to it a source of variableuri
: content provideruri
, which specifies the content provider selectionuriFormat
: Ifuri
need to add a variable, you can use the format, you need to work anduriParas
uriParas
:Text
element of the same formatcolumns
: Column names need to query, separated by commaswhere
: query, with SQLargs
: "where" parameters.order
:sorted
, with SQLcountName
: The number of queries structure is bound to the variable nameVariable
: Given a bind variablename
: variable nametype
: content provider data type:string
/double
/float
/int
/long
column
: variable is bound to the name of the column.row
: number of rows variable is bound to, the default is0
.
<! - Check the weather information from Google News Weather -> <nowiki>
<VariableBinders>
<ContentProviderBinder
uriFormat = "content: //com.google.android.apps.genie.geniewidget.weather/weather/current/%d"
uriParas = "# time_sys"
columns = "iconResId, location, temperature, lowTemperature, highTemperature, description"
countName = "hasweather">
<Variable name = "weather_id" type = "int" column = "iconResId" />
<Variable name = "weather_location" type = "string" column = "location" />
<Variable name = "weather_temperature" type = "int" column = "temperature" />
<Variable name = "weather_lowTemperature" type = "int" column = "lowTemperature" />
<Variable name = "weather_highTemperature" type = "int" column = "highTemperature" />
<Variable name = "weather_description" type = "string" column = "description" />
</ ContentProviderBinder>
</ VariableBinders>
<Nowiki> <-! Display weather information ->
<Text visibility = "# hasweather" x = "240" y = "60" w = "360" size = "24" color = "# FFFFFF" alpha = "200" align = "center" format = "% s% s% d ℃ "paras =" @ weather_location, @ weather_description, # weather_temperature "/>
<Text visibility = "# hasweather * not (isnull (#weather_lowTemperature)) * not (isnull (#weather_highTemperature))" x = "240" y = "85" w = "360" size = "22" color = "# FFFFFF "alpha =" 200 "align =" center "format ="% d ℃ /% d ℃ "paras =" # weather_lowTemperature, # weather_highTemperature "/>
<Text visibility = "# hasweather * isnull (#weather_lowTemperature) * not (isnull (#weather_highTemperature))" x = "240" y = "85" w = "360" size = "22" color = "# FFFFFF" alpha = "200" align = "center" format = "- ℃ /% d ℃" paras = "# weather_highTemperature" />
<Text visibility = "# hasweather * not (isnull (#weather_lowTemperature)) * isnull (#weather_highTemperature)" x = "240" y = "85" w = "360" size = "22" color = "# FFFFFF" alpha = "200" align = "center" format = "% d ℃ / - ℃" paras = "# weather_lowTemperature" />
<Image src = "weather.png" visibility = "# hasweather" x = "240" y = "100" srcid = "# weather_id" align = "center">
<PositionAnimation>
<Position x = "- 10" y = "0" time = "1000" />
<Position x = "10" y = "0" time = "3000" />
<Position x = "0" y = "0" time = "4000" />
</ PositionAnimation>
</ Image>
Weather id list:
weather_chance_of_rain = 2130837536;
weather_chance_snow = 2130837540;
weather_chance_storm = 2130837544;
weather_clear = 2130837556;
weather_cloudy = 2130837560;
weather_flurries = 2130837564;
weather_fog = 2130837568;
weather_heavy_rain = 2130837572;
weather_icy_sleet = 2130837576;
weather_mist = 2130837583;
weather_partly_cloudy = 2130837587;
weather_rain = 2130837600;
weather_snow_rain = 2130837606;
weather_snow = 2130837608;
weather_sunny = 2130837612;
weather_thunderstorm = 2130837617;
weather_unknown = 2130837621;
weather_windy = 2130837626;
Discover MIUI notes content, content and notes show the first modification time ```xml
</ ContentProviderBinder> </ VariableBinders>
**Discover missed call parameters**
```xml
uri = "content: // call_log / calls";
columns = "_id, number"
where = "type = 3 AND new = 1";
WebService
By
Broadcast
BroadcastBinder
: to receive broadcast messages, are<VariableBinders>
, this function allows the interaction between the different modules Variety- You can get to carry the extra broadcast information and updates to the specified variable
- Support Trigger: receiving the broadcast radio, updatable variables can trigger a number of command
<BroadcastBinder name = "" action = ""> <Variable name = "variable_name1" type = "int" extra = "testNum" default = "" /> <Variable name = "variable_name2" type = "string" extra = "testStr" default = "" /> <Trigger> <Command target = "" value = "" /> </ Trigger> </ BroadcastBinder>
action
: Specifies the broadcast namename
: variable nameextra
: broadcast broadcasting extra nametype
: typestring
,int
,integer
,float
,double
,long
Examples
<VariableBinders>
<BroadcastBinder action = "wallpaper_day">
<Variable name = "number" type = "int" default = "1" />
</ BroadcastBinder>
<BroadcastBinder action = "wallpaper_night">
<Trigger>
<VariableCommand name = "number" expression = "2" />
</ Trigger>
</ BroadcastBinder>
</ VariableBinders>
<Image w = "# screen_width" h = "# screen_height" srcExp = "# number + '. Jpg'" />
// Located within the above code Variety wallpaper module, the following code is in the lock screen button trigger module by module corresponding amazing wallpaper function
<Button x = "0" y = "0" w = "# screen_width" h = "640">
<Triggers>
<Trigger action = "down">
<IntentCommand action = "wallpaper_day" broadcast = "true" />
</ Trigger>
</ Triggers>
</ Button>
<Button x = "0" y = "640" w = "# screen_width" h = "640">
<Triggers>
<Trigger action = "down">
<IntentCommand action = "wallpaper_night" broadcast = "true" />
</ Trigger>
</ Triggers>
</ Button>