Create Android Service in C/C++

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Create Android Service in C/C++

mac actiaitalia
Hello Everyone,

I know it is possible create an Activity in C/C++, but is it possible create a service in C/C++? If yes, is there a tutorial to do it?

Regards

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/a4ae1e96-c312-46cb-b494-20c31a4afa06n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Create Android Service in C/C++

Alex Cohn
Hi

NativeActivity is a special Java class that is part of the platform. It delegates all callbacks to C++ and so you can build an Android app writing literally 0 lines of code in Java. Still, your app will running in JVM. In many cases, the NativeActivity does not answer all the needs, and the developers choose to extend this class in Java, just like they extend the regular Activity class.

The similar work for Service class has never been done, so if you want to code a Service in C++, you must first produce a Java harness similar to NativeActivity. Luckily, the source code is available.

Hope this helps,
Alex Cohn

On Tuesday, August 4, 2020 at 5:48:57 PM UTC+3 [hidden email] wrote:
Hello Everyone,

I know it is possible create an Activity in C/C++, but is it possible create a service in C/C++? If yes, is there a tutorial to do it?

Regards

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/cc5ef6b8-351b-4a9e-af39-5de8a689401dn%40googlegroups.com.