Go Back   Android Forums > Android Development > Application Development
Application Development Dev Lounge for the Coder Folks
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old March 12th, 2012, 03:50 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Mar 2012
Location: Barcelona
Posts: 4
 
Device(s): Sony Ericsson Xperia Arc
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Question How to know when the user wants to open a file

I'm developing an app that needs to know when the users wants to open some files, previusly configured in my app, and act before the file is served.

I assume I'll need to know when the user wants to open any file (and compare the file's name with my list) and the device must probably be rooted, but I can't find a way to know that a file is required for the user or for some application the user is using and requests the file.

I've thought about Broadcast receivers, but this option needs that 'open' generates a broadcast message, what I didn't find that is done.

Also I thought about the linux mods, that can be used to manage system calls, but I didn't find any way to include it (the linux instruction modprobe doesn't work on Android and I didn't found an equivalent one).

Any ideas? Is it impossible?

Thanks for your time!

Osidir is offline  
Reply With Quote
Sponsors
Old March 12th, 2012, 04:56 PM   #2 (permalink)
eschew obfuscation
 
Unforgiven's Avatar
 
Join Date: Jun 2010
Location: Douglas, MA
Gender: Male
Posts: 14,509
 
Device(s): OG Droid, DroidX2, HTC Rhyme, Kindle Fire, Galaxy Nexus, Nexus 7 (8GB & 16GB)
Carrier: VZW

Thanks: 7,147
Thanked 8,094 Times in 4,619 Posts
Default

Osidir,
I have moved this to the Android Development forum as the devs hang out there and will be better able to answer your questions.

Chris
__________________

If someone helped, hit Thanks, if you see rude or abusive posts, spam, or threads that need staff attention, hit Report.
Site Rules / Android Forums FAQ
*** Check out the new AF forum app!!! ***

I'm supporting BabyBlues with this. Please consider this worthy cause. Details

Unforgiven is online now  
Reply With Quote
Old March 14th, 2012, 02:13 PM   #3 (permalink)
Member
 
Join Date: Dec 2011
Location: Silicon Valley
Posts: 110
 
Device(s): few
Carrier: Not Provided

Thanks: 7
Thanked 32 Times in 29 Posts
Default

Quote:
Originally Posted by Osidir View Post
I'm developing an app that needs to know when the users wants to open some files, previusly configured in my app, and act before the file is served.

I assume I'll need to know when the user wants to open any file (and compare the file's name with my list) and the device must probably be rooted, but I can't find a way to know that a file is required for the user or for some application the user is using and requests the file.

I've thought about Broadcast receivers, but this option needs that 'open' generates a broadcast message, what I didn't find that is done.

Also I thought about the linux mods, that can be used to manage system calls, but I didn't find any way to include it (the linux instruction modprobe doesn't work on Android and I didn't found an equivalent one).

Any ideas? Is it impossible?

Thanks for your time!
Here's the way it is done - you need a stackable or user FS that mounted over all other FS's in the system, including root. Once you have that -

1: in vn_open check if you're interested in the file. vn_open does not have file name context so you'd need to get it from DNLC or maintain your own vnode/inode to file name mappings. Later is more suitable.

2: have user-space daemon that can be notified via up-call methods from your kernel module about "interesting file"

3: this daemon can notify any java observers via JNI about the file

sounds simple?
wubbzy is offline  
Reply With Quote
The Following User Says Thank You to wubbzy For This Useful Post:
Osidir (March 19th, 2012)
Old March 19th, 2012, 06:43 PM   #4 (permalink)
New Member
Thread Author (OP)
 
Join Date: Mar 2012
Location: Barcelona
Posts: 4
 
Device(s): Sony Ericsson Xperia Arc
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by wubbzy View Post
Here's the way it is done - you need a stackable or user FS that mounted over all other FS's in the system, including root. Once you have that -

1: in vn_open check if you're interested in the file. vn_open does not have file name context so you'd need to get it from DNLC or maintain your own vnode/inode to file name mappings. Later is more suitable.

2: have user-space daemon that can be notified via up-call methods from your kernel module about "interesting file"

3: this daemon can notify any java observers via JNI about the file

sounds simple?
Sounds simple and good! I'll try it and, anyway, thank you!
Osidir is offline  
Reply With Quote
Reply
Tags
catch, open, system call


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:15 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.