PowerManagement - wakelocks

by GPU » Mon, 22 Feb 2010 15:07:20 GMT


Sponsored Links
 Hi ,

PARTIAL_WAKE_LOCK
SCREEN_DIM_WAKE_LOCK
SCREEN_BRIGHT_WAKE_LOCK
FULL_WAKE_LOCK

In the above 4 wakelocks , only the PARTIAL_WAKE_LOCK  is calling
wakelock.c kernel API. How the other 3 wakelocks are handled
internally?

The other 3 wakelocks calling android_os_power.app -->
setScreenState(boolean).But its only make the sceen on/off
how the DIM/BRIGHT is handled?How its related to wakelock?

--



PowerManagement - wakelocks

by GPU » Mon, 22 Feb 2010 15:07:25 GMT


 Hi ,

PARTIAL_WAKE_LOCK
SCREEN_DIM_WAKE_LOCK
SCREEN_BRIGHT_WAKE_LOCK
FULL_WAKE_LOCK

In the above 4 wakelocks , only the PARTIAL_WAKE_LOCK  is calling
wakelock.c kernel API. How the other 3 wakelocks are handled
internally?

The other 3 wakelocks calling android_os_power.app -->
setScreenState(boolean).But its only make the sceen on/off
how the DIM/BRIGHT is handled?How its related to wakelock?

--


Sponsored Links


Other Threads

1. Adding a contact

hi all,
 i am beginner in android development.i am trying to add, delete and
update contact information using my own application. when i try to add
a contact, it is not getting added. please help me.

My code is:

ArrayList<ContentProviderOperation> ops = new
ArrayList<ContentProviderOperation>();
                                 int rawContactInsertIndex =
ops.size();
 
ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI)
                                  
.withValue(ContactsContract.RawContacts.ACCOUNT_TYPE,"Google")
                                  
.withValue(ContactsContract.RawContacts.ACCOUNT_NAME,"us...@gmail.com") 
.build());

 
ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
                                 
.withValueBackReference(Data.RAW_CONTACT_ID,rawContactInsertIndex)
                                 
.withValue(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
                                 
.withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME,
name)
                                 .build());


 
ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
                                  
.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,
rawContactInsertIndex)
                                  
.withValue(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)
                                  
.withValue(ContactsContract.CommonDataKinds.Phone.NUMBER,
phone)
                                  
.withValue(ContactsContract.CommonDataKinds.Phone.TYPE,
phoneType)
                                  .build());
 
ops.add(ContentProviderOperation.newInsert(ContactsContract
                                  .Data.CONTENT_URI)
                                  
.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,rawContactInsertIndex)
                                  
.withValue(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)
                                  
.withValue(ContactsContract.CommonDataKinds.Email.DATA,
email)
                                  
.withValue(ContactsContract.CommonDataKinds.Email.TYPE,
emailType)
                                  .build());

                                  try {
 
getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
                                    Context ctx =
getApplicationContext();
                                    CharSequence txt = "Contact " +
name +" added successfully";
                                                 int duration =
Toast.LENGTH_LONG;
                                                 Toast toast =
Toast.makeText(ctx, txt, duration);
                                                 toast.show();
                                } catch (Exception e) {
 
Toast.makeText(getApplicationContext(),"error",Toast.LENGTH_LONG).show();


                                }


Note: I don't have any in-built account name google.is it mandatory to
specific the ACCOUNT NAME and ACCOUNT TYPE?

i am also having problem in deleting and updating the contact. please
help me in this issue

-- 

2. Help with service and lifecycle

Hello,  I'm building a boating app that tracks where you dropped
anchor and monitors your position to see if you're drifting.  I wanted
the app to stay running until explicitly stopped so I decided to
implement a service to handle the GPS location checking and
notifications.

The problem I'm running into is with when to stop the service.  Since
part of the service's job is to alert (presumably someone sleeping)
that the anchor is dragging I want the notification portion to remain
running until explicitly stopped.  For this reason I'm using
startService() when the app initially runs.  this worked except that
when I exited the app (using the back button) the service wouldn't die
even though I had a stopService call in onDestroy().  My work around
was to use startService with an extra (call it an action signal) that
would signal the service to shut itself down.   That worked great as
long as my app is locked in a given orientation but now I'm wanting to
make it orientation aware.  The issue now is when I switch
orientations the UI activity executes the onDestroy method which kills
the service and starts it up again when onCreate is executed.  I'm
saving state and rebuilding everything so the app runs as expected.

Is there a better method to accomplish this that doesn't include
killing and starting the service?   I'm fairly new to Android and Java
so I'm not sure what the best way is to do some things so any guidance
would be greatly appreciated.

Thanks,
Chris

-- 

3. Touchscreen Events

4. Discover UPnP devices from my android device

5. phone book problem

6. playing sound when a call is running in android

7. Media Recorder Prepare failed