<div class="colorscripter-code" style="color:rgb(1,1,1);overflow:auto;font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;"> <table class="colorscripter-code-table" style="margin:0px;padding:0px;border:;background-color:rgb(250,250,250);" cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:6px;border-right-color:rgb(229,229,229);border-right-width:2px;border-right-style:solid;"> <div style="margin:0px;padding:0px;text-align:right;color:rgb(102,102,102);line-height:130%;font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;"> <div style="line-height:130%;">1</div> <div style="line-height:130%;">2</div> <div style="line-height:130%;">3</div> <div style="line-height:130%;">4</div> <div style="line-height:130%;">5</div> <div style="line-height:130%;">6</div> <div style="line-height:130%;">7</div> <div style="line-height:130%;">8</div> <div style="line-height:130%;">9</div> <div style="line-height:130%;">10</div> <div style="line-height:130%;">11</div> <div style="line-height:130%;">12</div> <div style="line-height:130%;">13</div> <div style="line-height:130%;">14</div> <div style="line-height:130%;">15</div> <div style="line-height:130%;">16</div> <div style="line-height:130%;">17</div> <div style="line-height:130%;">18</div> <div style="line-height:130%;">19</div> <div style="line-height:130%;">20</div> <div style="line-height:130%;">21</div> <div style="line-height:130%;">22</div> <div style="line-height:130%;">23</div> <div style="line-height:130%;">24</div> <div style="line-height:130%;">25</div> <div style="line-height:130%;">26</div> <div style="line-height:130%;">27</div> <div style="line-height:130%;">28</div> <div style="line-height:130%;">29</div> <div style="line-height:130%;">30</div> <div style="line-height:130%;">31</div> <div style="line-height:130%;">32</div> <div style="line-height:130%;">33</div> <div style="line-height:130%;">34</div> <div style="line-height:130%;">35</div> <div style="line-height:130%;">36</div> <div style="line-height:130%;">37</div> <div style="line-height:130%;">38</div> <div style="line-height:130%;">39</div> <div style="line-height:130%;">40</div> <div style="line-height:130%;">41</div> <div style="line-height:130%;">42</div> <div style="line-height:130%;">43</div></div></td> <td style="padding:6px 0px;"> <div style="margin:0px;padding:0px;color:rgb(1,1,1);line-height:130%;font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;"> <div style="padding:0px 6px;line-height:130%;white-space:pre;"><span style="color:rgb(167,29,93);">package</span> com.example.awsmap;</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"><span style="color:rgb(167,29,93);">import</span> java.io.File;</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"><span style="color:rgb(167,29,93);">import</span> java.util.ArrayList;</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"><span style="color:rgb(167,29,93);">import</span> java.util.List;</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"><span style="color:rgb(167,29,93);">import</span> java.util.Locale;</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"><span style="color:rgb(167,29,93);">import</span> android.os.Environment;</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"><span style="color:rgb(167,29,93);">public</span> <span style="color:rgb(167,29,93);">class</span> exifInfo {</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> <span style="color:rgb(153,153,153);">// SDCARD 에 이미지를 가져옵니다.</span></div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> <span style="color:rgb(167,29,93);">private</span> <span style="color:rgb(167,29,93);">void</span> ReadSDCard() {</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> List<span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);"><</span><span style="color:rgb(6,109,226);">String</span><span style="color:rgb(167,29,93);">></span> tFileList <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> <span style="color:rgb(167,29,93);">new</span> ArrayList<span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);"><</span><span style="color:rgb(6,109,226);">String</span><span style="color:rgb(167,29,93);">></span>();</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> File f <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> <span style="color:rgb(167,29,93);">new</span> File(Environment.getExternalStorageDirectory()</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> .getPath() <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">+</span> <span style="color:rgb(99,163,92);">"/Pictures/"</span> );</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> File[] files <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> f.listFiles();</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> <span style="color:rgb(167,29,93);">for</span> (<span style="color:rgb(6,109,226);">int</span> i <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> <span style="color:rgb(0,153,204);">0</span>; i <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);"><</span> files.<span style="color:rgb(6,109,226);">length</span>; i<span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">+</span><span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">+</span>) {</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> File file <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> files[i];</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> <span style="color:rgb(6,109,226);">String</span> curFile <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> file.getPath();</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> <span style="color:rgb(6,109,226);">String</span> ext <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> curFile.<span style="color:rgb(6,109,226);">substring</span>(</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> curFile.<span style="color:rgb(6,109,226);">lastIndexOf</span>(<span style="color:rgb(99,163,92);">"."</span>) <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">+</span> <span style="color:rgb(0,153,204);">1</span>,</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> curFile.<span style="color:rgb(6,109,226);">length</span>()).toLowerCase(Locale.KOREA);</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> <span style="color:rgb(167,29,93);">if</span> (ext.<span style="color:rgb(6,109,226);">equals</span>(<span style="color:rgb(99,163,92);">"jpg"</span>) </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">|</span><span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">|</span> ext.<span style="color:rgb(6,109,226);">equals</span>(<span style="color:rgb(99,163,92);">"gif"</span>) </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">|</span><span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">|</span> ext.<span style="color:rgb(6,109,226);">equals</span>(<span style="color:rgb(99,163,92);">"png"</span>)){</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> tFileList.<span style="color:rgb(6,109,226);">add</span>(file.getPath());</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> }</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> }</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> }</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);">}</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div></div> <div style="text-align:right;font-size:9px;font-style:italic;margin-top:-13px;margin-right:5px;"><a style="color:rgb(229,229,229);text-decoration:none;" href="http://colorscripter.com/info#e" target="_blank">Colored by Color Scripter</a></div></td> <td style="padding:0px 2px 4px 0px;vertical-align:bottom;"><a style="color:#FFFFFF;text-decoration:none;" href="http://colorscripter.com/info#e" target="_blank"><span style="padding:1px;color:#FFFFFF;font-size:9px;background-color:rgb(229,229,229);">cs</span></a></td></tr></tbody></table></div> <div> </div> <div>이 코드로 pictures 폴더 내의 파일 리스트를 tFileList로 저장하는것으로 알고있습니다.</div> <div>지도 위 손가락으로 누른 좌표 위치를 저장하는 변수는 메인액티비티에 있구요.</div> <div>이제 문제는 저기서 불러온 사진들의 좌표위치를 검색하는것과, 좌표위치의 플러스마이너스 5도 씩 이내에 존재하는지 체크를 하려고 하는 것입니다.</div> <div class="colorscripter-code" style="color:rgb(1,1,1);overflow:auto;font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;"> <table class="colorscripter-code-table" style="margin:0px;padding:0px;border:;background-color:rgb(250,250,250);" cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:6px;border-right-color:rgb(229,229,229);border-right-width:2px;border-right-style:solid;"> <div style="margin:0px;padding:0px;text-align:right;color:rgb(102,102,102);line-height:130%;font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;"> <div style="line-height:130%;">1</div> <div style="line-height:130%;">2</div> <div style="line-height:130%;">3</div> <div style="line-height:130%;">4</div> <div style="line-height:130%;">5</div> <div style="line-height:130%;">6</div> <div style="line-height:130%;">7</div> <div style="line-height:130%;">8</div> <div style="line-height:130%;">9</div> <div style="line-height:130%;">10</div> <div style="line-height:130%;">11</div> <div style="line-height:130%;">12</div> <div style="line-height:130%;">13</div> <div style="line-height:130%;">14</div> <div style="line-height:130%;">15</div> <div style="line-height:130%;">16</div> <div style="line-height:130%;">17</div></div></td> <td style="padding:6px 0px;"> <div style="margin:0px;padding:0px;color:rgb(1,1,1);line-height:130%;font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;"> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> <span style="color:rgb(167,29,93);">public</span> <span style="color:rgb(167,29,93);">void</span> onCreate(Bundle savedInstanceState) {</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> <span style="color:rgb(167,29,93);">super</span>.onCreate(savedInstanceState);</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> setContentView(R.layout.activity_sample_activity24);</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> mView <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> (TextView) findViewById(R.id.textview);</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> <span style="color:rgb(6,109,226);">String</span> filename <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> Environment.getExternalStorageDirectory()</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> .getPath() <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">+</span> <span style="color:rgb(99,163,92);">"/파일명.jpg"</span>;</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> <span style="color:rgb(167,29,93);">try</span> {</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> ExifInterface exif <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> <span style="color:rgb(167,29,93);">new</span> ExifInterface(filename);</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> showExif(exif);</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> } <span style="color:rgb(167,29,93);">catch</span> (IOException e) {</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> e.printStackTrace();</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> Toast.makeText(<span style="color:rgb(167,29,93);">this</span>, <span style="color:rgb(99,163,92);">"Error!"</span>, Toast.LENGTH_LONG).show();</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> }</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> }</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div></div> <div style="text-align:right;font-size:9px;font-style:italic;margin-top:-13px;margin-right:5px;"><a style="color:rgb(229,229,229);text-decoration:none;" href="http://colorscripter.com/info#e" target="_blank">Colored by Color Scripter</a></div></td> <td style="padding:0px 2px 4px 0px;vertical-align:bottom;"><a style="color:#FFFFFF;text-decoration:none;" href="http://colorscripter.com/info#e" target="_blank"><span style="padding:1px;color:#FFFFFF;font-size:9px;background-color:rgb(229,229,229);">cs</span></a></td></tr></tbody></table></div> <div class="colorscripter-code" style="color:rgb(1,1,1);overflow:auto;font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;"> <table class="colorscripter-code-table" style="margin:0px;padding:0px;border:;background-color:rgb(250,250,250);" cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:6px;border-right-color:rgb(229,229,229);border-right-width:2px;border-right-style:solid;"> <div style="margin:0px;padding:0px;text-align:right;color:rgb(102,102,102);line-height:130%;font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;"> <div style="line-height:130%;"> </div> <div style="line-height:130%;"> </div> <div style="line-height:130%;">1</div> <div style="line-height:130%;">2</div> <div style="line-height:130%;">3</div> <div style="line-height:130%;">4</div> <div style="line-height:130%;">5</div> <div style="line-height:130%;">6</div> <div style="line-height:130%;">7</div> <div style="line-height:130%;">8</div> <div style="line-height:130%;">9</div> <div style="line-height:130%;">10</div> <div style="line-height:130%;">11</div> <div style="line-height:130%;">12</div> <div style="line-height:130%;">13</div> <div style="line-height:130%;">14</div> <div style="line-height:130%;">15</div> <div style="line-height:130%;">16</div> <div style="line-height:130%;">17</div> <div style="line-height:130%;">18</div></div></td> <td style="padding:6px 0px;"> <div style="margin:0px;padding:0px;color:rgb(1,1,1);line-height:130%;font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;"> <div style="padding:0px 6px;line-height:130%;white-space:pre;"><span style="color:rgb(167,29,93);">private</span> <span style="color:rgb(167,29,93);">void</span> showExif(ExifInterface exif) {</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> <span style="color:rgb(6,109,226);">String</span> myAttribute <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> <span style="color:rgb(99,163,92);">"[Exif information] \n\n"</span>;</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> myGpsLati <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> getTagString(ExifInterface.TAG_GPS_LATITUDE,</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> exif);</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> myGpsLong <span style="color:rgb(0,134,179);"></span><span style="color:rgb(167,29,93);">=</span> getTagString(ExifInterface.TAG_GPS_LONGITUDE,</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> exif);</div> <div style="padding:0px 6px;line-height:130%;white-space:pre;"> </div> <div style="padding:0px 6px;line-height:130%;white-space:pre;background-color:rgb(240,240,240);"> }</div></div> <div style="text-align:right;font-size:9px;font-style:italic;margin-top:-13px;margin-right:5px;"><a style="color:rgb(229,229,229);text-decoration:none;" href="http://colorscripter.com/info#e" target="_blank">Colored by Color Scripter</a></div></td> <td style="padding:0px 2px 4px 0px;vertical-align:bottom;"><a style="color:#FFFFFF;text-decoration:none;" href="http://colorscripter.com/info#e" target="_blank"><span style="padding:1px;color:#FFFFFF;font-size:9px;background-color:rgb(229,229,229);">cs</span></a></td></tr></tbody></table></div> <div> </div> <div>위의 코드는 파일을 지정하는 것이도</div> <div>아래 코드는 사진의 exif정보 중 경도 위도를 구해오는 것입니다.</div> <div> </div> <div>즉 저 세 코드를 혼합하여야 한다는 것인데.. 정말 자바를 배워보지 못한 생초보를 불쌍히 여겨 구원해주실수 있으실까요 ㅠㅠ</div>
정말
책을 
끼고 살아도
모르겠습니다 ㅠㅠ
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.