hir sherasiya

Greenhorn
+ Follow
since Jan 29, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by hir sherasiya

Hi, Friends

how to set video wallpaper in android?

this is my code, but not properly working


class MovieLiveWallpeperEngine extends Engine {

private MediaPlayer mp;

@Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mp = new MediaPlayer();
mp.setDisplay(new MySurfaceHolder(holder));
mp.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {

mp.start();
}
});
try {

String path = "/sdcard/toycom13.mpg";

mp.setDataSource(path);
} catch (Exception e) {
Log.e(TAG, "error");
}
mp.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
mp.stop();
}
});
}

@Override
public void onDestroy() {
super.onDestroy();
if (mp != null) {
mp.stop();
mp.release();
}
}

@Override
public void onVisibilityChanged(boolean visible) {
super.onVisibilityChanged(visible);
if (visible) {
play();
}
}

private void play() {
if (mp.isPlaying()) {
mp.stop();
}
try {
mp.prepareAsync();
} catch (IllegalArgumentException e) {
Log.e(TAG, "error");
} catch (SecurityException e) {
Log.e(TAG, "error");
} catch (IllegalStateException e) {
Log.e(TAG, "error");
}
}
}
13 years ago
what is the alternate use of HashTable in J2me?
13 years ago