how to give effects to livewallpaper?

by Hitendrasinh Gohil » Fri, 20 May 2011 13:51:26 GMT


Sponsored Links
 hi,

can anybody tell me how can we give effects to live wallpaper like in
"city at night" app.like lights on/off etc.

-- 



Other Threads

1. Stretch video to full screen in a SurfaceView extension

I have created a widget that is an extension of SurfaceView (very
similar to VideoView -
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/VideoView.java;hb=HEAD)
and I am working on a feature to stretch the video fully across the
device screen when certain action is taken. I've looked at onMeasure
function of VideoView and re-wrote it this way:

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
    if (mStretchVideo) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    } else {
        int width = getDefaultSize(mVideoWidth, widthMeasureSpec);
        int height = getDefaultSize(mVideoHeight, heightMeasureSpec);
        if (mVideoWidth > 0 && mVideoHeight > 0) {
            if (mVideoWidth * height > width * mVideoHeight) {
                height = width * mVideoHeight / mVideoWidth;
            } else if (mVideoWidth * height < width * mVideoHeight) {
                width = height * mVideoWidth / mVideoHeight;
            }
        }
        setMeasuredDimension(width, height);
    }
}

This seems to work fine if I completely stop the video and start
playing again. Now I am trying to force the refresh of this
SurfaceView after setting the stretch flag so that the video gets
stretched while it is playing, but I couldn't figure out how to force
a refresh on SurfaceView. I tried android.view.View.invalidate(),
android.view.View.refreshDrawableState() and calling
android.view.View.measure(int, int) directly with different
combinations but did not get any success.

Any ideas?

Thanks.

-- 

2. Getting different Contact number from Contact List and Call Log for same contact

Hi,

Please help me in solving this problem with my Android Application:

I am writing an android application to search  call log by a
particular contact number , and  contact list by a particular contact
number

To start, I added a new contact in android emulator. While writing the
contact number for the contact, a dash sign ( - ) automatically gets
inserted between the digits after some interval.
  For, e.g. If I am trying to store 9889880912 , it gets converted to
988-988-0912.
After saving my contact, I made a call to the contact so that it gets
an entry in call log.


But i found that the contact number is stored in different pattern in
contact list and call log. Suppose I have a contact with number
9889880912. Then, using my code,

If I search my contact book for number 988-988-0911  , I am able to
display the result
But if I am doing the search for contact number 9889880912 , Then no
results are found from the contact list.

Similarly, If I am doing the search in CALL LOG History for
9889880912 , I am able to display the result.

 But if I am searching for number 988-988-0912 in the call log
history, no results are displayed.



How can I search for a number 9889880912 in my contact list to get
result.  I am trying to remove this - problem.




My code for search are :

/*  Search a contact in contact list   */

 Cursor phoneResult = context.getContentResolver().query(
        
ContactsContract.CommonDataKinds.Phone.CONTENT_URI ,
                                                       null,
        
ContactsContract.CommonDataKinds.Phone.NUMBER + "=?",
                                                       new String[]
{String.valueOf(phoneNumber)},
                                                       null);


                if(phoneResult.getCount()>0)
                {
                     debugString="at least one contact with phonenumber";
                     Log.d("DEBUG",debugString);

               }

/*  search for a call log by number */


  Cursor callLogResult =
context.getContentResolver().query( callLogURI,
                                                        null,
                                                        Calls.NUMBER + "=?",
                                                        new 
String[]{String.valueOf(mobileNumber)},
                                                        null);

                           if(callLogResult.getCount()>0)
                           {
                                   debugString = "At least one call Log found";
                                  Log.d("DEBUG",debugString);
                            }


Please guide me to solve my problem.

Thanks,
NIshant Kumar

-- 

3. 2d drawing with shapes and drawables.

4. Streaming video from phone to server

5. WebView, webpage gets zooomed automatically when TextBox in it is clicked

6. Programming in Java

7. Updating the Tab icons