I'm not certain that JNI code would work too well in this situation,
but please let me know if you disagree. My background is very heavy
in C and very light in Java, so I'll be the first to admit that my
understanding of the capabilities of the NDK and JNI code is somewhat
limited.
I have a daemon written in C that, among other things, makes
occasional changes to the system clock via settimeofday(). The
frequency with which this change is made is based on a few functions
that are called through the mainline loop of the C code. I could
write JNI code to let a Java program kick off the mainline loop, or
recreate the loop in Java using JNI code to call the individual
functions, but I don't know that this would solve my problem. I
thought that the JNI code was basically a way of having Java tell C
that it needs to run a piece of code. In my case, I would think I'd
need the reverse- a way for the C code to make a call to a function
written in Java to broadcast an intent whenever the C code determines
it needs to change the time of day.
Again, I'm rather new to coding in Java (and definitely new to coding
for Android), so please let me know if my understanding and solution
are flawed.
Thanks,
Jordan Wills
On Jul 21, 6:25 pm, Dianne Hackborn <
hack...@android.com> wrote:
> You just need to write some JNI code to call the desired Java APIs.
>
>
>
>
>
> On Wed, Jul 21, 2010 at 1:21 PM, jwills <
wills.jor...@gmail.com> wrote:
> > Is there any framework in place currently to allow a system level
> > service written in C or C++ to broadcast an intent? I came across
>
> >
http://groups.google.com/group/android-platform/browse_thread/thread/...
> > stating it was not possible, but noticed the datestamp of a year and a
> > half ago. Have there been any updates to this, or does that response
> > still hold true? If that is still the case, are there any plans to
> > change this in the future? I would hate to have to write up a service
> > in Java whose sole purpose is to listen to my C based daemon and pass
> > off intents for it when necessary, but that's the only workaround I
> > can think of at the moment.
>
> > Thanks,
> > Jordan Wills
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to
android-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
android-platfo...@googlegroups.com<android-platform%2Bunsubscrib
e...@googlegroups.com>
> > .
>
hack...@android.com