Last active
September 20, 2018 10:00
-
-
Save bsscco/76e9b5fc2ea068c592b1ec756e5b5fb2 to your computer and use it in GitHub Desktop.
플레이스토어 앱 버전 가져오기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String newVersion = ""; | |
try { | |
Document document = Jsoup.connect("https://play.google.com/store/apps/details?id=" + cxt.getPackageName()).timeout(5000).get(); | |
if (document != null) { | |
newVersion = document.select(".hAyfc .htlgb").get(7).ownText(); | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
/*가끔 select()를 호출할 때 | |
jsoup의 처리문제인지 앱버전을 담고있는 div를 못찾는 경우가 발생하기 때문에 | |
에러로깅은 하지 않는다*/ | |
} | |
return newVersion; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment