當前位置:首頁 » 編程語言 » 微信java版

微信java版

發布時間: 2022-12-06 15:27:05

① 微信怎麼沒有java版本

目前微信支持IOS、Android、S60V3、S60V5、Windows
Phone五種操作系統的手機,暫不支持JAVA版本

② JAVA手機能用微信嗎

  1. JAVA手機不能使用微信。微信只支持symbian和android等智能系統手機。

  2. 微信支持多種語言,支持Wi-Fi無線區域網、2G,3G和4G移動數據網路,iOS版,Android版、Windows Phone版、Blackberry版、諾基亞S40版、S60V3和S60V5版。
    微信的最新版本:5.2.1(Android)、5.2.0.17(iOS)、4.2(Symbian)、5.1.0.0(Windows Phone 8)、1.5(諾基亞S40)、3.0(BlackBerry)、2.0(BlackBerry 10)。

③ 如何使用微信sdk java版

1.首先我們新建一個Java開發包WeiXinSDK
2.包路徑:com.ansitech.weixin.sdk
測試的前提條件:
假如我的公眾賬號微信號為:vzhanqun
我的伺服器地址為:http://www.vzhanqun.com/
下面我們需要新建一個URL的請求地址

我們新建一個Servlet來驗證URL的真實性,具體介面參考
http://mp.weixin.qq.com/wiki/index.php?title=接入指南

3.新建com.ansitech.weixin.sdk.WeixinUrlFilter.java
這里我們主要是獲取微信伺服器法師的驗證信息,具體驗證代碼如下

[java] view plain print?
package com.ansitech.weixin.sdk;

import com.ansitech.weixin.sdk.util.SHA1;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class WeixinUrlFilter implements Filter {

//這個Token是給微信開發者接入時填的
//可以是任意英文字母或數字,長度為3-32字元
private static String Token = "vzhanqun1234567890";

@Override
public void init(FilterConfig config) throws ServletException {
System.out.println("WeixinUrlFilter啟動成功!");
}

@Override
public void doFilter(ServletRequest req, ServletResponse res,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
//微信伺服器將發送GET請求到填寫的URL上,這里需要判定是否為GET請求
boolean isGet = request.getMethod().toLowerCase().equals("get");
System.out.println("獲得微信請求:" + request.getMethod() + " 方式");
if (isGet) {
//驗證URL真實性
String signature = request.getParameter("signature");// 微信加密簽名
String timestamp = request.getParameter("timestamp");// 時間戳
String nonce = request.getParameter("nonce");// 隨機數
String echostr = request.getParameter("echostr");//隨機字元串
List<String> params = new ArrayList<String>();
params.add(Token);
params.add(timestamp);
params.add(nonce);
//1. 將token、timestamp、nonce三個參數進行字典序排序
Collections.sort(params, new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return o1.compareTo(o2);
}
});
//2. 將三個參數字元串拼接成一個字元串進行sha1加密
String temp = SHA1.encode(params.get(0) + params.get(1) + params.get(2));
if (temp.equals(signature)) {
response.getWriter().write(echostr);
}
} else {
//處理接收消息
}
}

@Override
public void destroy() {

}
}
好了,不過這里有個SHA1演算法,我這里也把SHA1演算法的源碼給貼出來吧!

4.新建com.ansitech.weixin.sdk.util.SHA1.java

[java] view plain print?
/*
* 微信公眾平台(JAVA) SDK
*
* Copyright (c) 2014, Ansitech Network Technology Co.,Ltd All rights reserved.
* http://www.ansitech.com/weixin/sdk/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ansitech.weixin.sdk.util;

import java.security.MessageDigest;

/**
* <p>Title: SHA1演算法</p>
*
* @author qsyang<[email protected]>
*/
public final class SHA1 {

private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};

/**
* Takes the raw bytes from the digest and formats them correct.
*
* @param bytes the raw bytes from the digest.
* @return the formatted bytes.
*/
private static String getFormattedText(byte[] bytes) {
int len = bytes.length;
StringBuilder buf = new StringBuilder(len * 2);
// 把密文轉換成十六進制的字元串形式
for (int j = 0; j < len; j++) {
buf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);
buf.append(HEX_DIGITS[bytes[j] & 0x0f]);
}
return buf.toString();
}

public static String encode(String str) {
if (str == null) {
return null;
}
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA1");
messageDigest.update(str.getBytes());
return getFormattedText(messageDigest.digest());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
5.把這個Servlet配置到web.xml中

[html] view plain print?
<filter>
<description>微信消息接入介面</description>
<filter-name>WeixinUrlFilter</filter-name>
<filter-class>com.ansitech.weixin.sdk.WeixinUrlFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>WeixinUrlFilter</filter-name>
<url-pattern>/api/vzhanqun</url-pattern>
</filter-mapping>
好了,接入的開發代碼已經完成。

6.下面就把地址URL和密鑰Token填入到微信申請成為開發者模式中吧。

④ 微信有JAVA通用版嗎

微信官方沒有JAVA通用版。

微信版本:iOS版、Android版、MAC版、微信電腦插件版(Windows 、Windouws phone 7、Windouws phone 8)、symbian版、BlackBerry版、BlackBerry 10版、series 40版。

(4)微信java版擴展閱讀:

微信版本介紹:

1、微信支持多種語言,Wi-Fi無線區域網,2G,3G和4G移動數據網路,iOS,Android,Windows Phone,Blackberry,諾基亞S40,S60V3和S60V5。

2、相關版本的微信舉例:7.0.4(Android),7.0.4(iOS),4.2(Symbian),5.1.0.0(Windows Phone 8),1.5(Nokia S40),3.0(BlackBerry),2.0( BlackBerry 10)。

3、微信網頁版本:騰訊在微信官方網站上提供了微信網頁版本。 用戶可以登錄微信網頁進行二維碼掃描與好友交流,也可以使用網頁進行文件傳輸。

4、企業微信:2016年3月10日,微信首次正式公布「企業微信」的相關細節,並表示將在未來一兩個月發布,引起企業和用戶的廣泛關注 。 經過一個多月的測試,Android版「企業微信」通過騰訊應用寶正式啟動。

⑤ 能用java做微信二次開發嗎

若是微信提供了sdk,你就比較容易做二次開發了。微信是騰訊的產品,你要做什麼二次開發?java可以開發任意的安卓軟體安卓版的微信沒有任何問題安卓開發就是java語言應用的一個大方向!!別的我就不多說了當然可以用java語言進行微信的二次開發呀

⑥ java系統的手機可以受用微信嗎

不能,微信目前並沒有開發java版微信,而且據說以後也不會開發java版微信.不用等了,還是買個智能機吧,目前智能機也很便宜,就是電池不行.

⑦ 手機微信有java版本么

沒有的,官網上沒的下。
微信是騰訊為智能手機准備的,而智能機的主流系統是android、symbian和IOS。

⑧ 用Java怎麼實現微信支付

具體方法步驟:

一、准備階段:已認證微信號,且通過微信支付認證,這個可以看微信文檔,很詳細,這里就不再重復。

熱點內容
邏輯錯誤預編譯可以檢查出來嗎 發布:2024-04-20 15:58:28 瀏覽:1000
mc中國版伺服器地址 發布:2024-04-20 15:33:13 瀏覽:411
手機修改wifi密碼網站是什麼 發布:2024-04-20 15:22:05 瀏覽:323
js源碼下載 發布:2024-04-20 15:05:16 瀏覽:20
編譯翻譯的區別 發布:2024-04-20 14:55:53 瀏覽:894
登錄之後qq密碼要在哪裡看 發布:2024-04-20 14:55:03 瀏覽:731
天龍多開腳本 發布:2024-04-20 14:53:05 瀏覽:771
同一段代碼編譯的長度不同 發布:2024-04-20 14:24:14 瀏覽:380
緩存美劇權力的游戲 發布:2024-04-20 14:16:52 瀏覽:988
如何刪除word文件保存密碼 發布:2024-04-20 14:15:18 瀏覽:825