Prevent demon form being killed, when device goes to SLEEP

by P@AR » Wed, 16 Feb 2011 02:09:39 GMT


Sponsored Links
 Hello, I need help over here!
Hi I am developing a Linux application(deamon) written in C, for my
Android device.
I have configured my init.rc script to start the deamon when the
device is booted.
Everything works just fine when the device is booted and my demon
starts, but when the device "sleeps"(after ~30seconds)
it kills my deamon application. Do you have any Idea how to prevent my
deamon from being "killed"?
I want to make my deamon to be active all the time, just like other
processes (adb, init, .... etc)
Any idea, suggestion would help ???

-- 



Re: Prevent demon form being killed, when device goes to SLEEP

by raja pavan » Wed, 16 Feb 2011 12:53:28 GMT


 "Killed" , lowmemorykiller has the power to kill processes, so lmk cuold be
behind this.

write /proc/1/oom_adj -16
This will prevent the lowmemorykiller driver from killing your process (if
lmk happens to be the reason)
Please let me know the result.







-- 


Sponsored Links


Re: Prevent demon form being killed, when device goes to SLEEP

by P@AR » Mon, 21 Feb 2011 02:49:21 GMT


 Thanks for your reply.
Tomorrow I'll check if the lmk is the problem
I'll update you as soon as I have the results

BR





-- 



Other Threads

1. Please explain obtainStyledAttributes

Hi,
I wanted to determine the default color of a text that is used inside
a TextEdit.

However I get confused by all the type int parameters of
obtainStyledAttributes.
Somehow I have to sort them in the right order but I can't figure it
out.

I have available:
com.android.internal.R.styleable.TextView_textColor
android.R.attr.textColorPrimary
android.R.attr.editTextStyle
com.android.internal.R.attr.editTextStyle
and com.android.R.stylabel.EditText which is an array of ints

I would prefer the obtainStyledAttributes solution over a simple (new
TextEdit).getTextColor() which seems to me rather a expensive call.

-- 

2. adding new API : make error :41

Hi all,
      I want to add my own API's to android.
      For this thing I followed one document I got from net and according to
I added one directory called "abc" to android framework which contains three
sub directories "java", "jni"  and "libabc".

When I tried to build the source code with this added directory I got
following error:
make: *** No rule to make target
`out/target/product/generic/obj/STATIC_LIBRARIES/intermediates/a',
needed by
`out/target/product/generic/obj/SHARED_LIBRARIES/libabc_jni_intermediates/LINKED/libabc_jni.so'.
Stop.

Then I checked the libabc_jni_intermediate directory and found that LINKED
directory is missing....

The content of all this "java" directory is
"abc.java" class file
 package android.abc;

public class abc
{
 static
 {
  System.loadLibrary("abc_jni");
 }
 public native int print(int i);
 public abc()
 {
    //test
 }
}

The content of "jni" directory is one "android_abc_abc.cpp" which contains
jni layer for accesing native function.
and "Android.mk" file. The content of "Android.mk" is as given below.


ifneq ($(BUILD_WITHOUT_PV),true)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
 android_abc_abc.cpp

LOCAL_SHARED_LIBRARIES := \
 libopencoreplayer \
 libopencoreauthor \
 libandroid_runtime \
 libnativehelper \


$(warning JNI makefile)

LOCAL_STATIC_LIBRARIES := \
 libabc

LOCAL_C_INCLUDES += \
 external/tremor/Tremor \
 $(PV_INCLUDES) \
 $(JNI_H_INCLUDE) \
 $(call include-path-for, corecg graphics)

LOCAL_CFLAGS +=

LOCAL_LDLIBS := -lpthread

LOCAL_MODULE:= libabc_jni
LOCAL_PRELINK_MODULE := false
$(warning JNI makefile)

include $(BUILD_SHARED_LIBRARY)
endif

And content of "libabc" directory are "test.h" and "test.cpp" file which
defines native function along with "Android.mk".
The content of "android.mk"file is

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
 test.cpp

LOCAL_SHARED_LIBRARIES := \
 libui libcutils libutils

$(warning LIBABC make file)

LOCAL_MODULE:= libabc
LOCAL_PRELINK_MODULE := false

ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
LOCAL_LDLIBS += -ldl
endif

ifneq ($(TARGET_SIMULATOR),true)
LOCAL_SHARED_LIBRARIES += libdl
endif

LOCAL_C_INCLUDES := \
 $(call include-path-for, graphics corecg)
$(warning LIBABC make file)

#include $(LOCAL_PATH)/abc/jni/Android.mk
#include $(BUILD_STATIC_LIBRARY)
#LOCAL_BUILT_MODULE:=libabc
include $(BUILD_STATIC_LIBRARY)

Please tell me what thing is causing error....
Or if any one knows any other way to add new API to android please share it.


Thanks in advance,
Sagar

-- 

3. Services, threads and AIDL

4. How to convert RGB565 to a bitmap file?

5. How to change Android Home screen orientation by a program

6. ssl.SSLException Not trusted server certificate httpclient

7. BackupManagerService usage & explain in Framework