USB data exchange via NDK?

747 views
Skip to first unread message

André

unread,
Jun 30, 2009, 11:14:52 AM6/30/09
to android-ndk
I'm currently investigating what possibilities to establish an USB
communication channel between a Windows PC and an Android phone. The
perfect solution would be a TCP/IP tunnel or something similar. (This
post is *NOT* about USB Thethering by the way).

From what I have found out so far there's no easy way of doing this
yet. The only possibility I have found is to enable USB debugging on
the phone and use ADB to configure a port forwarding. Enabling USB
debugging, however, is an action the potential end user would have to
perform manually... That's something I wish to avoid. The
communication between my phone application and my PC desktop
application should be established automatically and transparently as
soon as the phone is plugged into USB port.

I just wondered whether the newly released NDK might be of some help?
Would it be possible to use the NDK to establish any communication
channel, socket, whatever over USB?


Thanks for your help,

-- André
http://android.rabold.org

David Turner

unread,
Jun 30, 2009, 11:33:31 AM6/30/09
to andro...@googlegroups.com

No, the NDK is totally unrelated to this. It's only a way to add native code for applications,
and you can already create all kinds of sockets from Java.

It looks like you're looking for a new platform feature, so try android-platform to discuss it
instead.

Regards
 

André

unread,
Jun 30, 2009, 11:49:48 AM6/30/09
to android-ndk
Thanks for clarification :)


-- André
http://android.rabold.org


On 30 Jun., 17:33, David Turner <di...@android.com> wrote:

AndroidD

unread,
Jul 12, 2009, 5:21:30 PM7/12/09
to android-ndk
Was this question answered? I'm looking for similar info. Is this
something that the hardware manufacturer would need to provide?

Thanks,
Dan

On Jun 30, 10:49 am, André <andre.rab...@googlemail.com> wrote:
> Thanks for clarification :)
>
> -- Andréhttp://android.rabold.org

Jack Palevich

unread,
Jul 12, 2009, 9:07:34 PM7/12/09
to andro...@googlegroups.com
See David Turner's answer: the question is not related to the NDK, and
therefore you should ask it in the android-platform newsgroup.

D. Kevin McGrath

unread,
Jul 12, 2009, 9:21:56 PM7/12/09
to andro...@googlegroups.com
Well then, is there hardware level access via the NDK? Not necessarily
what Dan is asking (not sure, Dan?), but I'm certainly curious.
Obviously, the camera, the GPU, etc. are all off limits, but is
something like the USB controller accessible?

Jack Palevich

unread,
Jul 12, 2009, 11:04:21 PM7/12/09
to andro...@googlegroups.com
The NDK does not, in general, give you access to anything that is not
already available using Java. On the contrary, there are APIs, such as
OpenGL and audio, that are currently only available at the Java level.

One case where the NDK gives you more access than Java is where there
is a Linux system call that is not yet exposed at the Java level. For
example, if you are writing a terminal emulator to connect to the
internal Android shell, you would need to use the NDK to write C code
to make ioctl calls to properly set up the pty connection.

André

unread,
Jul 16, 2009, 10:12:56 AM7/16/09
to android-ndk
No, my question hasn't been answered yet, AndroidD :( Though I have
searched various groups and forums I still have no mechanism for
communicating via USB other than using ADB with the "forward"
command.

-- André
http://android.rabold.org


On 13 Jul., 05:04, Jack Palevich <jack...@google.com> wrote:
> The NDK does not, in general, give you access to anything that is not
> already available using Java. On the contrary, there are APIs, such as
> OpenGL and audio, that are currently only available at the Java level.
>
> One case where the NDK gives you more access than Java is where there
> is a Linux system call that is not yet exposed at the Java level. For
> example, if you are writing a terminal emulator to connect to the
> internal Android shell, you would need to use the NDK to write C code
> to make ioctl calls to properly set up the pty connection.
>
> On Sun, Jul 12, 2009 at 6:21 PM, D. Kevin
>
> McGrath<d.kevin.mcgr...@gmail.com> wrote:
>
> > Well then, is there hardware level access via the NDK? Not necessarily
> > what Dan is asking (not sure, Dan?), but I'm certainly curious.
> > Obviously, the camera, the GPU, etc. are all off limits, but is
> > something like the USB controller accessible?
>
> > On 12 Jul 2009, at 9:07 PM, Jack Palevich wrote:
>
> >> See David Turner's answer: the question is not related to the NDK, and
> >> therefore you should ask it in the android-platform newsgroup.
>
Reply all
Reply to author
Forward
0 new messages