Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,354 Members 44,044 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Do I need to write drivers?

Tip us?
 
cnayan
Old
#1  
cnayan's Avatar
Junior Member - OP
Thanks Meter 0
Posts: 6
Join Date: Jul 2012
Default [Q] Do I need to write drivers?

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
Old
#2  
Member
Thanks Meter 21
Posts: 88
Join Date: Sep 2013
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.
The Following User Says Thank You to EmptinessFiller For This Useful Post: [ Click to Expand ]
 
cnayan
Old
(Last edited by cnayan; 22nd February 2014 at 11:09 AM.)
#3  
cnayan's Avatar
Junior Member - OP
Thanks Meter 0
Posts: 6
Join Date: Jul 2012
Quote:
Originally Posted by EmptinessFiller View Post
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!
 
EmptinessFiller
Old
#4  
Member
Thanks Meter 21
Posts: 88
Join Date: Sep 2013
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.
The Following User Says Thank You to EmptinessFiller For This Useful Post: [ Click to Expand ]
 
cnayan
Old
#5  
cnayan's Avatar
Junior Member - OP
Thanks Meter 0
Posts: 6
Join Date: Jul 2012
Quote:
Originally Posted by EmptinessFiller View Post
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

Quote:
Originally Posted by EmptinessFiller View Post
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.
 
nikwen
Old
#6  
nikwen's Avatar
Recognized Contributor
Thanks Meter 1298
Posts: 2,690
Join Date: Feb 2013
Quote:
Originally Posted by cnayan View Post
Shame, isn't it? Too much power in Java's hand


My point exactly! Low level stuff is best written in native code.

But right now, I am learning how to.
Have a look at the Android NDK and this guide about the development of root apps.
 
cnayan
Old
#7  
cnayan's Avatar
Junior Member - OP
Thanks Meter 0
Posts: 6
Join Date: Jul 2012
Quote:
Originally Posted by nikwen View Post
Have a look at the Android NDK and this guide about the development of root apps.
Thanks for the link. Good stuff, but won't help in my targets... unless an example is seen.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Control Your Toast Notifications with SlicedToasts

Toasts are delicious, even in their Android flavor. In Android, toast doesn’t lead … more

Rotation Lets You Take Full Control of Your Device’s Orientation Settings

To be brutally honest, the native options for screen … more

Change the Alarm Icon in the Status Bar with Xposed

It’s hard to find a more hated object than your alarm clock. They wake us up nearly … more

Return to Outer Space Outer Space with Ship Up Game

Since the release of Flappy Birds, we’ve had the “fortune” to see … more