I have developed a Java application. The application connects to an android device programmatically to transfer some files to connects Android devices.
In my application I have added the adb PATH so it can use it to connect to devices.
I was wondering if its possible to maybe package it within the application ? or just copying the adb into the application directory ? Because I want who ever to download this application, wouldn’t need to also have download the adb or Android sdk for the application to work
Is it possible ?
After doing some research you can package an exe within a jar file but you have to extract the exe each run of the application. Following TofuBear’s example here I was able to encapsulate adb within a jar file. You’ll need to include the AdbWinApi.dll (or equivalent linux libraries).
I had to change the file creation from TofuBear’s example so that the file name of the exe would not be changed. It’s still created in the temporary folder and will be deleted on exit. I left the original code as a comment.
Edit: Seems I got so caught up with the technical possiblity of it I forgot the legal ramifications. It’s been stated here by Chris Stratton that the SDK Terms of Service prohibits redistribution of any part of the sdk. Which would include adb.