2011년 8월 21일 일요일

Free icon + RainyStreet LWP










Hi!I'm SippDa!
This is Rainy Street LWP.
This screen is LWP + free icons.

Please visit this website.
http://blog.naver.com/vc7148
And now Free Download icons.

Please search for  RainyStreet LWP on the market.
or
scan
QR code

People of raining streets.
One by one, like an afterimage appears.
When you slide the screen
Is like a ghost disappeared.
please love it.
Right now.
*************************************************
How to install
menu>wallpaper>LiveWallpaper.
and Select each LWP.




android, Live Wallpaper, free icon, 안드로이드, 라이브월페이퍼, 핸드폰 배경화면, 핸드폰 아이콘,
공짜 아이콘

Free icon + Touch*HotSummer LWP





Hi! I'm SippDa!
This LWP is a cute summer girl.
This screen is LWP + free icons.

Please visit this website.
http://blog.naver.com/vc7148
And now Free Download icons.

and

Please search for  Touch*HotSummer LWP on the market.
or
scan
QR code

The girl usually, the ocean is playing on.
bot she Jump surprised when you slide the screen.
very cute girl's eyes this time.
please love me.
Right now.
*************************************************
How to install
menu>wallpaper>LiveWallpaper.
and Select each LWP.






android, Live Wallpaper, free icon, 안드로이드, 라이브월페이퍼, 핸드폰 배경화면, 핸드폰 아이콘,
공짜 아이콘

2011년 8월 13일 토요일

Simple!CornHatGirl LWP




 

Hi! I'm SippDa!
This LWP is a cute girl who wears
a cone hat. The girl usually blows a
horn but she moves quickly when you
slide the screen. It's so funny
and exciting.
*************************************
How to install
menu>wallpaper>LiveWallpaper.
and Select each LWP.


please serch for the
Simple!CornHatGirl LWP
on the market


2011년 6월 28일 화요일

3)LiveWallPaper tutorial

http://blog.androgames.net/58/android-live-wallpaper-tutorial/

Live Wallpaper is a new feature added in Android 2.1. Live wallpapers are animated and interactive backgrounds that can be added to your Android home. In this tutorial we’ll se how to build an interactive animated live wallpaper properly.
A live wallpaper is an Android application that includes a WallpaperService. This service must wrap a WallpaperService.Engine. The Engine is the bridge between the user, the surface, and the system. It owns the surface in wich the wallpaper is drawn.
First of all, a WallpaperService class must be created with its inner Engine class. This service must be declared in the AndroidManifest.xml with the android.service.wallpaper.WallpaperService Intent so that it would be recognized as a live wallpaper on the device. The android.permission.BIND_WALLPAPER permission is required to attach a live wallpaper to the Android Home application :
<service 
    android:name="LiveWallpaperService"
    android:enabled="true"
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:permission="android.permission.BIND_WALLPAPER">
    <intent-filter android:priority="1" >
        <action android:name="android.service.wallpaper.WallpaperService" />
    </intent-filter>
    <meta-data 
      android:name="android.service.wallpaper" 
      android:resource="@xml/wallpaper" />
</service>
A xml file should be placed in the /res/xml/ directory of your application. It’s used to described your live wallpaper.
<?xml version="1.0" encoding="UTF-8"?>
<wallpaper 
    xmlns:android="http://schemas.android.com/apk/res/android"  
    android:thumbnail="@drawable/thumbnail" 
    android:description="@string/description"
    android:settingsActivity="PreferenceActivity"/>
As described in the attrs.xml Android file, the allowed attributes and there meanings are as follow :
<declare-styleable name="Wallpaper">
    <!-- Component name of an activity that allows the user to modify
         the current settings for this wallpaper. -->
    <attr name="settingsActivity" />
 
    <!-- Reference to a the wallpaper's thumbnail bitmap. -->
    <attr name="thumbnail" format="reference" />
 
    <!-- Name of the author of this component, e.g. Google. -->
    <attr name="author" format="reference" />
 
    <!-- Short description of the component's purpose or behavior. -->
    <attr name="description" />
</declare-styleable>
The live wallpaper archetype is as follow :
package net.androgames.blog.sample.livewallpaper;
 
import android.content.SharedPreferences;
import android.service.wallpaper.WallpaperService;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
 
/**
 * Android Live Wallpaper Archetype
 * @author antoine vianey
 * under GPL v3 : http://www.gnu.org/licenses/gpl-3.0.html
 */
public class LiveWallpaperService extends WallpaperService {
 
    @Override
    public Engine onCreateEngine() {
        return new SampleEngine();
    }
 
    @Override
    public void onCreate() {
        super.onCreate();
    }
 
    @Override
    public void onDestroy() {
        super.onDestroy();
    }
 
    public class SampleEngine extends Engine {
 
        private LiveWallpaperPainting painting;
 
        SampleEngine() {
            SurfaceHolder holder = getSurfaceHolder();
            painting = new LiveWallpaperPainting(holder, 
                getApplicationContext());
        }
 
        @Override
        public void onCreate(SurfaceHolder surfaceHolder) {
            super.onCreate(surfaceHolder);
            // register listeners and callbacks here
            setTouchEventsEnabled(true);
        }
 
        @Override
        public void onDestroy() {
            super.onDestroy();
            // remove listeners and callbacks here
            painting.stopPainting();
        }
 
        @Override
        public void onVisibilityChanged(boolean visible) {
            if (visible) {
                // register listeners and callbacks here
                painting.resumePainting();
            } else {
                // remove listeners and callbacks here
                painting.pausePainting();
            }
        }
 
        @Override
        public void onSurfaceChanged(SurfaceHolder holder, int format, 
                int width, int height) {
            super.onSurfaceChanged(holder, format, width, height);
            painting.setSurfaceSize(width, height);
        }
 
        @Override
        public void onSurfaceCreated(SurfaceHolder holder) {
            super.onSurfaceCreated(holder);
            // start painting
            painting.start();
        }
 
        @Override
        public void onSurfaceDestroyed(SurfaceHolder holder) {
            super.onSurfaceDestroyed(holder);
            boolean retry = true;
            painting.stopPainting();
            while (retry) {
                try {
                    painting.join();
                    retry = false;
                } catch (InterruptedException e) {}
            }
        }
 
        @Override
        public void onOffsetsChanged(float xOffset, float yOffset, 
                float xStep, float yStep, int xPixels, int yPixels) {
        }
 
        @Override
        public void onTouchEvent(MotionEvent event) {
            super.onTouchEvent(event);
            painting.doTouchEvent(event);
        }
 
    }
 
}
The Engine’s methods onCreate, onDestroy, onVisibilityChanged, onSurfaceChanged, onSurfaceCreated and onSurfaceDestroyed are called when the wallpaper visibility, state or size changes. With this methods, the live wallpaper could be animated only if necessary. Touch events are activated through setTouchEventsEnabled(true) and handled with the onTouchEvent(MotionEvent event) callback.
To do the actual painting of the wallpaper, a separate painting thread is used :
package net.androgames.blog.sample.livewallpaper;
 
import android.content.Context;
import android.graphics.Canvas;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
 
/**
 * Android Live Wallpaper painting thread Archetype
 * @author antoine vianey
 * GPL v3 : http://www.gnu.org/licenses/gpl-3.0.html
 */
public class LiveWallpaperPainting extends Thread {
 
    /** Reference to the View and the context */
    private SurfaceHolder surfaceHolder;
    private Context context;
 
    /** State */
    private boolean wait;
    private boolean run;
 
    /** Dimensions */
    private int width;
    private int height;
 
    /** Time tracking */
    private long previousTime;
    private long currentTime;
 
    public LiveWallpaperPainting(SurfaceHolder surfaceHolder, 
            Context context) {
        // keep a reference of the context and the surface
        // the context is needed if you want to inflate
        // some resources from your livewallpaper .apk
        this.surfaceHolder = surfaceHolder;
        this.context = context;
        // don't animate until surface is created and displayed
        this.wait = true;
    }
 
    /**
     * Pauses the live wallpaper animation
     */
    public void pausePainting() {
        this.wait = true;
        synchronized(this) {
            this.notify();
        }
    }
 
    /**
     * Resume the live wallpaper animation
     */
    public void resumePainting() {
        this.wait = false;
        synchronized(this) {
            this.notify();
        }
    }
 
    /**
     * Stop the live wallpaper animation
     */
    public void stopPainting() {
        this.run = false;
        synchronized(this) {
            this.notify();
        }
    }
 
    @Override
    public void run() {
        this.run = true;
        Canvas c = null;
        while (run) {
            try {
                c = this.surfaceHolder.lockCanvas(null);
                synchronized (this.surfaceHolder) {
                    currentTime = System.currentTimeMillis();
                    updatePhysics();
                    doDraw(c);
                    previousTime = currentTime;
                }
            } finally {
                if (c != null) {
                    this.surfaceHolder.unlockCanvasAndPost(c);
                }
            }
            // pause if no need to animate
            synchronized (this) {
                if (wait) {
                    try {
                        wait();
                    } catch (Exception e) {}
                }
            }
        }
    }
 
    /**
     * Invoke when the surface dimension change
     */
    public void setSurfaceSize(int width, int height) {
        this.width = width;
        this.height = height;
        synchronized(this) {
            this.notify();
        }
    }
 
    /**
     * Invoke while the screen is touched
     */
    public void doTouchEvent(MotionEvent event) {
        // handle the event here
        // if there is something to animate
        // then wake up
        this.wait = false;
        synchronized(this) {
            notify();
        }
    }
 
    /**
     * Do the actual drawing stuff
     */
    private void doDraw(Canvas canvas) {}
 
    /**
     * Update the animation, sprites or whatever.
     * If there is nothing to animate set the wait
     * attribute of the thread to true
     */
    private void updatePhysics() {
        // if nothing was updated :
        // this.wait = true;
    }
 
}
This class is optimized in the sens that it draws the canvas only if the wallpaper surface is visible and if there is something new to draw. If there is nothing to animate anymore, then the updatePhysics should tell the thread to wait. If so, the canvas needs to be drawn one last time because of the SurfaceView behaviour that use two Canvas alternating…
To allow configuration of a live wallpaper, just create a PreferenceActivity and link it into the wallpaper xml declaration file described previously. Preference values can be retrieved through a SharedPreference object.
You can browse the full source code of the Eclipse project here : SampleLiveWallpaper.

Compass LiveWallPaper

device6.png device3.png

0.99$

Super Mario Android Live Wallpaper

Super Mario Android Live Wallpaper Is Cool




click!
http://www.youtube.com/watch?v=_pf6XZge_Mo&feature=player_embedded

Android Market LVL(License Validation Library) Application

LVL은 Android Version 1.5이상, 그리고 Pay Application 에만 적용이 가능하다.



 패키지를 설치하고 나면 Android SDK를 설치한 곳에 market_licensing 폴더가 생성되고, 그 안에 library 폴더를 이용해 LVL를 사용한다.


http://market.android.com/publish/Home 접속 -> 마켓로고 아래 Edit profile » 클릭



Public Key를 사용해서 LVL을 적용 할 것이다.
workspace에 library를 프로젝트로 추가시켜 놓자.

Contents 를 Create project from existing source로 바꾸고 library폴더를 지정하면 자동으로 입력이 된다.

이제 LVL을 적용할 프로젝트를 우클릭 -> properties

Android 탭 -> Library Add -> Library 선택 -> 적용 후 확인
프로젝트에 라이브러리를 추가하는 것 까지는 완료되었다. 이제부터는 LVL을 적용시켜보자.
먼저, 매니페스트에 퍼미션을 추가시킨다.
   <USES-PERMISSION android:name="com.android.vending.CHECK_LICENSE" />
<USES-PERMISSION android:name="android.permission.READ_PHONE_STATE" />


메인 액티비티에 소스를 추가하고 Ctrl + Shift + O 를 사용해 import 시키자.

// public key
private static final String BASE64_PUBLIC_KEY = "자신의 public key";
// 20개의 랜덤한 byte
private static final byte[] SALT = {-46, 65, 30, -128, -103, -57, 74, -64, 51, 88, -95, -45, 77, -117, -36, -113, -11, 32, -64, 89};
private LicenseCheckerCallback mLicenseCheckerCallback;
private LicenseChecker mChecker;
@Override
protected void onDestroy() {
 super.onDestroy();
 mChecker.onDestroy(); // 어플리케이션 종료시 메모리 반환
}
public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       mLicenseCheckerCallback = new MyLicenseCheckerCallback();
       TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
       String deviceId = tm.getDeviceId();
       // 초기화
       mChecker = new LicenseChecker( this
         , new ServerManagedPolicy(this, new AESObfuscator(SALT, getPackageName(), deviceId))
         , BASE64_PUBLIC_KEY);
       // 실행
       mChecker.checkAccess(mLicenseCheckerCallback);
        setContentView(R.layout.main);
   }
private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
 @Override
 public void allow() {
  if (isFinishing()) {
   return;
  }
  // 인증 성공
  Log.v(null,"OK");
 }
 @Override
 public void applicationError(ApplicationErrorCode errorCode) {
  // error
  Log.v(null,"error");
 }
 @Override
 public void dontAllow() {
  if (isFinishing()) {
   return;
  }
  // 인증 실패
  Log.v(null,"fail");
 }
}

2)View image.

WallPePer_Canvas.java

package pe.berabue.livewallpaper;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.os.Handler;
import android.service.wallpaper.WallpaperService;
import android.util.Log;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
public class WallPaPer_Canvas extends WallpaperService {
   
 private final Handler mHandler = new Handler();

 @Override
 public void onCreate() {
  super.onCreate();
 }

 @Override
 public void onDestroy() {
  super.onDestroy();
 }
 @Override
 public Engine onCreateEngine() {
  return new CanvasEngine();
 }
 private class CanvasEngine extends Engine { 
  private Bitmap imgIcon;

  private final Runnable mRunnable = new Runnable() {
   public void run() {
    drawFrame();
   }
  };
  private boolean isVisible;
        
  public CanvasEngine() {
   imgIcon = BitmapFactory.decodeResource(getApplicationContext().getResources(), R.drawable.icon);
  }

  @Override
  public void onCreate(SurfaceHolder surfaceHolder) {
   super.onCreate(surfaceHolder);
   setTouchEventsEnabled(true);
  }
  @Override
  public void onDestroy() {
   super.onDestroy();
   mHandler.removeCallbacks(mRunnable);
  }
  @Override
  public void onVisibilityChanged(boolean visible) {
   isVisible = visible;
   if (visible) {
    drawFrame();
   } else {
    mHandler.removeCallbacks(mRunnable);
   }
  }
  @Override
  public void onSurfaceCreated(SurfaceHolder holder) {
   super.onSurfaceCreated(holder);
  }

  @Override
  public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) {
   super.onSurfaceChanged(holder, format, width, height);
   Log.v(null," :::: onSurfaceChanged : "+format+" / "+width+", "+height);
   drawFrame();
  }
  @Override
  public void onSurfaceDestroyed(SurfaceHolder holder) {
   super.onSurfaceDestroyed(holder);
   isVisible = false;
   mHandler.removeCallbacks(mRunnable);
  }
  @Override
  public void onOffsetsChanged(float xOffset, float yOffset, float xStep, float yStep, int xPixels, int yPixels) {
   Log.v(null," :::: onOffsetsChanged : "+xOffset+", "+yOffset+", "+xStep+", "+yStep+", "+xPixels+", "+yPixels);
   drawFrame();
  }
  @Override
  public void onTouchEvent(MotionEvent event) {
   if (event.getAction() == MotionEvent.ACTION_DOWN) {
    Log.v(null," :::: onTouchEvent");
   }
   super.onTouchEvent(event);
  }
  public void drawFrame() {
   final SurfaceHolder holder = getSurfaceHolder();
   Canvas canvas = null;
   try {
    canvas = holder.lockCanvas();
    if (canvas != null) {
     canvas.drawBitmap(imgIcon, 0, 0, null);
    }
   } finally {
    if (canvas != null)
     holder.unlockCanvasAndPost(canvas);
   }
   mHandler.removeCallbacks(mRunnable);
   if (isVisible) {
    mHandler.postDelayed(mRunnable, 1000 / 25);
   }
  }
 }
}

mHandler를 등록하고 이미지를 준비시킨다.

onVisibilityChanged(); 화면이 보여지고 있는지 가려졌는지를
알아내 isVisible에 넣는다.  
화면이 보여지고 있다면 drawFrame();으로 들어간다.
drawFrame();  실직적으로 이미지가 그려지는 곳.  
이미지 처리를 완료하고 핸들러를 제거한다.
화면이 계속 보여지는 중이라면 원하는 딜레이로 핸들러를 다시 등록하여준다.
 

화면이 가려지거나(다른어플 실행, 화면꺼짐 등) 해당 Live Wallpaper를 종료시킬때 핸들러를 제거하여준다.
아래 화면과 같이 타이틀바 영역을 포함하여 좌표가 시작된다.

1) base

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="pe.berabue.livewallpaper"
      android:versionCode="1"
      android:versionName="1.0">

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".LiveWallPaPer_Canvas"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

  <service android:name=".WallPaPer_Canvas"  
        android:label="@string/app_name"  
        android:permission="android.permission.BIND_WALLPAPER">  
<intent-filter>  
<action android:name="android.service.wallpaper.WallpaperService"/>  
</intent-filter>  
<meta-data android:name="android.service.wallpaper" android:resource="@xml/ex"/>  
</service>  
    </application>
    
    <uses-sdk android:minSdkVersion="7" />
    <uses-feature android:name="android.software.live_wallpaper" />
</manifest>

xml파일을 syntaxhighlighter로 변환하면 이상하게 /> 문자열이 자동으로 바뀌어버리는......
아무튼, Activity는 필수가 아니다. 기본적으로 service부분과 uses-feature 부분만 넣어주면된다.



ex.xml

<?xml version="1.0" encoding="UTF-8"?>
<wallpaper 
    xmlns:android="http://schemas.android.com/apk/res/android"  
    android:thumbnail="@drawable/icon" 
    android:description="@string/test"
    android:settingsActivity="PreferenceActivity"/>

Live Wallpaper를 적용시킬때 나오는 아이콘과 설명 그리고 설정화면을 등록해준다.
android:settingsActivity부분을 넣지않으면 설정 버튼이 나오지 않는다.



WallPePer_Canvas.java
package pe.berabue.livewallpaper;
import android.service.wallpaper.WallpaperService;
import android.util.Log;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
public class WallPaPer_Canvas extends WallpaperService {
   
 @Override
 public void onCreate() {
  super.onCreate();
 }

 @Override
 public void onDestroy() {
  super.onDestroy();
 }
 @Override
 public Engine onCreateEngine() {
  return new CanvasEngine();
 }
 private class CanvasEngine extends Engine { 
       
  public CanvasEngine() {
  }

  @Override
  public void onCreate(SurfaceHolder surfaceHolder) {
   super.onCreate(surfaceHolder);
  }
  @Override
  public void onDestroy() {
   super.onDestroy();
  }
  @Override
  public void onVisibilityChanged(boolean visible) {
  }
  @Override
  public void onSurfaceCreated(SurfaceHolder holder) {
   super.onSurfaceCreated(holder);
  }

  @Override
  public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) {
   super.onSurfaceChanged(holder, format, width, height);
   Log.v(null," :::: onSurfaceChanged : "+format+" / "+width+", "+height);
  }
  @Override
  public void onSurfaceDestroyed(SurfaceHolder holder) {
   super.onSurfaceDestroyed(holder);
  }
  @Override
  public void onOffsetsChanged(float xOffset, float yOffset, float xStep, float yStep, int xPixels, int yPixels) {
   Log.v(null," :::: onOffsetsChanged : "+xOffset+", "+yOffset+", "+xStep+", "+yStep+", "+xPixels+", "+yPixels);
  }
  @Override
  public void onTouchEvent(MotionEvent event) {
   if (event.getAction() == MotionEvent.ACTION_DOWN) {
    Log.v(null," :::: onTouchEvent");
   }
   super.onTouchEvent(event);
  }
 }
}

Activity대신 WallpaperService를 상속받는데 그러면 onCreateEngine() 메서드를 구현해 주어야 한다. Engine을 상속받은 CanvasEngine클래스가 중요한 부분. 클래스 이름에 Canvas를 붙인 이유는..
목표가 OpenGL용 live wallpaper이기 때문에...(?)onVisibilityChanged();  메서드는 화면이 보여질때와 가려질때를 알아낸다. onOffsetsChanged();  화면을 밀어 옆으로 이동할때 실행된다. 

2011년 6월 27일 월요일

앞으로의 행진을 기대해 주세요!

현재 완성되어있는 안드로이드 라이브월페이퍼를
하나씩 판매할 예정입니다.
많은 관심 부탁드리겠습니다 !.