3

How can we develop the code to write letters or shapes using animations,for example a finger image needs to draw the letters like "A" or "8" or a diamond shape through animations in android.Is it possible?For that do we need to learn 2D or 3D(Opengl) animations?Or any simple procedure is there than using 3D(Im feeling that it requires opengl ),I have the knowledge in basic animations about android view animation(android.view.animation).

sunriser
  • 770
  • 3
  • 12

1 Answers1

2

It is possible but you need to learn how to make custom views and draw on canvas. Try Api Demos apllication which comes with Android SDK. In your Exclipse create a new Android project and select "Create project from existing sample". Choose target android version and then ApiDemos. Run the app and check graphics where you can find a finger drawing program. You can then see its code in Exclipse...

Here is my simple example for a start: Make certain area of bitmap transparent on touch

How can I use the animation framework inside the canvas?

Community
  • 1
  • 1
Lumis
  • 21,517
  • 8
  • 63
  • 67
  • Hi,Lumis thanks for your reply,but we did not touch screen with finger instead we will use a ImageView(no interaction from the user,just animation),which should be animated as to draw the shapes – sunriser Aug 30 '11 at 03:08
  • It does not matter whether you are using touch, you need to understand fully how these examples which use Canvas drawing work in order to create your solution. Even with OpenGL, you still need to master Canvas. – Lumis Sep 02 '11 at 13:03
  • Hi Lumis,please can you provide sample code to draw shapes of letters through animation. – sunriser Sep 02 '11 at 14:58
  • 1
    You have to learn first how the example I posted works. Then you need to learn using Path and make an object follow path and draw on a bitmap at the same time. This is not a simple tasks, hence only when you are fluent in 2D graphics functions (canvas) you can put it all together. I suggest you start from simple problems first... – Lumis Sep 02 '11 at 15:49
  • 1
    Animations using canvas: http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas/4946893#4946893 – Lumis Sep 04 '11 at 07:40