微信开放平台开发第三方授权登陆(三):Android客户端

article/2025/11/1 12:46:44

微信开放平台开发系列文章:

微信开放平台开发第三方授权登陆(一):开发前期准备

微信开放平台开发第三方授权登陆(二):PC网页端

微信开放平台开发第三方授权登陆(三):Android客户端

微信开放平台开发第三方授权登陆(四):微信公众号

微信开放平台开发第三方授权登陆(五):微信小程序

 

目录​​​​​​​

一、需求

二、开发流程

三、开发使用的技术及工具

四、具体实现步骤

1.前端(Android)

1)Android微信授权登录开发环境配置

2)引导用户点击登录并授权

3)接收微信服务端返回的数据并向服务端发送请求

4)根据服务端返回数据进行解析并显示给前端Android页面

2.服务端(Java)

1).统一返回JSON

2).相关参数配置:

3).请求响应逻辑

4).根据Token获取用户信息:

五、注意事项:

六、应用关键参数位置


当微信开放平台开发第三方授权登陆(一):开发前期准备完成后,已经获取到应用的AppID和AppSecret、且已经成功申请到微信登陆功能。可以进行第三方登陆授权开发。

注意:

目前移动应用上微信登录只提供原生的登录方式,需要用户安装微信客户端才能配合使用

对于Android应用,建议总是显示微信登录按钮,当用户手机没有安装微信客户端时,请引导用户下载安装微信客户端

 

开放平台中创建移动应用时,需要添加包名(一定要和开发的包名完全一致,不能是填写的包名的子包,否则微信无法回调成功)

安装验签工具:Gen_Signature_Android2.apk。

填写包名,然后会生成应用签名,填写应用签名就可以了。

 

一、需求

拥有第三方微信登录功能,并获取到用户信息。

二、开发流程

Android移动应用:(App唤醒微信客户端授权登陆)

1. 应用发起微信授权登录请求,用户允许授权应用后,微信会拉起应用或重定向到第三方网站(服务端),并且带上授权临时票据code参数;

2. 通过code参数加上AppID和AppSecret等,通过API换取access_token;

3. 通过access_token进行接口调用,获取用户基本数据资源或帮助用户实现基本操作。

获取用户基本信息的流程

 

三、开发使用的技术及工具

1、.后端采用IDEA2017 进行开发

2、使用Android Studio 3.1.3 进行开发

3、后端必须基于JDK7以上版本,采用JDK8开发,前端基于Android SDK4.4

4、使用fastJson对json数据进行处理

四、具体实现步骤

1.前端(Android)

目录结构如下:

1)Android微信授权登录开发环境配置

I.添加微信依赖

Android Studio环境

在build.gradle文件中,添加依赖

dependencies {

    compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'

}

dependencies {

    compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'

}

Eclipse环境下:

在工程中新建一个libs目录,将开发工具包中libs目录下的libammsdk.jar复制到该目录中(如下图所示,建立了一个名为SDK_Sample 的工程,并把jar包复制到libs目录下)。

https://res.wx.qq.com/op_res/yXeM-qkPNMo3NZ6AOSZ0x8MqkBf9ATOfaw-2Ic93vUG8xFid8niGKr3W_RfCmMxe

右键单击工程,选择Build Path中的Configure Build Path...,选中Libraries这个tab,并通过Add Jars...导入工程libs目录下的libammsdk.jar文件。(如下图所示)。

https://img-blog.csdnimg.cn/20181225013003776

在需要使用微信终端API的文件中导入相应的类。

import com.tencent.mm.opensdk.openapi.WXTextObject;

 

 

II. AndroidManifest.xml 设置

添加如下权限支持:

    <!--权限声明--><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /><uses-permission android:name="android.permission.READ_PHONE_STATE" /><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

III.若要混淆代码,为保证sdk正常使用,需在配置proguard.cfg(proguard-rule.pro):

# wechat
-keep class com.tencent.mm.opensdk.** {*;}
-keep class com.tencent.wxop.** {*;}
-keep class com.tencent.mm.sdk.** {*;}

2)引导用户点击登录并授权

I.layout.xml

添加button:

        <Buttonandroid:id="@+id/wechat_login_btn"android:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_margin="10dp"android:text="@string/wechat_login"/>

II.监听button点击事件,拉起微信授权页

       findViewById(R.id.wechat_login_btn).setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {if (isWXAppInstalledAndSupported()) {  // 用户是否安装微信客户端// send oauth requestfinal SendAuth.Req req = new SendAuth.Req();req.scope = "snsapi_userinfo";req.state = "none";api.sendReq(req);finish();} else {// TODO: 这里需要引导用户去下载微信客户端Toast.makeText(WXEntryActivity.this, "用户没有安装微信", Toast.LENGTH_SHORT).show();}}});

III.用户手机是否安装微信客户端检查  

  private boolean isWXAppInstalledAndSupported() {IWXAPI msgApi = WXAPIFactory.createWXAPI(this, null);msgApi.registerApp(Constants.APP_ID);boolean sIsWXAppInstalledAndSupported = msgApi.isWXAppInstalled()&& msgApi.isWXAppSupportAPI();return sIsWXAppInstalledAndSupported;}

3)接收微信服务端返回的数据并向服务端发送请求

用户统一授权后,微信会返回数据,需要在.wxapi.WXEntryActivity下对数据进行处理。

I.新建wxapi包(包名固定,且必须是在微信开放平台注册的包名下)

II.新建Activity类,命名为WXEntryActivity

WXEntryActivity,并继承Activity类,实现IWXAPIEventHandler接口的两个方法

public interface IWXAPIEventHandler {void onReq(BaseReq var1);void onResp(BaseResp var1);
}

WXEntryActivity实现

public class WXEntryActivity extends Activity implements IWXAPIEventHandler {

private IWXAPI api;  // 在onCreate中进行了初始化

onReq方法

    // 微信发送请求到第三方应用时,会回调到该方法@Overridepublic void onReq(BaseReq req) {Toast.makeText(this, "Test ", Toast.LENGTH_SHORT).show();switch (req.getType()) {case ConstantsAPI.COMMAND_GETMESSAGE_FROM_WX:break;case ConstantsAPI.COMMAND_SHOWMESSAGE_FROM_WX:break;default:break;}
}

onResp方法

在onResp中需要实现逻辑,微信返回的数据在这里会被接收。

微信返回的数据包含code。在onResp需要实现向服务端发送请求,带上code等参数,后端再通过相应的参数去请求微信服务端,最终将获取到的用户信息返回给前端Android。

// 第三方应用发送到微信的请求处理后的响应结果,会回调到该方法@Overridepublic void onResp(final BaseResp resp) {int result = 0;Toast.makeText(this, "baseresp.getType = " + resp.getType(), Toast.LENGTH_SHORT).show();//成功后发送请求switch (resp.errCode) {case BaseResp.ErrCode.ERR_OK:result = R.string.errcode_success;final String code = ((SendAuth.Resp) resp).code;//需要转换一下才可以new Thread(new Runnable() {@Overridepublic void run() {//向服务端发送请求,预计返回用户信息数据,返回给前端进行显示。String url = "http://p2a3b8.natappfree.cc" +"/wechat/open/callback/android" + "?" +"state=" + "android" +//这里的state需与后端进行探讨"&code=" + code;String str = ApacheHttpUtil.get(url);JSONObject jsonObject = (JSONObject) JSONObject.parse(str);weChatUserInfo = (WeChatUserInfo) JSON.parseObject(jsonObject.get("data").toString(), new TypeReference<WeChatUserInfo>() {});}}).start();while (true) {
// TODO: 这里处理方案不合理,死循环或将造成界面卡死(需要前端优化)if (weChatUserInfo != null) {Intent intent = new Intent(WXEntryActivity.this, WechatUserInfoViewItem.class);/* 通过Bundle对象存储需要传递的数据 */Bundle bundle = new Bundle();bundle.putString("wechatopenid", weChatUserInfo.getOpenid());bundle.putString("wechatnickname", weChatUserInfo.getNickname());bundle.putString("wechatsex", weChatUserInfo.getSex().toString());bundle.putString("wechatprovince", weChatUserInfo.getProvince());bundle.putString("wechatcity", weChatUserInfo.getCity());bundle.putString("wechatcountry", weChatUserInfo.getCountry());bundle.putString("wechatheadimgurl", weChatUserInfo.getHeadimgurl());bundle.putString("wechatprivilege", weChatUserInfo.getPrivilege());bundle.putString("wechatunionid", weChatUserInfo.getOpenid());/*把bundle对象assign给Intent*/intent.putExtras(bundle);startActivity(intent);break;}}break;case BaseResp.ErrCode.ERR_USER_CANCEL:result = R.string.errcode_cancel;   // 发送取消break;case BaseResp.ErrCode.ERR_AUTH_DENIED:result = R.string.errcode_deny;   // 发送被拒绝break;case BaseResp.ErrCode.ERR_UNSUPPORT:result = R.string.errcode_unsupported;  // 不支持错误break;default:result = R.string.errcode_unknown;  // 发送返回break;}Toast.makeText(this, result, Toast.LENGTH_LONG).show();}

重写onNewIntent方法

在WXEntryActivity中将接收到的intent及实现了IWXAPIEventHandler接口的对象传递给IWXAPI接口的handleIntent方法,

    @Overrideprotected void onNewIntent(Intent intent) {super.onNewIntent(intent);setIntent(intent);api.handleIntent(intent, this);}

III.在manifest文件添加WXEntryActivity,并加上exported属性,设置为true,:

        <activityandroid:name=".wxapi.WXEntryActivity"android:exported="true"android:label="@string/app_name"android:launchMode="singleTask"><!--android:launchMode="singleTop">--><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter><intent-filter><action android:name="android.intent.action.VIEW" /><category android:name="android.intent.category.DEFAULT" /><data android:scheme="sdksample" /></intent-filter></activity>

4)根据服务端返回数据进行解析并显示给前端Android页面

获取数据已经跳转代码如上(onResp方法中)。需要前端优化处理

public class WechatUserInfoViewItem extends FragmentActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.wechat_user_info);Bundle bundle = this.getIntent().getExtras();TextView wechatopenid = (TextView) findViewById(R.id.wechatopenid);wechatopenid.setText(bundle.getString("wechatopenid"));TextView wechatnickname = (TextView) findViewById(R.id.wechatnickname);wechatnickname.setText(bundle.getString("wechatnickname"));TextView wechatsex = (TextView) findViewById(R.id.wechatsex);wechatsex.setText(bundle.getString("wechatsex"));TextView wechatprovince = (TextView) findViewById(R.id.wechatprovince);wechatprovince.setText(bundle.getString("wechatprovince"));TextView wechatcity = (TextView) findViewById(R.id.wechatcity);wechatcity.setText(bundle.getString("wechatcity"));TextView wechatcountry = (TextView) findViewById(R.id.wechatcountry);wechatcountry.setText(bundle.getString("wechatcountry"));TextView wechatunionid = (TextView) findViewById(R.id.wechatunionid);wechatunionid.setText(bundle.getString("wechatunionid"));}
}

布局xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical"><ImageViewandroid:id="@+id/wechatheadimgurl"android:layout_width="200dp"android:layout_height="100dp"android:scaleType="center"/><!--用户特权信息,json 数组,如微信沃卡用户为(chinaunicom)[这里是一个list]--><!--String privilege;--><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="openid:"tools:layout_editor_absoluteX="158dp"tools:layout_editor_absoluteY="216dp" /><TextViewandroid:id="@+id/wechatopenid"android:layout_width="wrap_content"android:layout_height="wrap_content"tools:layout_editor_absoluteX="158dp"tools:layout_editor_absoluteY="216dp" /></LinearLayout><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="unionid:"tools:layout_editor_absoluteX="158dp"tools:layout_editor_absoluteY="216dp" /><TextViewandroid:id="@+id/wechatunionid"android:layout_width="wrap_content"android:layout_height="wrap_content"tools:layout_editor_absoluteX="158dp"tools:layout_editor_absoluteY="216dp" /></LinearLayout><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="用户昵称:"tools:layout_editor_absoluteX="158dp"tools:layout_editor_absoluteY="216dp" /><TextViewandroid:id="@+id/wechatnickname"android:layout_width="wrap_content"android:layout_height="wrap_content"tools:layout_editor_absoluteX="85dp"tools:layout_editor_absoluteY="212dp" /></LinearLayout><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="用户城市:"tools:layout_editor_absoluteX="158dp"tools:layout_editor_absoluteY="216dp" /><TextViewandroid:id="@+id/wechatcity"android:layout_width="wrap_content"android:layout_height="wrap_content"tools:layout_editor_absoluteX="118dp"tools:layout_editor_absoluteY="302dp" /></LinearLayout><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="用户性别:"tools:layout_editor_absoluteX="158dp"tools:layout_editor_absoluteY="216dp" /><TextViewandroid:id="@+id/wechatsex"android:layout_width="wrap_content"android:layout_height="wrap_content"tools:layout_editor_absoluteX="118dp"tools:layout_editor_absoluteY="302dp" /></LinearLayout><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="省份:"tools:layout_editor_absoluteX="158dp"tools:layout_editor_absoluteY="216dp" /><TextViewandroid:id="@+id/wechatprovince"android:layout_width="wrap_content"android:layout_height="wrap_content"tools:layout_editor_absoluteX="118dp"tools:layout_editor_absoluteY="302dp" /></LinearLayout><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="国家:"tools:layout_editor_absoluteX="158dp"tools:layout_editor_absoluteY="216dp" /><TextViewandroid:id="@+id/wechatcountry"android:layout_width="wrap_content"android:layout_height="wrap_content"tools:layout_editor_absoluteX="118dp"tools:layout_editor_absoluteY="302dp" /></LinearLayout>
</LinearLayout>

2.服务端(Java)

服务端需要做的是:接受Android前端发送的请求,获取code,根据AppId和APPSecret等向微信服务端发送请求,然后获取到Token,再根据Token获取到用户基本信息。最终通过JSON的方式返回给前端。

1).统一返回JSON

@Getter @Setter
public class Result<T> {private int code;private String msg;private T data;/*** 成功时候的调用* */public static <T> Result<T> success(T data){return new  Result<T>(data);}/*** 失败时候的调用* */public static <T> Result<T> error(CodeMsg cm){return new  Result<T>(cm);}private Result(T data) {this.code = 0;this.msg = "success";this.data = data;}private Result(CodeMsg cm) {if(cm == null) {return;}this.code = cm.getCode();this.msg = cm.getMsg();}
}

 

2).相关参数配置:

# 微信开放平台Android

wechat.open.android.appid =

wechat.open.android.appsecret =

 

3).请求响应逻辑

@ResponseBody@RequestMapping("/callback/android")public Result openWeChatCallback(HttpServletRequest httpServletRequest) {String code = httpServletRequest.getParameter("code");//String state = httpServletRequest.getParameter("state"); // TODO:String url = null;url = "https://api.weixin.qq.com/sns/oauth2/access_token?" +"appid=" +env.getProperty("wechat.open.android.appid").trim() +"&secret=" +env.getProperty("wechat.open.android.appsecret").trim() +"&code=" +code +"&grant_type=authorization_code";JSONObject wechatAccessToken = HttpClientUtils.httpGet(url);if (wechatAccessToken.get("errcode") != null) {return Result.error(CodeMsg.FAIL_GETTOKEN);}String accessToken = (String) wechatAccessToken.get("access_token");String openid = (String) wechatAccessToken.get("openid");String unionid = (String) wechatAccessToken.get("unionid");if (StringUtils.isEmpty(accessToken) || StringUtils.isEmpty(openid) || StringUtils.isEmpty(unionid)) {return Result.error(CodeMsg.FAIL_GETTOKEN);}// TODO:根据Openid或Unionid对数据库进行查询,如果查询到对应的用户数据,则不需要再向微信服务器发送请求去返回数据。// TODO: 建议使用Unionid作为查询条件。WeChatUserInfo weChatUserInfo = null;wechatAccessToken = null;  // FIXME: 这里应该是从数据库中查询获取用户信息逻辑。if (wechatAccessToken == null) {// 新用户weChatUserInfo = getUserInfoByAccessToken(accessToken);// 数据库插入的操作}if (weChatUserInfo != null) {return Result.success(weChatUserInfo);}return Result.error(CodeMsg.FAIL_GETUSERINFO);}

4).根据Token获取用户信息:

/*** 根据accessToken获取用户个人公开信息** @param accessToken* @return*/private WeChatUserInfo getUserInfoByAccessToken(String accessToken) {if (StringUtils.isEmpty(accessToken)) {return null;  //"accessToken为空";}String get_userInfo_url = "https://api.weixin.qq.com/sns/userinfo?" +"access_token=" +accessToken +"&openid=" +env.getProperty("wechat.open.android.appid").trim();String userInfo_result = HttpClientUtils.httpGet(get_userInfo_url, "utf-8");if (!userInfo_result.equals("errcode")) {WeChatUserInfo weChatUserInfo = JSON.parseObject(userInfo_result, new TypeReference<WeChatUserInfo>() {});// TODO: 需要把头像信息下载到文件服务器,然后替换掉头像URL。微信的或许不可靠,假设微信用户更换了头像,旧头像URL是否会保存?而这个URL信息却存放在我们的数据库中,不可靠return weChatUserInfo;}return null;  //"获取用户信息失败"}

五、注意事项:

1.Android4.0以上版本,发送网络请求时,必须是以线程异步的方式发送请求,否则发送请求会失败。

六、应用关键参数位置

 


http://chatgpt.dhexx.cn/article/m6cacWXN.shtml

相关文章

微信开放平台开发第三方授权登陆(二):PC网页端

微信开放平台开发系列文章&#xff1a; 微信开放平台开发第三方授权登陆&#xff08;一&#xff09;&#xff1a;开发前期准备 微信开放平台开发第三方授权登陆&#xff08;二&#xff09;&#xff1a;PC网页端 微信开放平台开发第三方授权登陆&#xff08;三&#xff09;&a…

.md文件用什么软件打开

记事本-------体验感差 效果&#xff1a; Notepad 毫无疑问的完胜记事本 官网下载地址&#xff1a;https://notepad-plus.en.softonic.com/download &#xff08;下载速度比较慢&#xff09; 这是百度网盘&#xff1a;&#xff08;会快一点点&#xff09; 链接&#xff1a;ht…

md文件打开方式推荐

MD文件介绍 以下介绍来自于百度&#xff1a; md文件是Markdown语法编写的文件&#xff0c;Markdown是一款轻量级的标记语言&#xff0c;可以使用语法来代替排版&#xff0c;插入公式和图片等都非常的容易&#xff0c;目前很多博客都可以使用该语法去编辑。使用Markdown的好处…

md文件如何打开?

阅读md文件时 常常会手足无措 今天教大家如何打开md文件 当在阅览md文件时&#xff0c;一般系统默认是记事本&#xff1a; 阅览效果极其不佳且编辑体验极差&#xff01; 今天推荐一款软件&#xff1a;Typora 直接上链接&#xff1a;下载地址&#xff08;官网&#xff09; …

Windows下右键新建.md文件教程(转)

Windows下右键新建.md文件教程 转载自Keavnn’Blog&#xff0c;并有些许修正 原本创建.md文件需要首先打开markdown文本编辑器&#xff0c;如Typora&#xff0c;或者新建.txt文件然后修改后缀名&#xff0c;本文介绍了如何在Windows操作系统中添加右键创建.md文件的方法。 环…

md文件使用

这里写自定义目录标题 欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题&#xff0c;有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants 创建一个自定义列表如何创建一个…

如何编写md格式的文档、vscode中写.md文件的插件推荐

目录 1. 标题 2. 字体 3. 引用 4. 分割线 5. 图片 6. 超链接 7. 无序列表 8. 有序列表 9. 列表嵌套 10. 表格 11.代码 12. vscode中写.md文件的插件推荐 .md格式的文章可以用编辑器Markdown打开&#xff0c;Markdown是一种纯文本格式的标记语言。通过简单的标记语法…

md文件转换成word文档

md文件转成word文档 Typora导出word文件时需要先下载pandoc Typora导出word文件时因为文档里面有表格&#xff0c;导出失败&#xff0c;所以先使用使用pandoc命令导出无边框表格的word 1.在xxx.md所在文件夹打开命令提示符 2.在命令提示符输入&#xff1a;pandoc -s xxxx.md …

.md文件以及markdown语法书写md文档

.md文件以及markdown语法书写md文档 1. .md文件如何打开2. markdown是什么&#xff1f;2.1 markdown用来干嘛&#xff1f;2.2 怎样书写和读取markdown&#xff1f; 3. markdown语法3.1 基本符号3.2 标题&#xff08;从大到小取决于#号的数量&#xff09;3.3 正文3.4 段落3.5 字…

md文档的阅读查看

前言&#xff1a; md文档可以用vscode看&#xff0c;也可以直接拖入浏览器看&#xff0c;但看起来不太好看&#xff0c;效果如下&#xff1a; 改进方法&#xff1a; 方法1、假如你的电脑安装了node.js &#xff08;1&#xff09;判断是否安装&#xff1a;WindowsR&#xff0…

如何将md文件完美转化为 PDF?

今天在网上搜kali相关教程时&#xff0c;无意中找到一本很好的教程&#xff0c;但是它是以*.md的文件形式放在github上&#xff0c;我试了将原文件zip下载到本地&#xff0c;但怎么能将.md文件转成PDF文件呢&#xff1f;&#xff08;如果你用Visual Studio code, 那么安装Markd…

如何编写.md格式文件?

文章目录 如何编写.md格式文件&#xff1f;1.标题2.字体3.插入图片操作4.不带快捷键Markdown书写操作5.Markdown拓展功能6.主题替换 如何编写.md格式文件&#xff1f; md即markdown&#xff0c;百度的解释&#xff1a;Markdown是一种可以使用普通文本编辑器编写的标记语言&…

加载.md文件

webpack是不能直接加载.md文件的&#xff0c;但是一些博客或者文章指导类的内容通过markdown进行编辑管理是比较常见的&#xff0c;这就需要我们进行一些配置&#xff0c;使webpack能够加载.md文件&#xff0c;并将文件内容展示到网页上。 1、先写一个md加载器 在这之前&…

.md文件的打开

今天终于知道.md文件是markdown格式的了&#xff0c; windows下可以安装markdownpad来打开md文件&#xff1a; http://blog.csdn.net/github_35160620/article/details/52158604 ubuntu下则可安装retext&#xff0c;查看时 retext xxx.md即可 例子&#xff1a; ubuntu下&…

pdf文件转为md文件

针对Windows 方法一&#x1f4a1; 下载Pandoc 由于Pandoc不支持PDF直接转为md形式&#xff0c;先将PDF文档转换为Word形式&#xff0c;再使用Typora将你的Word文件导入。 途径 1 &#xff1a; \textcolor{green}{途径1&#xff1a;} 途径1&#xff1a;&#x1f528; 官网下载…

md文件的相关使用

天已雪&#xff0c;一杯否&#xff1f; —— 南风落尽 前言 因为天冷&#xff0c;已经很久没有更新博客了&#xff0c;想了想&#xff0c;还是决定写一篇水文&#xff0c;一是促使自己记得写文章&#xff0c;二是记录自己平时学到的杂七杂八的东西&#xff0c;免得忘了又到处…

md是什么类型的文件?怎么打开md文件,Markdown的编写,Markdown转化为html

md 就是 Markdown 的文件&#xff0c;Markdown 是一种轻量级标记语言。CSDN 的博客就是用 markdown 来编写的呢&#xff01;html 大家不陌生吧&#xff0c;他是超文本标记语言&#xff0c;他们都是标记语言&#xff0c;那有什么区别呢&#xff1f; html 要比 Markdown 复杂很多…

md文件用什么打开

如果想要阅读本地的.md文件&#xff0c;又懒得下markdown笔记软件或者电脑上内存紧张的话&#xff0c;一个好方法就是在电脑浏览器里面添加相关的markdown阅读插件&#xff0c;以Win10自带的Edge浏览器为例&#xff1a; Chrome浏览器类似 Microsoft Edge AddonsMake Microsoft …

win10打开.md文件

工具/原料 DELL 台式机 Windows 10 Microsoft Edge103.0.1264.49 方法/步骤 1 从网络上下载一些技术文档&#xff0c;有些通常是以md后缀格式提供的&#xff0c;这是一种MarkDown语言格式的文档&#xff0c;有时下载MarDown编辑器仍然会无法正常显示&#xff0c;如下图所示&…

如何将.md文件转换为pdf

目录 1.step1&#xff1a; 安装Visual Studio Code&#xff08;简称VScode&#xff09; 2.step2&#xff1a; 安装定制化插件 3.step3&#xff1a; 进入预览窗口模式 4.step4&#xff1a; 进行格式转换 1.step1&#xff1a; 安装Visual Studio Code&#xff08;简称VScode&a…