okhttp

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val url="http://localhost:8080/kotlin/hello.json"
var client=OkHttpClient()
var request=Request.Builder().url(url).get().build()
client.newCall(request).enqueue(object:Callback{
override fun onFailure(call: Call, e: IOException) {
} override fun onResponse(call: Call, response: Response) {
println("返回的内容是-----------------"+response.body?.string())
}}) // readPage()
}

gson解析json

1.简单测试

MainActivity.kt

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) val string="""{"name":"jack","age":"20","hobbies":{"indoor":"music","outdoor":"basketball"},"other":[{"workin":"baidu","duration":"3years"},{"workin":"google","duration":"1years"}]}""" val gson:Gson= Gson()
try {
val student = gson.fromJson<Student>(string, Student::class.java)
println(student.hobbies?.indoor)
println(student.other[1].workin)
println("解析json成功")
}catch (e:Exception){
println("解析json失败")
} }
}

Student.kt

open class Student {

    //{"name":"jack","age":"20","hobbies":{"indoor":"music","outdoor":"basketball"},"other":[{"workin":"baidu","duration":"3years"},{"workin":"google","duration":"1years"}]}
var name:String?=null
var age:Int?=null
var hobbies:Hobbies?=null
var other= listOf<Other>() }
open class Hobbies() {
var indoor:String?= null
var outdoor:String?=null
} open class Other(){
var workin:String?=null
var duration:String?=null
}

2.解析QQ音乐MV界面返回的json

写这个真心花了好长的时间。。那个发送get请求的url有空再研究下

MainActivity.kt

class MainActivity : AppCompatActivity() ,AnkoLogger{

    override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val url="https://u.y.qq.com/cgi-bin/musicu.fcg?-=mvlib9586712011620675&g_tk=5381&loginUin=0&hostUin=0&format=json&inCharset=utf8&outCharset=utf-8&notice=0&platform=yqq.json&needNewCode=0&data=%7B%22comm%22%3A%7B%22ct%22%3A24%7D%2C%22mv_list%22%3A%7B%22module%22%3A%22MvService.MvInfoProServer%22%2C%22method%22%3A%22GetAllocMvInfo%22%2C%22param%22%3A%7B%22start%22%3A0%2C%22size%22%3A20%2C%22version_id%22%3A7%2C%22area_id%22%3A19%2C%22order%22%3A0%7D%7D%7D&mv_list"
//val url="http://localhost:8080/kotlin/hotel.json"
var client=OkHttpClient()
var request=Request.Builder().url(url).get().build()
client.newCall(request).enqueue(object:Callback{
override fun onFailure(call: Call, e: IOException) {
} override fun onResponse(call: Call, response: Response) {
val gson: Gson= Gson()
try {
val mvListResp=gson.fromJson<MvListResp>(response.body?.string(),MvListResp::class.java)//object:TypeToken<MvListResp>(){}.type
println(mvListResp.mv_list?.data?.list!![0].singers[0].name)
} catch (e: Exception) {
println("解析JSON数据失败")
e.printStackTrace() }
}}) } }

MVListResponse.kt

class MvListResp {
var code: Int? = null
var ts: Long? = null
var mv_list: MvList? = null
} class MvList() {
var code: Int? = null
var data:MvListData?=null
var total: Int? = null
} class MvListData(){
var list= listOf<MvInfo>()
} class MvInfo() {
var comment_cnt: Int? = null
var diff: Int? = null
var duration: Int? = null
var has_fav: Int? = null
var has_star: Int? = null
var mv_switch: Int? = null
var mvid: Int? = null
var picurl: String? = null
var playcnt: Int? = null
var pubdate: Long? = null
var score: Int? = null
var singers = listOf<SingeInfo>()
var star_cnt: Int? = null
var subtitle: String? = null
var title: String? = null
var uploader: Uploader? = null
var vid: String? = null
} class SingeInfo() {
var id: Int? = null
var mid: String? = null
var name: String? = null
var picurl: String? = null
} class Uploader() {
var enc_uin: String? = null
var headurl: String? = null
var nick: String? = null
}

get请求返回json是这么一长串

{"code":0,"ts":1580987499140,"mv_list":{"code":0,"data":{ "list": [ { "comment_cnt": 3472, "diff": 0, "duration": 215, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1589332, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M102002NciZ91bkihl.jpg", "playcnt": 3299374, "pubdate": 1577030400, "score": 0, "singers": [ { "id": 283148, "mid": "004NfJdF0gn6Z1", "name": "Red Velvet (레드벨벳)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004NfJdF0gn6Z1.jpg" } ], "star_cnt": 10082, "subtitle": "", "title": "Red Velvet《Psycho》MV", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "v0033f0aqxz" }, { "comment_cnt": 10069, "diff": 0, "duration": 193, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1517510, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M1010003x77W1X0FA3.jpg", "playcnt": 15624622, "pubdate": 1554307200, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 52452, "subtitle": "", "title": "Kill This Love", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "l0030x5i9ek" }, { "comment_cnt": 2111, "diff": 0, "duration": 209, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1595732, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101000eUr1s1uVAnh.jpg", "playcnt": 269312, "pubdate": 1580140800, "score": 0, "singers": [ { "id": 5675, "mid": "001NJAY04JwuK4", "name": "SUPER JUNIOR (슈퍼주니어)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001NJAY04JwuK4.jpg" } ], "star_cnt": 3686, "subtitle": "", "title": "2YA2YAO!", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "x00339hsdnm" }, { "comment_cnt": 2650, "diff": 0, "duration": 210, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1580456, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M1010005WtQx0DKH4x.jpg", "playcnt": 2769098, "pubdate": 1573660800, "score": 0, "singers": [ { "id": 176744, "mid": "001p5MSX07YGwi", "name": "MAMAMOO (마마무)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001p5MSX07YGwi.jpg" } ], "star_cnt": 9816, "subtitle": "", "title": "HIP", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "u0032piim9h" }, { "comment_cnt": 5164, "diff": 0, "duration": 215, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1474621, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101002LaPiL3SyAOs.jpg", "playcnt": 11125344, "pubdate": 1528992000, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 15351, "subtitle": "", "title": "DDU-DU DDU-DU (뚜두뚜두)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "v00260mpcch" }, { "comment_cnt": 2868, "diff": 0, "duration": 252, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 137284, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M1030015eqbW1zwkBk.jpg", "playcnt": 112053964, "pubdate": 1342454400, "score": 0, "singers": [ { "id": 13143, "mid": "002vbc3A2bv88T", "name": "PSY (朴载相)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000002vbc3A2bv88T.jpg" }, { "id": 10415, "mid": "0040tgjy2qm5bG", "name": "泫雅 (현아)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M0000040tgjy2qm5bG.jpg" } ], "star_cnt": 17357, "subtitle": "", "title": "강남스타일 (Gangnam Style)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "j0015nxvoyg" }, { "comment_cnt": 5225, "diff": 0, "duration": 197, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1578560, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M102003HhoWB1cqsNo.jpg", "playcnt": 3483598, "pubdate": 1572883200, "score": 0, "singers": [ { "id": 10415, "mid": "0040tgjy2qm5bG", "name": "泫雅 (현아)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M0000040tgjy2qm5bG.jpg" } ], "star_cnt": 16658, "subtitle": "", "title": "FLOWER SHOWER", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "l003273bvdk" }, { "comment_cnt": 2953, "diff": 0, "duration": 176, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1495127, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101003wxGgR0cUxSv.jpg", "playcnt": 10662355, "pubdate": 1541952000, "score": 0, "singers": [ { "id": 156564, "mid": "004QK4Dt0N2OX9", "name": "Jennie (제니)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004QK4Dt0N2OX9.jpg" } ], "star_cnt": 25444, "subtitle": "", "title": "SOLO", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "m00284h398b" }, { "comment_cnt": 1249, "diff": 0, "duration": 194, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1592395, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101002IdYdQ2ZZzOx.jpg", "playcnt": 879905, "pubdate": 1578412800, "score": 0, "singers": [ { "id": 940913, "mid": "0029SxgR215af5", "name": "伯贤 (백현)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M0000029SxgR215af5.jpg" } ], "star_cnt": 4356, "subtitle": "", "title": "너를 사랑하고 있어 (《浪漫医生金师傅2》韩国电视剧插曲)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "z0033w2kkzc" }, { "comment_cnt": 3629, "diff": 0, "duration": 216, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1323921, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101000fzlOv4HuKAE.jpg", "playcnt": 9586479, "pubdate": 1498060800, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 7328, "subtitle": "", "title": "As If It's Your Last (마지막처럼)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "m00240pahpk" }, { "comment_cnt": 843, "diff": 0, "duration": 239, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1474945, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101004ECMcc1hXlBu.jpg", "playcnt": 3314792, "pubdate": 1529424000, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 6419, "subtitle": "", "title": "Forever Young (练习室版)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "p0026n6t2m9" }, { "comment_cnt": 9183, "diff": 0, "duration": 191, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1062977, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M1010016ZLE70SvwcL.jpg", "playcnt": 17253074, "pubdate": 1480694400, "score": 0, "singers": [ { "id": 166667, "mid": "002iE9xv2DuIQT", "name": "灿烈 (찬열)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000002iE9xv2DuIQT.jpg" }, { "id": 176687, "mid": "000lHQbb1VAljd", "name": "PUNCH (펀치)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000000lHQbb1VAljd.jpg" } ], "star_cnt": 18130, "subtitle": "", "title": "Stay With Me (《孤单又灿烂的神-鬼怪》韩剧插曲)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "g0022jx5u6w" }, { "comment_cnt": 1386, "diff": 0, "duration": 259, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 79256, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101000c88Ej3pIF7Z.jpg", "playcnt": 29472192, "pubdate": 1322668800, "score": 0, "singers": [ { "id": 37726, "mid": "004DOoCo0hMi1y", "name": "Trouble Maker (트러블메이커)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004DOoCo0hMi1y.jpg" } ], "star_cnt": 5660, "subtitle": "", "title": "Trouble Maker (麻烦制造者)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "f0016e85b12" }, { "comment_cnt": 3704, "diff": 0, "duration": 230, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 917352, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101002nqSlZ0xFMQz.jpg", "playcnt": 9602424, "pubdate": 1470585600, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 4942, "subtitle": "", "title": "휘파람 (WHISTLE) (口哨)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "h00214mr981" }, { "comment_cnt": 1982, "diff": 0, "duration": 195, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1343826, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M102002XpS6f0FBWxF.jpg", "playcnt": 3401572, "pubdate": 1500307200, "score": 0, "singers": [ { "id": 38578, "mid": "001QVwtq3l8cKC", "name": "EXO (엑소)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001QVwtq3l8cKC.jpg" } ], "star_cnt": 7020, "subtitle": "", "title": "Ko Ko Bop (韩文版) (叩叩趴)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "i0029u40k89" }, { "comment_cnt": 639, "diff": 0, "duration": 279, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1589954, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101003Ax7uT1Vmi6f.jpg", "playcnt": 451546, "pubdate": 1577116800, "score": 0, "singers": [ { "id": 14207, "mid": "004Bjyj52RTYOj", "name": "IU (아이유)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004Bjyj52RTYOj.jpg" } ], "star_cnt": 3613, "subtitle": "", "title": "Blueming (Live At 2019 IU Tour Concert 'Love, poem')", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "s0033lji4ma" }, { "comment_cnt": 1939, "diff": 0, "duration": 186, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1595834, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101000EtreD4afOBm.jpg", "playcnt": 59366, "pubdate": 1580313600, "score": 0, "singers": [ { "id": 38578, "mid": "001QVwtq3l8cKC", "name": "EXO (엑소)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001QVwtq3l8cKC.jpg" }, { "id": 198895, "mid": "000xVBxt1xgiyW", "name": "QQ音乐", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000000xVBxt1xgiyW.jpg" } ], "star_cnt": 2733, "subtitle": "", "title": "第29届首尔歌谣大赏QQ音乐最受欢迎K-POP Artist奖: EXO (2020 首尔歌谣大赏)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "r0033sasmup" }, { "comment_cnt": 446, "diff": 0, "duration": 330, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1594591, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101002kMApV4QyioQ.jpg", "playcnt": 264598, "pubdate": 1579190400, "score": 0, "singers": [ { "id": 162691, "mid": "001TpDgn4SxyJn", "name": "BTS (防弹少年团)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001TpDgn4SxyJn.jpg" } ], "star_cnt": 2029, "subtitle": "", "title": "Black Swan (Art Film performed by MN Dance Company)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "u00335is4ma" }, { "comment_cnt": 1888, "diff": 0, "duration": 206, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1499989, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101003SWIpY2dFdux.jpg", "playcnt": 3186092, "pubdate": 1544716800, "score": 0, "singers": [ { "id": 38578, "mid": "001QVwtq3l8cKC", "name": "EXO (엑소)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001QVwtq3l8cKC.jpg" } ], "star_cnt": 11878, "subtitle": "", "title": "Love Shot (Live At Music Bank 2018\/12\/14)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "c0029hx0acq" }, { "comment_cnt": 326, "diff": 0, "duration": 215, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1592451, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M102001iiaqZ0EDYn8.jpg", "playcnt": 225894, "pubdate": 1578412800, "score": 0, "singers": [ { "id": 283148, "mid": "004NfJdF0gn6Z1", "name": "Red Velvet (레드벨벳)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004NfJdF0gn6Z1.jpg" } ], "star_cnt": 1255, "subtitle": "", "title": "Red Velvet《Psycho》Performance Video (舞蹈版)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "s0033u4mq9z" } ], "total": 1000 }}}

可以试着把读取到的数据加载到视图。。

简单的适配

复杂点的适配

关键代码

private var list= ArrayList<MvInfo>()
fun updateList(list:List<MvInfo>){
this.list.clear()
this.list.addAll(list)
notifyDataSetChanged()
}

源码

链接:https://pan.baidu.com/s/1NAtDi6t0fdKQYs26ewNycQ
提取码:rmgo

<kotlin>基础,杂七杂八(亲测有效)的更多相关文章

  1. 推荐几个最好用的CRM软件,本人亲测

    CRM是英文Customer Relationship Management 的简写,一般译作“客户关系管理”.CRM最早产生于美国,由Gartner Group 首先提出的CRM这个概念的.20世纪 ...

  2. Linux 下 将使用Python-Django开发的web应用布置到服务器上(亲测有效)

    写在前面: Django是一个卓越的新一代Web框架,相信使用Python的人对此并不陌生,但将我们完成的web应用布置到到服务器上并不是一件容易的事情. Django详细的教程可以参考http:// ...

  3. myeclipse 9.0 破解方法,亲测可用

    MyEclipse 9.0的破解方法,步骤如下: 1.破解公钥,确保MyEclipse没有开启,否则失败! 用WinRAR打开Common\plugins\com.genuitec.eclipse.c ...

  4. idea插件(mybatis框架下mapper接口快速跳转对应xml文件)亲测好用!

    我相信目前在绝大部分公司里,主要使用的框架是S(spring)S(spring MVC)M(mybatis),其中mybatis总体架构是编写mapper接口,框架扫描其对应的mapper.xml文件 ...

  5. 亲测可用!在线购书系统项目分享(Java)

    项目简介 项目来源于:https://gitee.com/suimz_admin/BookShop 一个基于JSP+Servlet+Jdbc的书店系统.涉及技术少,易于理解,适合JavaWeb初学者学 ...

  6. nginx代理https站点(亲测)

    nginx代理https站点(亲测) 首先,我相信大家已经搞定了nginx正常代理http站点的方法,下面重点介绍代理https站点的配置方法,以及注意事项,因为目前大部分站点有转换https的需要所 ...

  7. C#读取Excel设置(亲测可用)

    OpenFileDialog openFD = new OpenFileDialog(); openFD.FileName = ""; openFD.Filter = " ...

  8. ASP.NET中的文件操作(文件信息,新建,移动,复制,重命名,上传,遍历)(亲测详细)

    做了几天的文件操作,现在来总结一下,错误之处,还望指点!以文件为例,如果对文件夹操作,基本上将File换为Directory即可(例:FileInfo file = new FileInfo(Path ...

  9. linux 系统下开机自动启动oracle 监听和实例 (亲测有效)

    [oracle@oracle11g ~]$ dbstartORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listene ...

  10. IntelliJ13+tomcat+jrebel实现热部署(亲测可用)

       网上有很多介绍intellij idea整合jrebel插件实现热部署的文章,但是有的比较复杂,有的不能成功,最后经过各种尝试,实现了整合,亲测可用!步骤说明如下:   一.先下载jrebel安 ...

随机推荐

  1. OO第四次博客作业(第四单元作业及期末总结)

    (注意:本文写作顺序与作业要求不完全一致,但涵盖了作业的所有要求) 一学期的BUAA特色OO课程结束了. PART 1  我想先写我这一学期的感想 从第一单元满怀期待地写完多项式求值到最后看着60分不 ...

  2. 多个Activity跳转的小结

    第一个例子:demo1 Main—>SecondActivity—>Main 从流程上看就是从Main跳转到SecondActivity,再从SecondActivity返回到Main.也 ...

  3. Linux动静态库

    gcc编译过程 预处理,gcc -E,.c->.i 展开宏和头文件,替换条件编译,删除注释.空白和空行 编译, gcc -S,.i -> .s 检查语法规范 [消耗时间和系统资源最多] 汇 ...

  4. 01 vue入门

    vue简介 官网上有介绍,这里粘出来 Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架.与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用.Vue 的核心 ...

  5. J. Cola

    J. Cola time limit per test 4.0 s memory limit per test 64 MB input standard input output standard o ...

  6. NO13 Linux的基础优化-关闭SELinux功能-Linux的7种运行级别-防火墙设置-中文显示设置

    壹  安装Linux系统后调优及安全设置: 1 关闭SELinux功能: [root@localhost data]# sed 's#SELINUX=enforcing#SELINUX=disable ...

  7. 索尼研发的新主机竟兼容现款PSVR!

    索尼PlayStation研发负责人Dominic Mallinson在接受媒体记者采访时表示,现款PSVR头戴式虚拟现实装置可用于下一代PS主机. 新主机兼容现款PSVR 而且,即便新主机上市也不要 ...

  8. Metasploitable学习(一)

    划红线的是执行语句,对已知的服务器的IP地址进行扫描.嗅探

  9. redis的配置文件介绍

    目录 1.开头说明 2.INCLUDES 3.MODULES 4.NETWORK 5.GENERAL 6.SNAPSHOTTING 7.REPLICATION 8.SECURITY 9.CLIENTS ...

  10. js里事件传播流程

    Javascript与HTML之间的交互是通过事件实现的. 事件,就是文档或浏览器窗口中发生的一些特定的交互瞬间. 可以使用侦听器来预定事件,以便事件发生时执行相应代码. 事件流 JS事件流最早要从I ...