WARN/dalvikvm(990): No implementation found for native Landroid/os/SystemProperties;.native_get (Ljava/lang/String;)Ljava/lang/String;

842 views
Skip to first unread message

bazookier

unread,
Sep 5, 2009, 10:46:31 AM9/5/09
to android-porting
I use adb shell to type dalvikvm to run java program whose java
calling stack invoked the native_get method of
android.os.SystemProperties.

From ddms, the warning is:09-05 09:52:31.715: WARN/dalvikvm(990): No
implementation found for native Landroid/os/
SystemProperties;.native_get (Ljava/lang/String;)Ljava/lang/String;

So in java code, what library shuold be loaded or any other ways to
solve this problem?


Dianne Hackborn

unread,
Sep 5, 2009, 12:13:48 PM9/5/09
to android...@googlegroups.com
If you want to use the framework APIs, which have lots of native code behind them, you need to run dalvik with the native code included in it.  I believe the command is app_process -- you can look at some of the shell commands like "am" and "pm" to see how they are launched.

Note that this is not a typical way to launch the platform code, so if you aren't careful you will find various things that don't work or behave strangely; for the most part the platform really wants to be running and a processes launched and controlled by the activity manager.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

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.

bazookier

unread,
Sep 6, 2009, 1:36:39 AM9/6/09
to android-porting

Thanks, Dianne!

Can you provide more details about including the native code while
using dalvikvm to run the programme?
Do you mean using System.load("somelib.so"); to include the native
code?
Or using any dalvikvm options to include that?

And how to understand your propose of using command app_process and am
or pm?

May silly questions. But I really do not understand!
On 9月6日, 上午12时13分, Dianne Hackborn <hack...@android.com> wrote:
> If you want to use the framework APIs, which have lots of native code behind
> them, you need to run dalvik with the native code included in it. I believe
> the command is app_process -- you can look at some of the shell commands
> like "am" and "pm" to see how they are launched.
>
> Note that this is not a typical way to launch the platform code, so if you
> aren't careful you will find various things that don't work or behave
> strangely; for the most part the platform really wants to be running and a
> processes launched and controlled by the activity manager.
>
>
>
> On Sat, Sep 5, 2009 at 7:46 AM, bazookier <geelphe...@gmail.com> wrote:
>
> > I use adb shell to type dalvikvm to run java program whose java
> > calling stack invoked the native_get method of
> > android.os.SystemProperties.
>
> > From ddms, the warning is:09-05 09:52:31.715: WARN/dalvikvm(990): No
> > implementation found for native Landroid/os/
> > SystemProperties;.native_get (Ljava/lang/String;)Ljava/lang/String;
>
> > So in java code, what library shuold be loaded or any other ways to
> > solve this problem?
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com

bazookier

unread,
Sep 7, 2009, 9:02:09 PM9/7/09
to android-porting
Can anyone tell what should I do first?
Should I start some service?

fadden

unread,
Sep 8, 2009, 2:27:34 PM9/8/09
to android-porting
Two things need to happen:

(1) The necessary shared libraries need to be loaded.
(2) The various native methods need to be registered.

In frameworks/base/core/jni/AndroidRuntime.cpp you can see
AndroidRuntime::startReg(), which takes care of registering the native
methods associated with the Android application framework. This is
called from AndroidRuntime::start, which is where the framework
initialization begins.

I believe what hackbod was suggesting earlier is that you should look
at the implementation of "am" to see how it starts up, and perhaps do
something similar.

Nitin

unread,
Sep 16, 2009, 1:22:39 AM9/16/09
to android-porting
Hi All,

I am loading the service in the systemserver main method and also i am
registering the native methods by registered to AndroidRuntime:.
Once this is done and i flash the phone its not getting boot up. Can
you please tell if i am missing something or something else need to be
done. please give your suggestion

Regards
Nitin
Reply all
Reply to author
Forward
0 new messages