옵션 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | package com.example.awsmap; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Locale; import android.os.Environment; public class exifInfo { // SDCARD 에 이미지를 가져옵니다. private void ReadSDCard() { List<String> tFileList = new ArrayList<String>(); File f = new File(Environment.getExternalStorageDirectory() .getPath() + "/Pictures/" ); File[] files = f.listFiles(); for (int i = 0; i < files.length; i++) { File file = files[i]; String curFile = file.getPath(); String ext = curFile.substring( curFile.lastIndexOf(".") + 1, curFile.length()).toLowerCase(Locale.KOREA); if (ext.equals("jpg") || ext.equals("gif") || ext.equals("png")){ tFileList.add(file.getPath()); } } } } | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample_activity24); mView = (TextView) findViewById(R.id.textview); String filename = Environment.getExternalStorageDirectory() .getPath() + "/파일명.jpg"; try { ExifInterface exif = new ExifInterface(filename); showExif(exif); } catch (IOException e) { e.printStackTrace(); Toast.makeText(this, "Error!", Toast.LENGTH_LONG).show(); } } | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | private void showExif(ExifInterface exif) { String myAttribute = "[Exif information] \n\n"; myGpsLati = getTagString(ExifInterface.TAG_GPS_LATITUDE, exif); myGpsLong = getTagString(ExifInterface.TAG_GPS_LONGITUDE, exif); } | cs |