導航:首頁 > 源碼編譯 > 天氣源碼下載

天氣源碼下載

發布時間:2022-09-08 18:29:35

1. 誰有 15天天氣預報 源碼 最好是PHP的 或者API介面

你好可以使用中國天氣網的天氣插件 比較好用我就用這個

2. 天氣預報調用源碼

天氣預報調用支持DIY樣式,支持IP顯示天氣!!

http://t.xidie.com/

這里DIY的天氣代碼不但可以放到QQ空間里哦!!裝飾你的個人主頁最佳天氣代碼

多種樣式可供調用!!

支持IP獲取所在用戶城市天氣,也可指用顯示城市天氣!!

天氣預報插件 樣式多,而且在不斷增加中,你也可以上傳自己設計好的背景圖片,做為天氣的背景!!

3. 求一份android 天氣預報的源碼。

我有一個完美運行的 自己寫的

4. 求Android天氣預報的開發源代碼

package com.nrzc.weatherstation;

import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import java.util.Timer;
import java.util.TimerTask;

/**
* 環境感測器
* 氣象站
*/
public class MainActivity extends AppCompatActivity {

private SensorManager sensorManager;
private TextView temperatureTextView;
private TextView pressureTextView;
private TextView lightTextView;

private float currentTemperature=Float.NaN;
private float currentPressure=Float.NaN;
private float currentLight=Float.NaN;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

init();

Timer updateTimer=new Timer("weatherUpdate");
updateTimer.scheleAtFixedRate(new TimerTask() {
@Override
public void run() {
updateGUI();
}
},0,1000);
}

private void init(){
temperatureTextView=(TextView)findViewById(R.id.temperature);
pressureTextView=(TextView)findViewById(R.id.pressure);
lightTextView=(TextView)findViewById(R.id.light);
sensorManager=(SensorManager)getSystemService(Context.SENSOR_SERVICE);

}

private final SensorEventListener tempSensorEventListener=new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
currentTemperature=event.values[0];
}

@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {

}
};

private final SensorEventListener pressureSensorEventListener=new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
currentPressure=event.values[0];
}

@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {

}
};

private final SensorEventListener lightSensorEventListener=new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
currentLight=event.values[0];
}

@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {

}
};

@Override
protected void onResume() {
super.onResume();

Sensor lightSensor=sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
if (lightSensor!=null)
sensorManager.registerListener(lightSensorEventListener,
lightSensor,
SensorManager.SENSOR_DELAY_NORMAL);
else
lightTextView.setText("Light Sensor Unavailable");

Sensor pressureSensor=sensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE);
if (pressureSensor!=null)
sensorManager.registerListener(pressureSensorEventListener,
pressureSensor,SensorManager.SENSOR_DELAY_NORMAL);
else
pressureTextView.setText("Barometer Unavailable");

Sensor temperatureSensor=sensorManager.getDefaultSensor(Sensor.TYPE_AMBIENT_TEMPERATURE);
if (temperatureSensor!=null)
sensorManager.registerListener(tempSensorEventListener,
temperatureSensor,
SensorManager.SENSOR_DELAY_NORMAL);
else
temperatureTextView.setText("Thermometer Unavailable");
}

@Override
protected void onPause() {
sensorManager.unregisterListener(pressureSensorEventListener);
sensorManager.unregisterListener(tempSensorEventListener);
sensorManager.unregisterListener(lightSensorEventListener);
super.onPause();
}

private void updateGUI(){
runOnUiThread(new Runnable() {
@Override
public void run() {
if(!Float.isNaN(currentPressure)){
pressureTextView.setText(currentPressure+"hPa");
pressureTextView.invalidate();
}
if (!Float.isNaN(currentLight)){
String lightStr="Sunny";
if (currentLight<=SensorManager.LIGHT_CLOUDY)
lightStr="night";
else if (currentLight<=SensorManager.LIGHT_OVERCAST)
lightStr="Cloudy";
else if (currentLight<=SensorManager.LIGHT_SUNLIGHT)
lightStr="Overcast";
lightTextView.setText(lightStr);
lightTextView.invalidate();
}

if (!Float.isNaN(currentTemperature)){
temperatureTextView.setText(currentTemperature+"C");
temperatureTextView.invalidate();
}
}
});
}

}

5. 求能運行的基於安卓平台的天氣預報系統源碼!!有設置按多長時間更新和顯示幾日內天氣情況的就行!!!

下載墨跡天氣或者天氣通就可以了

6. ASP天氣預報系統源碼,速求

<%
Response.ContentType="text/html; charset=gb2312"

Call weather()

Sub weather()

url="http://weather.news.qq.com/inc/07_dc107.htm" '莆田的天氣

Call IsObjInstalled("Microsoft.XMLHTTP")

weatherStr= getHTTPPage(url)

if weatherStr="" then
response.write "抱歉,天氣預報載入失敗!"
else
set reg=new Regexp
reg.Multiline=True
reg.Global=false
reg.IgnoreCase=true
reg.Pattern="<td height=""57"" align=""center"" bgcolor=""#EEF3F8"">((.|\n)*?)</td></tr>"

Set matches = reg.execute(weatherStr)
For Each match1 in matches
weatherStr=match1.Value
Next
Set matches = Nothing
Set reg = Nothing

if InStr(weatherStr,"沒有找到與")>0 then
response.write "抱歉,天氣預報載入失敗!"
Else
weatherStr=Replace(weatherStr,"<br>"," ")
%>
<font color="#CC0000" style="font-size: 9pt">今日天氣:<%=weatherStr%></font>
<%
end if

end if

End Sub

'// 採用 Microsoft.XMLHTTP 組件採集數據
Function getHTTPPage(url)
'on error resume next
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
End function

'// 採用 ADODB.Stream 處理採集到的數據,把二進制的文件轉成文本字元
Function Bytes2bStr(vin)
Dim BytesStream,StringReturn
Set BytesStream = Server.CreateObject("ADODB.Stream")
BytesStream.Type = 2
BytesStream.Open
BytesStream.WriteText vin
BytesStream.Position = 0
BytesStream.Charset = "GB2312"
BytesStream.Position = 2
StringReturn =BytesStream.ReadText
BytesStream.close
Set BytesStream = Nothing
Bytes2bStr = StringReturn
End Function

'//檢查組件,採用xmlhttp抓取網頁還是AspHTTP

Function IsObjInstalled(strClassString)
' On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)

If 0 = Err Then
If AspHttpOpen=1 Then
IsObjInstalled = True
Response.write "系統不支持 XMLHTTP 組件"
'Response.write "當前組件 ASPHTTP"
response.end()
Else
IsObjInstalled = False
'Response.write "當前組件 XMLHTTP"
End If
Else
IsObjInstalled = False
'Response.write "當前組件 XMLHTTP"
End If

Set xTestObj = Nothing
Err = 0

End Function
%>

7. 求andriod天氣預報源碼!!可以在eclipse運行的,不要走亂碼的,感激不盡,拜託了聯系方式

這個自己去下載。裡面的天氣介面已經過期,自己去網站申請一下

8. 請問哪裡有MM5(一種天氣預報模擬程序)源代碼下載

'除非你知道天氣預報站點的資料庫的用戶名和密碼。否則只能象我這樣做IE控制項的連接。
'添加Microsoft Internet Controls控制項。在窗口上放WebBrowser、TEXT、COMMAND各一個
'在TEXT里輸入你想查詢的城市的名稱後,點COMMAND就可以顯示了。

Private Sub Command1_Click()
Me.WebBrowser1.Navigate "http://cgi.news.sina.com.cn/cgi-bin/figureWeather/search.cgi?city=" & Me.Text1.Text
End Sub

閱讀全文

與天氣源碼下載相關的資料

熱點內容
卡爾曼濾波演算法書籍 瀏覽:768
安卓手機怎麼用愛思助手傳文件進蘋果手機上 瀏覽:843
安卓怎麼下載60秒生存 瀏覽:802
外向式文件夾 瀏覽:235
dospdf 瀏覽:430
怎麼修改騰訊雲伺服器ip 瀏覽:387
pdftoeps 瀏覽:492
為什麼鴻蒙那麼像安卓 瀏覽:735
安卓手機怎麼拍自媒體視頻 瀏覽:185
單片機各個中斷的初始化 瀏覽:723
python怎麼集合元素 瀏覽:480
python逐條解讀 瀏覽:832
基於單片機的濕度控制 瀏覽:498
ios如何使用安卓的帳號 瀏覽:882
程序員公園采訪 瀏覽:811
程序員實戰教程要多長時間 瀏覽:974
企業數據加密技巧 瀏覽:134
租雲伺服器開發 瀏覽:813
程序員告白媽媽不同意 瀏覽:335
攻城掠地怎麼查看伺服器 瀏覽:600