Sanjeevan
Sanjeevan

Reputation: 67

java standalone to communicate with android device

I am trying to write a java standalone program that have to read a file from my android device and save it to my windows machine. Please share knowledge on how to do this.

I have tried googleing but havent landed on any thing working yet.

Upvotes: 0

Views: 55

Answers (1)

Sanjeevan
Sanjeevan

Reputation: 67

I got this working.

I have downloaded the jar and DDL from this project. https://github.com/jerome-jouvie/jmtp

Add jar to yout project workspace. Here are the steps I followed in eclipse, to add DDL to project.

1.Create a folder under the project, for example dll. 2.Copy/paste all dll files into this folder. 3.In project -> Properties -> Java Build Path -> Source, click and expand the source details. 4.You will see Native library location, click on it. 5.Then click edit on the right, click workspace again. You can see the dll folder under the project. 6.Find it and click Ok. You will see the dll is added in the Native library location.

Post this do the following in run configuration. Say the dll you need is in Y:\path\to\dlls\lib. Then set your Run Configuration's working directory to Y:\path\to\dlls\ and set your VM arguments to include -Djava.library.path=lib

reference: Add .dll to java.library.path in Eclipse/PyDev Jython project

Upvotes: 1

Related Questions