Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: usb in android



Permlink Replies: 7 - Last Post: Apr 2, 2018 4:29 PM Last Post By: Brian Hamilton ... Threads: [ Previous | Next ]
peiman f

Posts: 106
Registered: 4/16/14
usb in android
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 30, 2018 12:10 PM
hello
is there any way to connect and transmit data to from serial port on android?
like COM port in windows
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: usb in android
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 30, 2018 2:18 PM   in response to: peiman f in response to: peiman f
peiman f wrote:

is there any way to connect and transmit data to from serial port on android?
like COM port in windows

Via USB? Sure:

https://developer.android.com/reference/android/hardware/usb/package-summary.html

Some examples in Java:

https://www.programcreek.com/java-api-examples/?api=android.hardware.usb.UsbDevice

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
peiman f

Posts: 106
Registered: 4/16/14
Re: usb in android
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 31, 2018 8:55 AM   in response to: Dave Nottage in response to: Dave Nottage
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: usb in android
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 31, 2018 3:54 PM   in response to: peiman f in response to: peiman f
peiman f wrote:


By converting it to Delphi code. This can be a good starting point:

https://www.youtube.com/watch?v=GcuYc7F0lIU

I've done part of the work for you by importing the Usb classes:

https://github.com/DelphiWorlds/KastriFree/blob/master/API/DW.Androidapi.JNI.Usb.pas

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Jukka Nordstr?m

Posts: 29
Registered: 6/17/00
Re: usb in android
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 31, 2018 11:56 PM   in response to: Dave Nottage in response to: Dave Nottage
Dave Nottage wrote:
peiman f wrote:


By converting it to Delphi code. This can be a good starting point:

https://www.youtube.com/watch?v=GcuYc7F0lIU

I've done part of the work for you by importing the Usb classes:

https://github.com/DelphiWorlds/KastriFree/blob/master/API/DW.Androidapi.JNI.Usb.pas

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com

Can you put FMX example codes!?!
peiman f

Posts: 106
Registered: 4/16/14
Re: usb in android
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 1, 2018 2:38 PM   in response to: Dave Nottage in response to: Dave Nottage
Dave Nottage wrote:
peiman f wrote:

Via USB? Sure:

how can i install this component? or you mean use it as a single file ?
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: usb in android
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 1, 2018 4:43 PM   in response to: peiman f in response to: peiman f
peiman f wrote:

how can i install this component? or you mean use it as a single file ?

If you're talking about the file I imported, yes, it's a single file; not a component.

As to how to use the classes, refer to the links to the documentation and Java examples I posted, as well as the video,
which explains how to use Android APIs in Delphi code.

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Brian Hamilton ...

Posts: 556
Registered: 10/14/04
Re: usb in android
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 2, 2018 4:29 PM   in response to: peiman f in response to: peiman f
peiman f wrote:
hello
is there any way to connect and transmit data to from serial port on android?
like COM port in windows

maybe check out winsoft components
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02