ABOUT ME

-

  • 안드로이드 버전(Version) String 구하기
    모바일/Development 2016. 8. 17. 19:25
    728x90
    반응형



    text
    PackageInfo pInfo = null; try{ pInfo = getPackageManager().getPackageInfo(getPackageName(), 0); } catch(PackageManager.NameNotFoundException e) { // e.printStackTrace(); } String version = pInfo.versionName;

    <br>

    <!-- System - START --> <div class="revenue_unit_wrap"> <div class="revenue_unit_item adfit"> <div class="revenue_unit_info">728x90</div> <ins class="kakao_ad_area" style="display: none;" data-ad-unit="DAN-r1idmkznxco6" data-ad-width="728px" data-ad-height="90px"></ins> <script type="text/javascript" src="//t1.daumcdn.net/kas/static/ba.min.js" async="async"></script> </div> </div> <!-- System - END --> <script onerror="changeAdsenseToAdfit()" async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9527582522912841" crossorigin="anonymous"></script> <!-- inventory --> <div style="text-align: center"><ins class="kakao_ad_area" style="display:none;margin:50px 0;" data-ad-unit="DAN-HCZEy0KQLPMGnGuC"></ins></div> <script id="adfit_script" type="text/javascript" src="//t1.daumcdn.net/kas/static/ba.min.js" async=""></script> <script> if(window.ObserveAdsenseUnfilledState !== undefined){ ObserveAdsenseUnfilledState(); } </script> <div class="container_postbtn #post_button_group"> <div class="postbtn_like"><script>window.ReactionButtonType = 'reaction'; window.ReactionApiUrl = '//choiseokwon.tistory.com/reaction'; window.ReactionReqBody = { entryId: 136 }</script> <div class="wrap_btn" id="reaction-136" data-tistory-react-app="Reaction"></div><div class="wrap_btn wrap_btn_share"><button type="button" class="btn_post sns_btn btn_share" aria-expanded="false" data-thumbnail-url="https://img1.daumcdn.net/thumb/R800x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F240B514257CEAAC028" data-title="안드로이드 버전(Version) String 구하기" data-description="PackageInfo pInfo = null; try{ pInfo = getPackageManager().getPackageInfo(getPackageName(), 0); } catch(PackageManager.NameNotFoundException e) { // e.printStackTrace(); } String version = pInfo.versionName;" data-profile-image="https://tistory1.daumcdn.net/tistory/1649728/attach/f19e7ff8f683400ba6cceae7d8ffe971" data-profile-name="두뇌미포함" data-pc-url="https://choiseokwon.tistory.com/136" data-relative-pc-url="/136" data-blog-title="STUDY BITS"><span class="ico_postbtn ico_share">공유하기</span></button> <div class="layer_post" id="tistorySnsLayer"></div> </div><div class="wrap_btn wrap_btn_etc" data-entry-id="136" data-entry-visibility="public" data-category-visibility="public"><button type="button" class="btn_post btn_etc2" aria-expanded="false"><span class="ico_postbtn ico_etc">게시글 관리</span></button> <div class="layer_post" id="tistoryEtcLayer"></div> </div></div> <button type="button" class="btn_menu_toolbar btn_subscription #subscribe" data-blog-id="1649728" data-url="https://choiseokwon.tistory.com/136" data-device="web_pc" data-tiara-action-name="구독 버튼_클릭"><em class="txt_state"></em><strong class="txt_tool_id">STUDY BITS</strong><span class="img_common_tistory ico_check_type1"></span></button><div class="postbtn_ccl" data-ccl-type="1" data-ccl-derive="2"> <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.ko" target="_blank" class="link_ccl" rel="license"> <span class="bundle_ccl"> <span class="ico_postbtn ico_ccl1">저작자표시</span> <span class="ico_postbtn ico_ccl2">비영리</span> <span class="ico_postbtn ico_ccl3">변경금지</span> </span> </a> </div> <!-- <rdf:RDF xmlns="https://web.resource.org/cc/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:rdf="https://www.w3.org/1999/02/22-rdf-syntax-ns#"> <Work rdf:about=""> <license rdf:resource="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.ko" /> </Work> <License rdf:about="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.ko"> <permits rdf:resource="https://web.resource.org/cc/Reproduction"/> <permits rdf:resource="https://web.resource.org/cc/Distribution"/> <requires rdf:resource="https://web.resource.org/cc/Notice"/> <requires rdf:resource="https://web.resource.org/cc/Attribution"/> <prohibits rdf:resource="https://web.resource.org/cc/CommercialUse"/> </License> </rdf:RDF> --> <div data-tistory-react-app="SupportButton"></div> </div> <!-- PostListinCategory - START --> <div class="another_category another_category_color_gray"> <h4>'<a href="/category/%EB%AA%A8%EB%B0%94%EC%9D%BC">모바일</a> &gt; <a href="/category/%EB%AA%A8%EB%B0%94%EC%9D%BC/Development">Development</a>' 카테고리의 다른 글</h4> <table> <tbody><tr> <th><a href="/137">안드로이드 원하는 장소 구글 맵으로 열기</a>&nbsp;&nbsp;<span>(0)</span></th> <td>2016.08.17</td> </tr> <tr> <th><a href="/135">안드로이드 String 빈 값("")일 경우</a>&nbsp;&nbsp;<span>(0)</span></th> <td>2016.08.15</td> </tr> <tr> <th><a href="/134">안드로이드 요일 구하기</a>&nbsp;&nbsp;<span>(0)</span></th> <td>2016.08.15</td> </tr> </tbody></table> </div> <!-- PostListinCategory - END -->
    <!-- related_type_view --> <div class="related_type related_type_view"> <h2 class="title_related">관련글 <a href="/category/%EB%AA%A8%EB%B0%94%EC%9D%BC/Development" class="link_add thema_apply">관련글 더보기</a></h2> <ul class="list_related"> <li> <a href="/143?category=25460" class="link_related" style="background-image:url('https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F222BAC4C58513A133B') !important"> <span class="bg"></span> <span class="txt"><strong>Android Widget Update Manually (위젯 수동 업데이트)</strong></span> </a> </li> <li> <a href="/137?category=25460" class="link_related" style="background-image:url('https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F25079A3B57B43C9904') !important"> <span class="bg"></span> <span class="txt"><strong>안드로이드 원하는 장소 구글 맵으로 열기</strong></span> </a> </li> <li> <a href="/135?category=25460" class="link_related" style="background-image:url('https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F237CC84257CEAAD734') !important"> <span class="bg"></span> <span class="txt"><strong>안드로이드 String 빈 값("")일 경우</strong></span> </a> </li> <li> <a href="/134?category=25460" class="link_related" style="background-image:url('https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F2634624457CEAB4E0C') !important"> <span class="bg"></span> <span class="txt"><strong>안드로이드 요일 구하기</strong></span> </a> </li> </ul> </div> <!-- // related_type_view --> <!-- area_comment --> <div class="area_reply"> <div class="box_reply_info"> <a href="#rp" onclick="" class="reply_events"> <p class="item_info">댓글 <span class="thema_apply"> </span></p> </a> <button type="button" class="btn_fold"><span class="blind">댓글 접기</span></button> <button type="button" class="btn_spread" style="display: none;"><span class="blind">댓글 펼치기</span></button> </div> <div data-tistory-react-app="Namecard"></div> </div> <!-- // area_comment -->
    <!-- article_content -->
<!-- // inner_index -->
<!-- aside --> <aside class="sidebar mobile_blind"> <div class="inner_sidebar thema_apply"> <!-- 인기포스트 --> <div class="related_posts"> <div class="related_type related_type_view"> <h2 class="title_related">인기포스트 | (블로그 총 회 방문)</h2> <ul class="list_related"> </ul> </div> </div> </div> </aside> <!-- // aside --> <!-- footer --> <footer id="footer"> </footer> <!-- // footer -->
<!-- // container -->
<!-- // wrap --> <!--HightlightJS --> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script> <script type="text/javascript" src="https://tistory1.daumcdn.net/tistory/1649728/skin/images/vlang.js?_version_=1731481180"></script> <!--<script src="./images/python.js"></script>--> <script src="https://tistory1.daumcdn.net/tistory/1649728/skin/images/highlight.badge.js?_version_=1731481180"></script> <script> hljs.configure({ tabReplace: " ", // 4 spaces }); setTimeout(function () { var pres = document.querySelectorAll("pre>code"); for (var i = 0; i < pres.length; i++) { hljs.highlightBlock(pres[i]); } var options = { loadDelay: 0, copyIconClass: "far fa-clipboard", checkIconClass: "fa fa-check text-success", blogURL: "https://choiseokwon.tistory.com/" }; window.highlightJsBadge(options); },10); </script> <!--Embedly <script async src="//cdn.embedly.com/widgets/platform.js" charset="UTF-8"></script>--> <!--Multilangul--> <script src="https://cdn.jsdelivr.net/npm/multilingual.js@0.1.41/dist/jquery.multilingual.min.js"></script> <script> $(document).ready(function(e){ $(".hljs").multilingual([ "ko" ]); }); </script> <!--MathJax(LaTeX) --> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ "HTML-CSS": { messageStyle: "normal", linebreaks: { automatic: false }, undefinedFamily: "'STIX Two Math', STIXGeneral, 'Arial Unicode MS', 'Noto Serif KR', serif" }, tex2jax: { inlineMath: [["$","$"],["\\(","\\)"]], displayMath: [["$$","$$"],["\\[","\\]"]], processEscapes: true }, TeX: { Macros: { tr: "{\\scriptscriptstyle\\mathrm{T}}", }, extensions: ["AMSmath.js", "AMSsymbols.js", "color.js", "mhchem.js"] } }); </script> <script type="text/javascript" async="" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_HTMLorMML"> </script> <script> //iframe responsive $(".article iframe, .article embed").each(function(index) { var tmpW = $(this).width(); var tmpH = $(this).height(); var ratio = tmpH/tmpW; $(this).wrap('<div class="video-wrap" style="width:'+$(this).width()+'px"></div>').wrap('<div class="video-container" style="padding-bottom:'+ratio*100+'%;"></div>'); }); </script> <script> document.querySelectorAll("code").forEach(function(element) { element.innerHTML = element.innerHTML.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;"); }); </script>