[Q] Do I need to write drivers?

Search This thread

cnayan

Member
Jul 10, 2012
8
0
I have fair number of years of programming behind me. But I haven't tried anything for Android, as I dislike Java.

But I want to try. I want to make something that works at low level, say, like a firewall. It acts as a filter between two communicating parties/devices.

To write anything like that, can someone suggest which is the best approach - code in Java (if it can perform such a feast) or code driver in C?

Thanks much!

Regards,
Nayan


Sent from my Micromax A117 using xda app-developers app
 

EmptinessFiller

Senior Member
Sep 15, 2013
88
20
The interesting thing in such low level projects is the entry point: So for a firewall you only have to acces iptables because android has linux kernel. So no C-part, no drivers, only plain java. See AFWall, it's an open source firewall.
 
  • Like
Reactions: cnayan

cnayan

Member
Jul 10, 2012
8
0
The interesting thing in such low level projects is the entry point: So for a firewall you only have to acces iptables because android has linux kernel. So no C-part, no drivers, only plain java. See AFWall, it's an open source firewall.

Excellent! I would certainly study AFWall. Thanks for the reference.

But actually, my quest doesn't stop here. :) I am exploring Android, and Google's restriction of "UI to be built only via Java". (I am not interested in scripting and widgets for now, unless they are absolutely needed.)

I want to know the answers for same question (driver or app) for the following:
* Network Filter [EmptinessFiller, you already answered this as Java]
* Disk (SD cards) (for many various purposes) - file system should not block the intention, hopefully.
* USB filter
* SMS filter

I am still thinking of other categories. Will write more later.

Please suggest and refer. Thanks again!
 
Last edited:

EmptinessFiller

Senior Member
Sep 15, 2013
88
20
General answer: Your app is always built in java. (It's UI components, it's LifeCycle (Activity, Service, Broadcastreceiver))
You may include native code, but that does not have more possibilities. It's only a little bit quicker.


Forgotten: If you have root, you may want to change some binaries, because you can't change things in an app. There you need native code of course.
 
  • Like
Reactions: cnayan

cnayan

Member
Jul 10, 2012
8
0
You may include native code, but that does not have more possibilities. It's only a little bit quicker.
Shame, isn't it? Too much power in Java's hand :D

Forgotten: If you have root, you may want to change some binaries, because you can't change things in an app. There you need native code of course.
My point exactly! Low level stuff is best written in native code.

But right now, I am learning how to.:confused:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    The interesting thing in such low level projects is the entry point: So for a firewall you only have to acces iptables because android has linux kernel. So no C-part, no drivers, only plain java. See AFWall, it's an open source firewall.
    1
    General answer: Your app is always built in java. (It's UI components, it's LifeCycle (Activity, Service, Broadcastreceiver))
    You may include native code, but that does not have more possibilities. It's only a little bit quicker.


    Forgotten: If you have root, you may want to change some binaries, because you can't change things in an app. There you need native code of course.