├── .gitattributes ├── .gitignore ├── ReadMe.md └── USBCamera ├── AndroidManifest.xml ├── gen └── com │ └── strickling │ └── usbcamera │ ├── BuildConfig.java │ └── R.java ├── ic_launcher-web.png ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-ldpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── layout │ └── main.xml ├── values │ └── strings.xml └── xml │ └── device_filter.xml └── src └── com └── ptplib └── usbcamera ├── BaselineInitiator.java ├── Buffer.java ├── Command.java ├── Container.java ├── Data.java ├── DeviceInfo.java ├── DevicePropDesc.java ├── DevicePropValue.java ├── Event.java ├── FileSendData.java ├── KodakExtension.java ├── NameFactory.java ├── ObjectInfo.java ├── OutputStreamData.java ├── PTPBusyException.java ├── PTPException.java ├── PTPUnsupportedException.java ├── ParamVector.java ├── Response.java ├── Session.java ├── StorageInfo.java ├── USBCameraTest.java ├── eos ├── EosEvent.java ├── EosEventConstants.java ├── EosEventFormat.java ├── EosEventParser.java └── EosInitiator.java └── nikon ├── NikonEvent.java ├── NikonEventConstants.java ├── NikonEventFormat.java ├── NikonEventParser.java └── NikonInitiator.java /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | This is the ReadMe! 2 | 3 | This program is an attempt to control cameras via the USB Host library available for Android 3.1 and above. Base of the code is taken from David Brownell's Java USB Camera Tools aka JPhoto from https://sourceforge.net/projects/jphoto/ . 4 | 5 | The idea is to create a tool similar to gPhoto for the Android device. At the moment, certain models of Canon EOS and Nikon DSLR Cameras are working. 6 | 7 | All code is under the GNU GENERAL PUBLIC LICENSE Version 3 http://www.gnu.org/licenses/gpl.html -------------------------------------------------------------------------------- /USBCamera/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /USBCamera/gen/com/strickling/usbcamera/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.strickling.usbcamera; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /USBCamera/gen/com/strickling/usbcamera/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 | 8 | package com.strickling.usbcamera; 9 | 10 | public final class R { 11 | public static final class array { 12 | public static final int aperture_list=0x7f060004; 13 | public static final int drivemode_list=0x7f06000b; 14 | public static final int exposure_list=0x7f060009; 15 | public static final int iso_list=0x7f060002; 16 | public static final int metering_list=0x7f06000c; 17 | public static final int nikon_aperture_list=0x7f060005; 18 | public static final int nikon_exposure_list=0x7f06000a; 19 | public static final int nikon_iso_list=0x7f060003; 20 | public static final int nikon_shutter_list=0x7f060001; 21 | public static final int nikon_whitebalance_list=0x7f060008; 22 | public static final int picturestyle_list=0x7f060006; 23 | public static final int shutter_list=0x7f060000; 24 | public static final int whitebalance_list=0x7f060007; 25 | } 26 | public static final class attr { 27 | } 28 | public static final class drawable { 29 | public static final int ic_launcher=0x7f020000; 30 | } 31 | public static final class id { 32 | public static final int ButtonMoveBackward=0x7f070020; 33 | public static final int ButtonMoveForward=0x7f07001f; 34 | public static final int ScrollView01=0x7f070000; 35 | public static final int aperture_spinner=0x7f070014; 36 | public static final int button1=0x7f070007; 37 | public static final int button10=0x7f070019; 38 | public static final int button11=0x7f07001b; 39 | public static final int button12=0x7f07001d; 40 | public static final int button13=0x7f070009; 41 | public static final int button2=0x7f070008; 42 | public static final int button3=0x7f07000d; 43 | public static final int button4=0x7f07000e; 44 | public static final int button5=0x7f07000f; 45 | public static final int button6=0x7f070011; 46 | public static final int button7=0x7f070013; 47 | public static final int button8=0x7f070015; 48 | public static final int button9=0x7f070017; 49 | public static final int drivemode_spinner=0x7f07001c; 50 | public static final int endLiveViewButton=0x7f07000c; 51 | public static final int exposure_spinner=0x7f07001a; 52 | public static final int iso_spinner=0x7f070012; 53 | public static final int liveViewHolder=0x7f07000a; 54 | public static final int metering_spinner=0x7f07001e; 55 | public static final int picturestyle_spinner=0x7f070016; 56 | public static final int shutter_spinner=0x7f070010; 57 | public static final int startLiveViewButton=0x7f07000b; 58 | public static final int tv1=0x7f070001; 59 | public static final int tv2=0x7f070002; 60 | public static final int tv3=0x7f070003; 61 | public static final int tv4=0x7f070004; 62 | public static final int tv5=0x7f070005; 63 | public static final int tv6=0x7f070006; 64 | public static final int whitebalance_spinner=0x7f070018; 65 | } 66 | public static final class layout { 67 | public static final int main=0x7f030000; 68 | } 69 | public static final class string { 70 | public static final int Button1=0x7f050003; 71 | public static final int Button10=0x7f05000c; 72 | public static final int Button11=0x7f05000d; 73 | public static final int Button12=0x7f05000e; 74 | public static final int Button13=0x7f05000f; 75 | public static final int Button2=0x7f050004; 76 | public static final int Button3=0x7f050005; 77 | public static final int Button4=0x7f050006; 78 | public static final int Button5=0x7f050007; 79 | public static final int Button6=0x7f050008; 80 | public static final int Button7=0x7f050009; 81 | public static final int Button8=0x7f05000a; 82 | public static final int Button9=0x7f05000b; 83 | public static final int ButtonMoveBackward=0x7f050011; 84 | public static final int ButtonMoveForward=0x7f050010; 85 | public static final int DefaultTV=0x7f050012; 86 | public static final int app_name=0x7f050002; 87 | public static final int desc=0x7f050000; 88 | public static final int endLiveViewButton=0x7f050014; 89 | public static final int hello=0x7f050001; 90 | public static final int startLiveViewButton=0x7f050013; 91 | } 92 | public static final class xml { 93 | public static final int device_filter=0x7f040000; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /USBCamera/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terencehonles/Android_USB_PTP_Lib/d4056fb3a3679a668fc1bed0763922744f90bb62/USBCamera/ic_launcher-web.png -------------------------------------------------------------------------------- /USBCamera/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 | -------------------------------------------------------------------------------- /USBCamera/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-12 15 | -------------------------------------------------------------------------------- /USBCamera/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terencehonles/Android_USB_PTP_Lib/d4056fb3a3679a668fc1bed0763922744f90bb62/USBCamera/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /USBCamera/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terencehonles/Android_USB_PTP_Lib/d4056fb3a3679a668fc1bed0763922744f90bb62/USBCamera/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /USBCamera/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terencehonles/Android_USB_PTP_Lib/d4056fb3a3679a668fc1bed0763922744f90bb62/USBCamera/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /USBCamera/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terencehonles/Android_USB_PTP_Lib/d4056fb3a3679a668fc1bed0763922744f90bb62/USBCamera/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /USBCamera/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 22 | 23 | 28 | 29 | 34 | 35 | 40 | 41 | 46 | 47 | 52 | 53 | 54 |