Re: How to use linux driver in android app

63 views
Skip to first unread message

Kristopher Micinski

unread,
May 8, 2013, 2:09:18 PM5/8/13
to android-...@googlegroups.com
You will need to make source modifications to the Android platform to
do this: you can't write it as an app.

Kris

On Wed, May 8, 2013 at 1:35 AM, Duresh Asanka <dure...@gmail.com> wrote:
> Hi,
> I have linux drivers written in C, which is for CAN communication. I am
> developing the Android app, using ADT, which is java.
> Could anyone please tell me how can I include these files to my project and
> use them.
>
> Thanks in Advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "android-platform" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-platfo...@googlegroups.com.
> To post to this group, send email to android-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/android-platform?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Ashwin Bihari

unread,
May 13, 2013, 4:06:20 PM5/13/13
to android-...@googlegroups.com
You cannot access the CAN interface directly from your application. You will need to do a couple of things.

Add an SDK Add-on that will implement a Java class that you can use in your application and a JNI portion that will interface to the hardware. In case of CAN, usually this is doing through sockets.

You can structure this add-on to be as simple or as complex as you wish with exception handling, intent broadcasting and whatever else you think you'll need while interfacing to CAN.

~ Ashwin

On Monday, May 13, 2013 6:01:05 AM UTC-4, Duresh Asanka wrote:
Thank you for replying me.

I have a Android development platform which is running Android 4.0. 
I have the Linux image which runs in that platform. In the linux image, there is the drivers for interfacing CAN. And also I have the source code for both images.

Could you please tell me, whether can I use these drivers to communicate via CAN, in my app writing in java.

Thank you
Reply all
Reply to author
Forward
0 new messages