18

Does anyone know how to play .mp4 video as live wallpaper?

I searched a lot, but couldn't find the solution. I just found this one but I am not getting any idea from it.

Please help me if you have any idea regarding this concept.

Community
  • 1
  • 1
Hardik Joshi
  • 9,477
  • 12
  • 61
  • 113

2 Answers2

17

After spending 3 days finally I run this project in eclipse.

I am sharing the steps as it may help others:

Firstly, the most important thing is that Your project path and ndk path should not contain spaces else you will have problems following these steps. I also faced problems with it so please remove the spaces, if any.

For example :-

android ndk/Live wallpaper

replace it with

androidndk/Livewallpaper

Following are steps :-

1) Install NDK from Android NDK page (I used Ubuntu OS)

2) Install plugins for NDK ( https://dl-sl.google.com/android/eclipse/ )

3) Open your terminal and go to your project directory path

For Example :- /yourprojectname$

4) Now from your project directory path write Your Android NDk path

For Example :-

 /home/rainc/android_setup/android-ndk-r8d/ndk-build

And Press Enter. This will give you a .so file which means the library file has been generated..

You have done it successfully. If you are getting error(s) here then the installation and the other steps might be having error(s).

Following links helped me in my research:

First

Second

Third

And also thanks to Lazy Ninja for helping me.

Community
  • 1
  • 1
Hardik Joshi
  • 9,477
  • 12
  • 61
  • 113
  • 1
    For eclipse users you may need to rename "lib" to "libs". For windows users you also need to follow these steps: http://stackoverflow.com/questions/16113993/error-1-libavcodec-so-file-format-not-recognized-android-gl-live-wallpaper/17700708#17700708 . Finally, you may compile with ndk straight from Eclipse by right-clicking the project > Android Tools > Add native support... – manixrock Feb 28 '14 at 20:30
  • Hi @Prince i tried to follow this steps but i am unable to run this app. Do i also need to replace ffmpeg library as well? – Divyu Apr 18 '14 at 11:25
  • @Divyu nop brother. no need to replace ffmpeg library. what issue are you facing ? – Hardik Joshi Apr 18 '14 at 11:37
  • you can have my skype id divya221189. I followed all the steps but still i am getting error no launcher activity found and my app is getting crashed. Hey i need your help Please do help. – Divyu Apr 18 '14 at 11:41
  • @Divyu I am busy with other work, I can help you later. – Hardik Joshi Apr 18 '14 at 11:45
  • prince actually i am confused about the fourth step when i open project directory path .. my ndk is in some other directory so i am not getting how will i build ndk – Divyu Apr 18 '14 at 12:43
  • Hey i am done with all steps and i am getting this error java.lang.RuntimeException: Unable to instantiate service frankandrobot.glwallpapervideodemo.com – Divyu Apr 18 '14 at 13:26
  • @Divyu Sorry for late reply. Did you resolve your error / issue ? – Hardik Joshi Oct 03 '14 at 11:37
  • @Divyu what issue are you facing ?? – Hardik Joshi Oct 10 '14 at 15:14
7

You are up on a good challenge, unless you are familiar with android ndk.
There is the library ffmpeg which will save you some time.
A tutorial on Video Live Wallpaper here.
Go through part 1 -4.
And here is a link of the project code.
Hope it will help you get started.

Lazy Ninja
  • 22,342
  • 9
  • 83
  • 103