Re: NDK issue, pure native apps like NativeActivity compile but are not transferred to the device.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: NDK issue, pure native apps like NativeActivity compile but are not transferred to the device.

Dianne Hackborn
On Fri, Jan 6, 2012 at 6:45 AM, Justin Buser <[hidden email]> wrote:
I think the reason this example instructs you to set hasCode to false
is that the libnative-activity.so file is intended to be dropped into
another application as it can be called/started using an Intent just
like any other activity. The AndroidManifest.xml file really shouldn't
be part of the example however unless it was more concisely
documented.  As far as I can tell setting hasCode to false on the
application tag in the Manifest essentially causes the APK to do
nothing at all, not sure what the point is but it is certainly
confusing.

android:hasCode means that the .apk has no dalvik code; it is instructing the framework to not try to add the app's dalvik code to its class path when initializing its process (which would fail if there wasn't any dalvik code to load).  The example is using this simply to illustrate that if you are using NativeActivity, you don't need to have any dalvik code in your apk at all, since NativeActivity is implemented in the framework.  In practice most applications will not do this, because they will often want to have a subclass of NativeActivity with some customization or other activities or services or such.

--
Dianne Hackborn
Android framework engineer
[hidden email]

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.