├── README.md ├── libs ├── jxl.jar └── android-support-v4.jar ├── bin ├── classes.dex ├── resources.ap_ ├── android-object-recog.apk ├── android-object-recog.jar ├── classes │ ├── org │ │ └── opencv │ │ │ ├── R.class │ │ │ ├── R$id.class │ │ │ ├── R$attr.class │ │ │ └── R$styleable.class │ └── com │ │ └── android_object_recog │ │ ├── R.class │ │ ├── R$id.class │ │ ├── R$attr.class │ │ ├── R$layout.class │ │ ├── R$menu.class │ │ ├── R$string.class │ │ ├── R$style.class │ │ ├── R$drawable.class │ │ ├── BuildConfig.class │ │ ├── MainActivity.class │ │ ├── R$styleable.class │ │ ├── MainActivity$1.class │ │ ├── MainActivity$2.class │ │ ├── MainActivity$3.class │ │ ├── MainActivity$4.class │ │ ├── MainActivity$2$1.class │ │ ├── MainActivity$2$2.class │ │ ├── MainActivity$4$1.class │ │ ├── object_recog │ │ ├── Utilities.class │ │ ├── Utilities$1.class │ │ ├── MatchingStrategy.class │ │ └── ObjectRecognizer.class │ │ ├── MainActivity$TTSInitListener.class │ │ └── MainActivity$EditViewRunnable.class ├── jarlist.cache ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-ldpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ └── drawable-xhdpi │ │ └── ic_launcher.png ├── dexedLibs │ ├── jxl-c512d41d7587ef97739d87b490a88a5d.jar │ ├── android-support-v4-6d59991163415349ceba181cd6ce7a09.jar │ ├── android-support-v4-c3a3a030300599281961cfe473f238d0.jar │ ├── androidtouchgallery-a16bd5778a2e9ee48356bd36aa5f5500.jar │ ├── opencv library - 2.4.5-c1de0c296a011ce3c3a1567f92b5b758.jar │ └── opencv library - 2.4.7.1-4d9ba55bf22955823f30bb7a7c8f3349.jar ├── R.txt └── AndroidManifest.xml ├── res ├── menu │ └── activity_main.xml ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-ldpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── values │ ├── strings.xml │ └── styles.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml └── layout │ └── activity_main.xml ├── ic_launcher-web.png ├── src └── com │ └── android_object_recog │ ├── object_recog │ ├── MatchingStrategy.java │ ├── Utilities.java │ └── ObjectRecognizer.java │ └── MainActivity.java ├── gen ├── com │ └── android_object_recog │ │ ├── BuildConfig.java │ │ └── R.java └── org │ └── opencv │ └── R.java ├── project.properties ├── proguard-project.txt └── AndroidManifest.xml /README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libs/jxl.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/libs/jxl.jar -------------------------------------------------------------------------------- /bin/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes.dex -------------------------------------------------------------------------------- /bin/resources.ap_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/resources.ap_ -------------------------------------------------------------------------------- /res/menu/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/ic_launcher-web.png -------------------------------------------------------------------------------- /bin/android-object-recog.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/android-object-recog.apk -------------------------------------------------------------------------------- /bin/android-object-recog.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/android-object-recog.jar -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/libs/android-support-v4.jar -------------------------------------------------------------------------------- /bin/classes/org/opencv/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/org/opencv/R.class -------------------------------------------------------------------------------- /bin/classes/org/opencv/R$id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/org/opencv/R$id.class -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/classes/org/opencv/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/org/opencv/R$attr.class -------------------------------------------------------------------------------- /bin/jarlist.cache: -------------------------------------------------------------------------------- 1 | # cache for current jar dependecy. DO NOT EDIT. 2 | # format is 3 | # Encoding is UTF-8 4 | -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/classes/org/opencv/R$styleable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/org/opencv/R$styleable.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/R.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/R$id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/R$id.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/R$attr.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/R$layout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/R$layout.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/R$menu.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/R$menu.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/R$string.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/R$string.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/R$style.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/R$style.class -------------------------------------------------------------------------------- /src/com/android_object_recog/object_recog/MatchingStrategy.java: -------------------------------------------------------------------------------- 1 | package com.android_object_recog.object_recog; 2 | 3 | public enum MatchingStrategy { 4 | RATIO_TEST 5 | } 6 | -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/R$drawable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/R$drawable.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/BuildConfig.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/R$styleable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/R$styleable.class -------------------------------------------------------------------------------- /bin/dexedLibs/jxl-c512d41d7587ef97739d87b490a88a5d.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/dexedLibs/jxl-c512d41d7587ef97739d87b490a88a5d.jar -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity$1.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity$2.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity$3.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity$4.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity$2$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity$2$1.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity$2$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity$2$2.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity$4$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity$4$1.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/object_recog/Utilities.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/object_recog/Utilities.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/object_recog/Utilities$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/object_recog/Utilities$1.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity$TTSInitListener.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity$TTSInitListener.class -------------------------------------------------------------------------------- /bin/dexedLibs/android-support-v4-6d59991163415349ceba181cd6ce7a09.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/dexedLibs/android-support-v4-6d59991163415349ceba181cd6ce7a09.jar -------------------------------------------------------------------------------- /bin/dexedLibs/android-support-v4-c3a3a030300599281961cfe473f238d0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/dexedLibs/android-support-v4-c3a3a030300599281961cfe473f238d0.jar -------------------------------------------------------------------------------- /bin/dexedLibs/androidtouchgallery-a16bd5778a2e9ee48356bd36aa5f5500.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/dexedLibs/androidtouchgallery-a16bd5778a2e9ee48356bd36aa5f5500.jar -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/MainActivity$EditViewRunnable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/MainActivity$EditViewRunnable.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/object_recog/MatchingStrategy.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/object_recog/MatchingStrategy.class -------------------------------------------------------------------------------- /bin/classes/com/android_object_recog/object_recog/ObjectRecognizer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/com/android_object_recog/object_recog/ObjectRecognizer.class -------------------------------------------------------------------------------- /bin/dexedLibs/opencv library - 2.4.5-c1de0c296a011ce3c3a1567f92b5b758.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/dexedLibs/opencv library - 2.4.5-c1de0c296a011ce3c3a1567f92b5b758.jar -------------------------------------------------------------------------------- /bin/dexedLibs/opencv library - 2.4.7.1-4d9ba55bf22955823f30bb7a7c8f3349.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/dexedLibs/opencv library - 2.4.7.1-4d9ba55bf22955823f30bb7a7c8f3349.jar -------------------------------------------------------------------------------- /gen/com/android_object_recog/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.android_object_recog; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Android Object Recognition 5 | Settings 6 | Object Recognizer 7 | 8 | -------------------------------------------------------------------------------- /res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-17 15 | android.library.reference.1=../OpenCV Library - 2.4.5 16 | android.library=false 17 | -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /bin/R.txt: -------------------------------------------------------------------------------- 1 | int attr camera_id 0x7f010001 2 | int attr show_fps 0x7f010000 3 | int drawable ic_launcher 0x7f020000 4 | int id any 0x7f040000 5 | int id back 0x7f040001 6 | int id cameraView 0x7f040005 7 | int id detectedObjTextView 0x7f040006 8 | int id front 0x7f040002 9 | int id scrollLinearLayout 0x7f040004 10 | int id scrollView 0x7f040003 11 | int layout activity_main 0x7f030000 12 | int menu activity_main 0x7f070000 13 | int string app_name 0x7f050000 14 | int string menu_settings 0x7f050001 15 | int string title_activity_main 0x7f050002 16 | int style AppBaseTheme 0x7f060000 17 | int style AppTheme 0x7f060001 18 | int[] styleable CameraBridgeViewBase { 0x7f010000, 0x7f010001 } 19 | int styleable CameraBridgeViewBase_camera_id 1 20 | int styleable CameraBridgeViewBase_show_fps 0 21 | -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /gen/org/opencv/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | package org.opencv; 8 | 9 | public final class R { 10 | public static final class id { 11 | public static final int back = 0x7f040001; 12 | public static final int front = 0x7f040002; 13 | public static final int any = 0x7f040000; 14 | } 15 | public static final class styleable { 16 | public static final int[] CameraBridgeViewBase = { 0x7f010000, 0x7f010001 }; 17 | public static final int CameraBridgeViewBase_camera_id = 1; 18 | public static final int CameraBridgeViewBase_show_fps = 0; 19 | } 20 | public static final class attr { 21 | public static final int camera_id = 0x7f010001; 22 | public static final int show_fps = 0x7f010000; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 17 | 20 | 23 | 26 | 27 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 17 | 20 | 23 | 26 | 27 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/com/android_object_recog/object_recog/Utilities.java: -------------------------------------------------------------------------------- 1 | package com.android_object_recog.object_recog; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.FileOutputStream; 6 | import java.io.FilenameFilter; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | import java.io.OutputStream; 10 | import java.util.ArrayList; 11 | import java.util.Arrays; 12 | 13 | import org.opencv.core.Mat; 14 | import org.opencv.core.Size; 15 | import org.opencv.highgui.Highgui; 16 | import org.opencv.imgproc.Imgproc; 17 | 18 | public class Utilities { 19 | 20 | public static ArrayList getJPGFiles(File dir) { 21 | File[] files = dir.listFiles(new FilenameFilter() { 22 | @Override 23 | public boolean accept(File file, String name) { 24 | return name.endsWith(".jpg"); 25 | } 26 | }); 27 | 28 | Arrays.sort(files); 29 | ArrayList jpgFiles = new ArrayList(); 30 | 31 | for (File file : files) { 32 | jpgFiles.add(file); 33 | } 34 | 35 | return jpgFiles; 36 | } 37 | 38 | public static ArrayList getImageMats(ArrayList imageFiles) { 39 | ArrayList imageMats = new ArrayList(); 40 | 41 | for (File image : imageFiles) { 42 | Mat fullSizeTrainImg = Highgui.imread(image.getPath()); 43 | Mat resizedTrainImg = new Mat(); 44 | Imgproc.resize(fullSizeTrainImg, resizedTrainImg, new Size(640, 480), 0, 0, Imgproc.INTER_CUBIC); 45 | imageMats.add(resizedTrainImg); 46 | } 47 | 48 | return imageMats; 49 | } 50 | 51 | public static ArrayList getFileNames(ArrayList imageFiles) { 52 | ArrayList fileNames = new ArrayList(); 53 | 54 | for (File image : imageFiles) { 55 | fileNames.add(image.getName().substring(0, image.getName().lastIndexOf("."))); 56 | } 57 | 58 | return fileNames; 59 | } 60 | 61 | public static void copyFile(File src, File dst) throws IOException { 62 | InputStream inputStream = new FileInputStream(src); 63 | OutputStream outputStream = new FileOutputStream(dst); 64 | 65 | byte[] buf = new byte[1024]; 66 | int len; 67 | while ((len = inputStream.read(buf)) > 0) { 68 | outputStream.write(buf, 0, len); 69 | } 70 | inputStream.close(); 71 | outputStream.close(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 |